Skip to content

Commit

Permalink
[Imo1968P2] move mathlibby
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha committed Nov 18, 2023
1 parent 4692a21 commit 4e9c73e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions Compfiles/Imo1968P2.lean
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@ namespace Imo1968P2

snip begin

@[simp] theorem List.enum_eq_nil {α : Type*} {l : List α}
: List.enum l = [] ↔ l = [] := by
cases l <;> simp [List.enum_cons]

@[simp] theorem List.mapIdx_eq_nil {α β : Type*} {f : ℕ → α → β} {l : List α}
: List.mapIdx f l = [] ↔ l = [] := by
rw [List.mapIdx_eq_enum_map]
constructor
· intro hf
cases' l with l'
· rfl
· rw [List.enum_cons, List.map_cons] at hf
simp only [Function.uncurry_apply_pair] at hf
· exact fun _ => match l with | [] => rfl
rw [List.mapIdx_eq_enum_map, List.map_eq_nil, List.enum_eq_nil]

lemma lemma0 {α β : Type} {f : ℕ → α → β} (l : List α) (h2 : l ≠ []) :
List.getLast (List.mapIdx f l) (List.mapIdx_eq_nil.not.mpr h2) =
Expand Down

0 comments on commit 4e9c73e

Please sign in to comment.