chore: upstream Std.Data.Fin.Init.Lemmas (#3337)

This commit is contained in:
Scott Morrison 2024-02-15 12:50:47 +11:00 committed by GitHub
parent 4aa62a6a9c
commit 33bb87cd1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -106,6 +106,8 @@ instance instOfNat : OfNat (Fin (no_index (n+1))) i where
instance : Inhabited (Fin (no_index (n+1))) where
default := 0
@[simp] theorem zero_eta : (⟨0, Nat.zero_lt_succ _⟩ : Fin (n + 1)) = 0 := rfl
theorem val_ne_of_ne {i j : Fin n} (h : i ≠ j) : val i ≠ val j :=
fun h' => absurd (eq_of_val_eq h') h

View file

@ -1,4 +1,4 @@
@[simp] theorem get_cons_zero {as : List α} : (a :: as).get ⟨0, Nat.zero_lt_succ _⟩ = a := rfl
@[simp] theorem get_cons_zero {as : List α} : (a :: as).get (0 : Fin (as.length + 1)) = a := rfl
example (a b c : α) : [a, b, c].get ⟨0, by simp (config := { decide := true })⟩ = a := by
simp
@ -10,4 +10,4 @@ example (a : Bool) : (a :: as).get ⟨0, by simp_arith⟩ = a := by
simp
example (a b c : α) : [a, b, c].get ⟨0, by simp (config := { decide := true })⟩ = a := by
rw [get_cons_zero]
rw [Fin.zero_eta, get_cons_zero]