You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the "Induction and Recursion" chapter, the last proof in "Local recursive declaration" doesn't work:
theorem length_replicate (n : Nat) (a : α) : (replicate n a).length = n := by
exact aux n []
where
aux (n : Nat) (as : List α)
: (replicate.loop a n as).length = n + as.length := by
match n with
| 0 => simp [replicate.loop]
| n+1 => simp [replicate.loop, aux n, Nat.add_succ, Nat.succ_add]
I was able to fix it by invoking add_succ and such_add from rw:
theorem length_replicate (n : Nat) (a : α) : (replicate n a).length = n := by
exact aux n []
where
aux (n : Nat) (as : List α)
: (replicate.loop a n as).length = n + as.length := by
match n with
| 0 => simp [replicate.loop]
| n+1 => simp [replicate.loop, aux n]; rw [Nat.add_succ, Nat.succ_add]
The text was updated successfully, but these errors were encountered:
In the "Induction and Recursion" chapter, the last proof in "Local recursive declaration" doesn't work:
I was able to fix it by invoking add_succ and such_add from rw:
The text was updated successfully, but these errors were encountered: