Skip to content

Commit

Permalink
feat(Data/Fin/Basic): intCast_val_sub_eq_ite (#17190)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Weber <[email protected]>
  • Loading branch information
Command-Master and Command-Master committed Oct 16, 2024
1 parent ebec1b6 commit 1aaa5b9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Mathlib/Data/Fin/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ theorem val_add_eq_ite {n : ℕ} (a b : Fin n) :
Nat.mod_eq_of_lt (show ↑b < n from b.2)]
--- Porting note: syntactically the same as the above

lemma intCast_val_sub_eq_sub_add_ite {n : ℕ} (a b : Fin n) :
((a - b).val : ℤ) = a.val - b.val + if b ≤ a then 0 else n := by
split <;> fin_omega

section OfNatCoe

@[simp]
Expand Down

0 comments on commit 1aaa5b9

Please sign in to comment.