chore: upstream Std.Data.Fin.Init.Lemmas (#3337)
This commit is contained in:
parent
4aa62a6a9c
commit
33bb87cd1d
2 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue