url
stringclasses
147 values
commit
stringclasses
147 values
file_path
stringlengths
7
101
full_name
stringlengths
1
94
start
stringlengths
6
10
end
stringlengths
6
11
tactic
stringlengths
1
11.2k
state_before
stringlengths
3
2.09M
state_after
stringlengths
6
2.09M
input
stringlengths
73
2.09M
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
case inl heq => simp [List.set_eq_take_cons_drop _ heq] split case h_1 heq₂ => apply_fun (@List.toArray α) at heq₂ simp only [toArray_data] at heq₂ subst heq₂ simp only [zero_le, ge_iff_le, nonpos_iff_eq_zero, size_toArray, List.length_nil, lt_self_iff_false] at heq case h_2 head tail heq₂ => apply_fun (@List.toArray α) at heq₂ simp only [toArray_data] at heq₂ subst heq₂ simp only [zero_le, ge_iff_le, nonpos_iff_eq_zero, data_toArray, List.tail_cons, List.cons.injEq, and_true] congr simp [Array.getElem_eq_data_get, Array.data_toArray (head::tail)] simp only [zero_le, ge_iff_le, nonpos_iff_eq_zero, List.get_eq_iff, data_toArray, List.cons.injEq, forall_true_left, and_imp, forall_apply_eq_imp_iff', forall_eq', List.get?_zero, List.head?_cons]
α : Type u_1 f : α → α a : Array α heq : 0 < size a ⊢ (let idx := { val := 0, isLt := heq }; let v := get a idx; do let v ← f v pure (set a idx v)).data = List.modifyHead f a.data
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α a : Array α heq : 0 < size a ⊢ (let idx := { val := 0, isLt := heq }; let v := get a idx; do let v ← f v pure (set a idx v)).data = List.modifyHead f a.data TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
case inr heq => simp only [zero_le, ge_iff_le, nonpos_iff_eq_zero, not_lt] at heq rw [← Array.toArray_data a, Array.size_toArray, List.length_eq_zero] at heq simp only [Id.pure_eq, heq, List.modifyHead]
α : Type u_1 f : α → α a : Array α heq : ¬0 < size a ⊢ (pure a).data = List.modifyHead f a.data
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α a : Array α heq : ¬0 < size a ⊢ (pure a).data = List.modifyHead f a.data TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
simp [List.set_eq_take_cons_drop _ heq]
α : Type u_1 f : α → α a : Array α heq : 0 < size a ⊢ (let idx := { val := 0, isLt := heq }; let v := get a idx; do let v ← f v pure (set a idx v)).data = List.modifyHead f a.data
α : Type u_1 f : α → α a : Array α heq : 0 < size a ⊢ f a[0] :: List.tail a.data = match a.data with | [] => [] | a :: l => f a :: l
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α a : Array α heq : 0 < size a ⊢ (let idx := { val := 0, isLt := heq }; let v := get a idx; do let v ← f v pure (set a idx v)).data = List.modifyHead f a.data TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
split
α : Type u_1 f : α → α a : Array α heq : 0 < size a ⊢ f a[0] :: List.tail a.data = match a.data with | [] => [] | a :: l => f a :: l
case h_1 α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α heq✝ : a.data = [] ⊢ f a[0] :: List.tail a.data = [] case h_2 α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝¹ : List α x✝ : α xs✝ : List α heq✝ : a.data = x✝ :: xs✝ ⊢ f a[0] :: List.tail a.data = f x✝ :: xs✝
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α a : Array α heq : 0 < size a ⊢ f a[0] :: List.tail a.data = match a.data with | [] => [] | a :: l => f a :: l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
case h_1 heq₂ => apply_fun (@List.toArray α) at heq₂ simp only [toArray_data] at heq₂ subst heq₂ simp only [zero_le, ge_iff_le, nonpos_iff_eq_zero, size_toArray, List.length_nil, lt_self_iff_false] at heq
α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α heq₂ : a.data = [] ⊢ f a[0] :: List.tail a.data = []
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α heq₂ : a.data = [] ⊢ f a[0] :: List.tail a.data = [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
case h_2 head tail heq₂ => apply_fun (@List.toArray α) at heq₂ simp only [toArray_data] at heq₂ subst heq₂ simp only [zero_le, ge_iff_le, nonpos_iff_eq_zero, data_toArray, List.tail_cons, List.cons.injEq, and_true] congr simp [Array.getElem_eq_data_get, Array.data_toArray (head::tail)] simp only [zero_le, ge_iff_le, nonpos_iff_eq_zero, List.get_eq_iff, data_toArray, List.cons.injEq, forall_true_left, and_imp, forall_apply_eq_imp_iff', forall_eq', List.get?_zero, List.head?_cons]
α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α head : α tail : List α heq₂ : a.data = head :: tail ⊢ f a[0] :: List.tail a.data = f head :: tail
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α head : α tail : List α heq₂ : a.data = head :: tail ⊢ f a[0] :: List.tail a.data = f head :: tail TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
apply_fun (@List.toArray α) at heq₂
α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α heq₂ : a.data = [] ⊢ f a[0] :: List.tail a.data = []
α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α heq₂ : List.toArray a.data = #[] ⊢ f a[0] :: List.tail a.data = []
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α heq₂ : a.data = [] ⊢ f a[0] :: List.tail a.data = [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
simp only [toArray_data] at heq₂
α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α heq₂ : List.toArray a.data = #[] ⊢ f a[0] :: List.tail a.data = []
α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α heq₂ : a = #[] ⊢ f a[0] :: List.tail a.data = []
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α heq₂ : List.toArray a.data = #[] ⊢ f a[0] :: List.tail a.data = [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
subst heq₂
α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α heq₂ : a = #[] ⊢ f a[0] :: List.tail a.data = []
α : Type u_1 f : α → α x✝ : List α heq : 0 < size #[] ⊢ f #[][0] :: List.tail #[].data = []
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α heq₂ : a = #[] ⊢ f a[0] :: List.tail a.data = [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
simp only [zero_le, ge_iff_le, nonpos_iff_eq_zero, size_toArray, List.length_nil, lt_self_iff_false] at heq
α : Type u_1 f : α → α x✝ : List α heq : 0 < size #[] ⊢ f #[][0] :: List.tail #[].data = []
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α x✝ : List α heq : 0 < size #[] ⊢ f #[][0] :: List.tail #[].data = [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
apply_fun (@List.toArray α) at heq₂
α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α head : α tail : List α heq₂ : a.data = head :: tail ⊢ f a[0] :: List.tail a.data = f head :: tail
α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α head : α tail : List α heq₂ : List.toArray a.data = List.toArray (head :: tail) ⊢ f a[0] :: List.tail a.data = f head :: tail
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α head : α tail : List α heq₂ : a.data = head :: tail ⊢ f a[0] :: List.tail a.data = f head :: tail TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
simp only [toArray_data] at heq₂
α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α head : α tail : List α heq₂ : List.toArray a.data = List.toArray (head :: tail) ⊢ f a[0] :: List.tail a.data = f head :: tail
α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α head : α tail : List α heq₂ : a = List.toArray (head :: tail) ⊢ f a[0] :: List.tail a.data = f head :: tail
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α head : α tail : List α heq₂ : List.toArray a.data = List.toArray (head :: tail) ⊢ f a[0] :: List.tail a.data = f head :: tail TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
subst heq₂
α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α head : α tail : List α heq₂ : a = List.toArray (head :: tail) ⊢ f a[0] :: List.tail a.data = f head :: tail
α : Type u_1 f : α → α x✝ : List α head : α tail : List α heq : 0 < size (List.toArray (head :: tail)) ⊢ f (List.toArray (head :: tail))[0] :: List.tail (List.toArray (head :: tail)).data = f head :: tail
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α a : Array α heq : 0 < size a x✝ : List α head : α tail : List α heq₂ : a = List.toArray (head :: tail) ⊢ f a[0] :: List.tail a.data = f head :: tail TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
simp only [zero_le, ge_iff_le, nonpos_iff_eq_zero, data_toArray, List.tail_cons, List.cons.injEq, and_true]
α : Type u_1 f : α → α x✝ : List α head : α tail : List α heq : 0 < size (List.toArray (head :: tail)) ⊢ f (List.toArray (head :: tail))[0] :: List.tail (List.toArray (head :: tail)).data = f head :: tail
α : Type u_1 f : α → α x✝ : List α head : α tail : List α heq : 0 < size (List.toArray (head :: tail)) ⊢ f (List.toArray (head :: tail))[0] = f head
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α x✝ : List α head : α tail : List α heq : 0 < size (List.toArray (head :: tail)) ⊢ f (List.toArray (head :: tail))[0] :: List.tail (List.toArray (head :: tail)).data = f head :: tail TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
congr
α : Type u_1 f : α → α x✝ : List α head : α tail : List α heq : 0 < size (List.toArray (head :: tail)) ⊢ f (List.toArray (head :: tail))[0] = f head
case e_a α : Type u_1 f : α → α x✝ : List α head : α tail : List α heq : 0 < size (List.toArray (head :: tail)) ⊢ (List.toArray (head :: tail))[0] = head
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α x✝ : List α head : α tail : List α heq : 0 < size (List.toArray (head :: tail)) ⊢ f (List.toArray (head :: tail))[0] = f head TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
simp [Array.getElem_eq_data_get, Array.data_toArray (head::tail)]
case e_a α : Type u_1 f : α → α x✝ : List α head : α tail : List α heq : 0 < size (List.toArray (head :: tail)) ⊢ (List.toArray (head :: tail))[0] = head
case e_a α : Type u_1 f : α → α x✝ : List α head : α tail : List α heq : 0 < size (List.toArray (head :: tail)) ⊢ List.get (List.toArray (head :: tail)).data { val := 0, isLt := (_ : ↑{ val := 0, isLt := heq } < size (List.toArray (head :: tail))) } = head
Please generate a tactic in lean4 to solve the state. STATE: case e_a α : Type u_1 f : α → α x✝ : List α head : α tail : List α heq : 0 < size (List.toArray (head :: tail)) ⊢ (List.toArray (head :: tail))[0] = head TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
simp only [zero_le, ge_iff_le, nonpos_iff_eq_zero, List.get_eq_iff, data_toArray, List.cons.injEq, forall_true_left, and_imp, forall_apply_eq_imp_iff', forall_eq', List.get?_zero, List.head?_cons]
case e_a α : Type u_1 f : α → α x✝ : List α head : α tail : List α heq : 0 < size (List.toArray (head :: tail)) ⊢ List.get (List.toArray (head :: tail)).data { val := 0, isLt := (_ : ↑{ val := 0, isLt := heq } < size (List.toArray (head :: tail))) } = head
no goals
Please generate a tactic in lean4 to solve the state. STATE: case e_a α : Type u_1 f : α → α x✝ : List α head : α tail : List α heq : 0 < size (List.toArray (head :: tail)) ⊢ List.get (List.toArray (head :: tail)).data { val := 0, isLt := (_ : ↑{ val := 0, isLt := heq } < size (List.toArray (head :: tail))) } = head TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
simp only [zero_le, ge_iff_le, nonpos_iff_eq_zero, not_lt] at heq
α : Type u_1 f : α → α a : Array α heq : ¬0 < size a ⊢ (pure a).data = List.modifyHead f a.data
α : Type u_1 f : α → α a : Array α heq : size a = 0 ⊢ (pure a).data = List.modifyHead f a.data
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α a : Array α heq : ¬0 < size a ⊢ (pure a).data = List.modifyHead f a.data TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
rw [← Array.toArray_data a, Array.size_toArray, List.length_eq_zero] at heq
α : Type u_1 f : α → α a : Array α heq : size a = 0 ⊢ (pure a).data = List.modifyHead f a.data
α : Type u_1 f : α → α a : Array α heq : a.data = [] ⊢ (pure a).data = List.modifyHead f a.data
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α a : Array α heq : size a = 0 ⊢ (pure a).data = List.modifyHead f a.data TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
simp only [Id.pure_eq, heq, List.modifyHead]
α : Type u_1 f : α → α a : Array α heq : a.data = [] ⊢ (pure a).data = List.modifyHead f a.data
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α a : Array α heq : a.data = [] ⊢ (pure a).data = List.modifyHead f a.data TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
induction l using List.induction_by_length_on generalizing acc with | h l ih => unfold splitOnListAux split case h_1 heq => simp [Array.ext_iff] case h_2 head tail => split case h_1 heq => rw [ih (acc:= Array.push acc head), ih (acc:= Array.push #[] head)] . simp only [Array.ext_iff, Array.modifyHead_data, modifyHead, Array.append_eq_append] cases (splitOnListAux delim tail #[] #[] h).data with | nil => simp only | cons => simp only [cons.injEq, Array.ext_iff, Array.append_data, Array.push_data, append_assoc, singleton_append, Array.data_toArray, nil_append, and_self] . simp only [length_cons, Nat.lt_succ_self] . simp only [length_cons, Nat.lt_succ_self] case h_2 heq => have h₁: (Array.push #[] acc) = (Array.push #[] acc) ++ #[] := by simp [Array.ext_iff] have h₂: (Array.push #[] #[]) = (Array.push #[] (#[]:Array α)) ++ #[] := by simp [Array.ext_iff] rw [h₁,h₂,List.splitOnListAux_r, List.splitOnListAux_r] simp [Array.ext_iff]
α : Type u_1 inst✝ : DecidableEq α delim l : List α acc : Array α h : delim ≠ [] ⊢ splitOnListAux delim l acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l #[] #[] h)
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim l : List α acc : Array α h : delim ≠ [] ⊢ splitOnListAux delim l acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l #[] #[] h) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
unfold splitOnListAux
case h α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] l : List α ih : ∀ (l₂ : List α), length l₂ < length l → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) acc : Array α ⊢ splitOnListAux delim l acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l #[] #[] h)
case h α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] l : List α ih : ∀ (l₂ : List α), length l₂ < length l → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) acc : Array α ⊢ (match _h₀ : l with | [] => Array.push #[] acc | head :: tail => match h : getRest l delim with | none => splitOnListAux delim tail (Array.push acc head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf l); splitOnListAux delim rest #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (match _h₀ : l with | [] => Array.push #[] #[] | head :: tail => match h : getRest l delim with | none => splitOnListAux delim tail (Array.push #[] head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf l); splitOnListAux delim rest #[] (Array.push #[] #[]) h)
Please generate a tactic in lean4 to solve the state. STATE: case h α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] l : List α ih : ∀ (l₂ : List α), length l₂ < length l → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) acc : Array α ⊢ splitOnListAux delim l acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l #[] #[] h) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
split
case h α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] l : List α ih : ∀ (l₂ : List α), length l₂ < length l → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) acc : Array α ⊢ (match _h₀ : l with | [] => Array.push #[] acc | head :: tail => match h : getRest l delim with | none => splitOnListAux delim tail (Array.push acc head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf l); splitOnListAux delim rest #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (match _h₀ : l with | [] => Array.push #[] #[] | head :: tail => match h : getRest l delim with | none => splitOnListAux delim tail (Array.push #[] head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf l); splitOnListAux delim rest #[] (Array.push #[] #[]) h)
case h.h_1 α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α ih : ∀ (l₂ : List α), length l₂ < length [] → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) ⊢ Array.push #[] acc = Array.modifyHead (Array.append acc) (Array.push #[] #[]) case h.h_2 α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head✝ : α tail✝ : List α ih : ∀ (l₂ : List α), length l₂ < length (head✝ :: tail✝) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) ⊢ (match h : getRest (head✝ :: tail✝) delim with | none => splitOnListAux delim tail✝ (Array.push acc head✝) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (head✝ :: tail✝)); splitOnListAux delim rest #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (match h : getRest (head✝ :: tail✝) delim with | none => splitOnListAux delim tail✝ (Array.push #[] head✝) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (head✝ :: tail✝)); splitOnListAux delim rest #[] (Array.push #[] #[]) h)
Please generate a tactic in lean4 to solve the state. STATE: case h α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] l : List α ih : ∀ (l₂ : List α), length l₂ < length l → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) acc : Array α ⊢ (match _h₀ : l with | [] => Array.push #[] acc | head :: tail => match h : getRest l delim with | none => splitOnListAux delim tail (Array.push acc head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf l); splitOnListAux delim rest #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (match _h₀ : l with | [] => Array.push #[] #[] | head :: tail => match h : getRest l delim with | none => splitOnListAux delim tail (Array.push #[] head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf l); splitOnListAux delim rest #[] (Array.push #[] #[]) h) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
case h_1 heq => simp [Array.ext_iff]
α : Type u_1 heq : DecidableEq α delim : List α h : delim ≠ [] acc : Array α ih : ∀ (l₂ : List α), length l₂ < length [] → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) ⊢ Array.push #[] acc = Array.modifyHead (Array.append acc) (Array.push #[] #[])
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 heq : DecidableEq α delim : List α h : delim ≠ [] acc : Array α ih : ∀ (l₂ : List α), length l₂ < length [] → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) ⊢ Array.push #[] acc = Array.modifyHead (Array.append acc) (Array.push #[] #[]) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
case h_2 head tail => split case h_1 heq => rw [ih (acc:= Array.push acc head), ih (acc:= Array.push #[] head)] . simp only [Array.ext_iff, Array.modifyHead_data, modifyHead, Array.append_eq_append] cases (splitOnListAux delim tail #[] #[] h).data with | nil => simp only | cons => simp only [cons.injEq, Array.ext_iff, Array.append_data, Array.push_data, append_assoc, singleton_append, Array.data_toArray, nil_append, and_self] . simp only [length_cons, Nat.lt_succ_self] . simp only [length_cons, Nat.lt_succ_self] case h_2 heq => have h₁: (Array.push #[] acc) = (Array.push #[] acc) ++ #[] := by simp [Array.ext_iff] have h₂: (Array.push #[] #[]) = (Array.push #[] (#[]:Array α)) ++ #[] := by simp [Array.ext_iff] rw [h₁,h₂,List.splitOnListAux_r, List.splitOnListAux_r] simp [Array.ext_iff]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) ⊢ (match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push acc head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (head :: tail)); splitOnListAux delim rest #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push #[] head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (head :: tail)); splitOnListAux delim rest #[] (Array.push #[] #[]) h)
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) ⊢ (match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push acc head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (head :: tail)); splitOnListAux delim rest #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push #[] head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (head :: tail)); splitOnListAux delim rest #[] (Array.push #[] #[]) h) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
simp [Array.ext_iff]
α : Type u_1 heq : DecidableEq α delim : List α h : delim ≠ [] acc : Array α ih : ∀ (l₂ : List α), length l₂ < length [] → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) ⊢ Array.push #[] acc = Array.modifyHead (Array.append acc) (Array.push #[] #[])
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 heq : DecidableEq α delim : List α h : delim ≠ [] acc : Array α ih : ∀ (l₂ : List α), length l₂ < length [] → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) ⊢ Array.push #[] acc = Array.modifyHead (Array.append acc) (Array.push #[] #[]) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
split
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) ⊢ (match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push acc head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (head :: tail)); splitOnListAux delim rest #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push #[] head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (head :: tail)); splitOnListAux delim rest #[] (Array.push #[] #[]) h)
case h_1 α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq✝ : getRest (head :: tail) delim = none ⊢ splitOnListAux delim tail (Array.push acc head) #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim tail (Array.push #[] head) #[] h) case h_2 α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) rest✝ : List α heq✝ : getRest (head :: tail) delim = some rest✝ ⊢ (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] #[]) h)
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) ⊢ (match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push acc head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (head :: tail)); splitOnListAux delim rest #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push #[] head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (head :: tail)); splitOnListAux delim rest #[] (Array.push #[] #[]) h) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
case h_1 heq => rw [ih (acc:= Array.push acc head), ih (acc:= Array.push #[] head)] . simp only [Array.ext_iff, Array.modifyHead_data, modifyHead, Array.append_eq_append] cases (splitOnListAux delim tail #[] #[] h).data with | nil => simp only | cons => simp only [cons.injEq, Array.ext_iff, Array.append_data, Array.push_data, append_assoc, singleton_append, Array.data_toArray, nil_append, and_self] . simp only [length_cons, Nat.lt_succ_self] . simp only [length_cons, Nat.lt_succ_self]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ splitOnListAux delim tail (Array.push acc head) #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim tail (Array.push #[] head) #[] h)
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ splitOnListAux delim tail (Array.push acc head) #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim tail (Array.push #[] head) #[] h) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
case h_2 heq => have h₁: (Array.push #[] acc) = (Array.push #[] acc) ++ #[] := by simp [Array.ext_iff] have h₂: (Array.push #[] #[]) = (Array.push #[] (#[]:Array α)) ++ #[] := by simp [Array.ext_iff] rw [h₁,h₂,List.splitOnListAux_r, List.splitOnListAux_r] simp [Array.ext_iff]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) rest✝ : List α heq : getRest (head :: tail) delim = some rest✝ ⊢ (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] #[]) h)
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) rest✝ : List α heq : getRest (head :: tail) delim = some rest✝ ⊢ (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] #[]) h) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
rw [ih (acc:= Array.push acc head), ih (acc:= Array.push #[] head)]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ splitOnListAux delim tail (Array.push acc head) #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim tail (Array.push #[] head) #[] h)
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ Array.modifyHead (Array.append (Array.push acc head)) (splitOnListAux delim tail #[] #[] h) = Array.modifyHead (Array.append acc) (Array.modifyHead (Array.append (Array.push #[] head)) (splitOnListAux delim tail #[] #[] h)) case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ length tail < length (head :: tail) case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ length tail < length (head :: tail)
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ splitOnListAux delim tail (Array.push acc head) #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim tail (Array.push #[] head) #[] h) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
. simp only [Array.ext_iff, Array.modifyHead_data, modifyHead, Array.append_eq_append] cases (splitOnListAux delim tail #[] #[] h).data with | nil => simp only | cons => simp only [cons.injEq, Array.ext_iff, Array.append_data, Array.push_data, append_assoc, singleton_append, Array.data_toArray, nil_append, and_self]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ Array.modifyHead (Array.append (Array.push acc head)) (splitOnListAux delim tail #[] #[] h) = Array.modifyHead (Array.append acc) (Array.modifyHead (Array.append (Array.push #[] head)) (splitOnListAux delim tail #[] #[] h)) case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ length tail < length (head :: tail) case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ length tail < length (head :: tail)
case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ length tail < length (head :: tail) case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ length tail < length (head :: tail)
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ Array.modifyHead (Array.append (Array.push acc head)) (splitOnListAux delim tail #[] #[] h) = Array.modifyHead (Array.append acc) (Array.modifyHead (Array.append (Array.push #[] head)) (splitOnListAux delim tail #[] #[] h)) case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ length tail < length (head :: tail) case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ length tail < length (head :: tail) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
. simp only [length_cons, Nat.lt_succ_self]
case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ length tail < length (head :: tail) case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ length tail < length (head :: tail)
case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ length tail < length (head :: tail)
Please generate a tactic in lean4 to solve the state. STATE: case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ length tail < length (head :: tail) case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ length tail < length (head :: tail) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
. simp only [length_cons, Nat.lt_succ_self]
case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ length tail < length (head :: tail)
no goals
Please generate a tactic in lean4 to solve the state. STATE: case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ length tail < length (head :: tail) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
simp only
case nil α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ (match [] with | [] => [] | a :: l => (Array.push acc head ++ a) :: l) = match match [] with | [] => [] | a :: l => (Array.push #[] head ++ a) :: l with | [] => [] | a :: l => (acc ++ a) :: l
no goals
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none ⊢ (match [] with | [] => [] | a :: l => (Array.push acc head ++ a) :: l) = match match [] with | [] => [] | a :: l => (Array.push #[] head ++ a) :: l with | [] => [] | a :: l => (acc ++ a) :: l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
simp only [cons.injEq, Array.ext_iff, Array.append_data, Array.push_data, append_assoc, singleton_append, Array.data_toArray, nil_append, and_self]
case cons α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none head✝ : Array α tail✝ : List (Array α) ⊢ (match head✝ :: tail✝ with | [] => [] | a :: l => (Array.push acc head ++ a) :: l) = match match head✝ :: tail✝ with | [] => [] | a :: l => (Array.push #[] head ++ a) :: l with | [] => [] | a :: l => (acc ++ a) :: l
no goals
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) heq : getRest (head :: tail) delim = none head✝ : Array α tail✝ : List (Array α) ⊢ (match head✝ :: tail✝ with | [] => [] | a :: l => (Array.push acc head ++ a) :: l) = match match head✝ :: tail✝ with | [] => [] | a :: l => (Array.push #[] head ++ a) :: l with | [] => [] | a :: l => (acc ++ a) :: l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
have h₁: (Array.push #[] acc) = (Array.push #[] acc) ++ #[] := by simp [Array.ext_iff]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) rest✝ : List α heq : getRest (head :: tail) delim = some rest✝ ⊢ (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] #[]) h)
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) rest✝ : List α heq : getRest (head :: tail) delim = some rest✝ h₁ : Array.push #[] acc = Array.push #[] acc ++ #[] ⊢ (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] #[]) h)
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) rest✝ : List α heq : getRest (head :: tail) delim = some rest✝ ⊢ (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] #[]) h) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
have h₂: (Array.push #[] #[]) = (Array.push #[] (#[]:Array α)) ++ #[] := by simp [Array.ext_iff]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) rest✝ : List α heq : getRest (head :: tail) delim = some rest✝ h₁ : Array.push #[] acc = Array.push #[] acc ++ #[] ⊢ (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] #[]) h)
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) rest✝ : List α heq : getRest (head :: tail) delim = some rest✝ h₁ : Array.push #[] acc = Array.push #[] acc ++ #[] h₂ : Array.push #[] #[] = Array.push #[] #[] ++ #[] ⊢ (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] #[]) h)
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) rest✝ : List α heq : getRest (head :: tail) delim = some rest✝ h₁ : Array.push #[] acc = Array.push #[] acc ++ #[] ⊢ (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] #[]) h) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
rw [h₁,h₂,List.splitOnListAux_r, List.splitOnListAux_r]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) rest✝ : List α heq : getRest (head :: tail) delim = some rest✝ h₁ : Array.push #[] acc = Array.push #[] acc ++ #[] h₂ : Array.push #[] #[] = Array.push #[] #[] ++ #[] ⊢ (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] #[]) h)
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) rest✝ : List α heq : getRest (head :: tail) delim = some rest✝ h₁ : Array.push #[] acc = Array.push #[] acc ++ #[] h₂ : Array.push #[] #[] = Array.push #[] #[] ++ #[] ⊢ (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); Array.push #[] acc ++ splitOnListAux delim rest✝ #[] #[] h) = Array.modifyHead (Array.append acc) (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); Array.push #[] #[] ++ splitOnListAux delim rest✝ #[] #[] h)
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) rest✝ : List α heq : getRest (head :: tail) delim = some rest✝ h₁ : Array.push #[] acc = Array.push #[] acc ++ #[] h₂ : Array.push #[] #[] = Array.push #[] #[] ++ #[] ⊢ (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] acc) h) = Array.modifyHead (Array.append acc) (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] #[]) h) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
simp [Array.ext_iff]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) rest✝ : List α heq : getRest (head :: tail) delim = some rest✝ h₁ : Array.push #[] acc = Array.push #[] acc ++ #[] h₂ : Array.push #[] #[] = Array.push #[] #[] ++ #[] ⊢ (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); Array.push #[] acc ++ splitOnListAux delim rest✝ #[] #[] h) = Array.modifyHead (Array.append acc) (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); Array.push #[] #[] ++ splitOnListAux delim rest✝ #[] #[] h)
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) rest✝ : List α heq : getRest (head :: tail) delim = some rest✝ h₁ : Array.push #[] acc = Array.push #[] acc ++ #[] h₂ : Array.push #[] #[] = Array.push #[] #[] ++ #[] ⊢ (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); Array.push #[] acc ++ splitOnListAux delim rest✝ #[] #[] h) = Array.modifyHead (Array.append acc) (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); Array.push #[] #[] ++ splitOnListAux delim rest✝ #[] #[] h) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
simp [Array.ext_iff]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) rest✝ : List α heq : getRest (head :: tail) delim = some rest✝ ⊢ Array.push #[] acc = Array.push #[] acc ++ #[]
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) rest✝ : List α heq : getRest (head :: tail) delim = some rest✝ ⊢ Array.push #[] acc = Array.push #[] acc ++ #[] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_acc
[1067, 1]
[1092, 29]
simp [Array.ext_iff]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) rest✝ : List α heq : getRest (head :: tail) delim = some rest✝ h₁ : Array.push #[] acc = Array.push #[] acc ++ #[] ⊢ Array.push #[] #[] = Array.push #[] #[] ++ #[]
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ (acc : Array α), splitOnListAux delim l₂ acc #[] h = Array.modifyHead (Array.append acc) (splitOnListAux delim l₂ #[] #[] h) rest✝ : List α heq : getRest (head :: tail) delim = some rest✝ h₁ : Array.push #[] acc = Array.push #[] acc ++ #[] ⊢ Array.push #[] #[] = Array.push #[] #[] ++ #[] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_delim
[1095, 1]
[1110, 99]
conv => left; unfold splitOnListAux
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α delim l : List α h : delim ≠ [] ⊢ splitOnListAux delim (delim ++ l) acc r h = r ++ #[acc] ++ splitOnListAux delim l #[] #[] h
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α delim l : List α h : delim ≠ [] ⊢ (match _h₀ : delim ++ l with | [] => Array.push r acc | head :: tail => match h : getRest (delim ++ l) delim with | none => splitOnListAux delim tail (Array.push acc head) r h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (delim ++ l)); splitOnListAux delim rest #[] (Array.push r acc) h) = r ++ #[acc] ++ splitOnListAux delim l #[] #[] h
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α delim l : List α h : delim ≠ [] ⊢ splitOnListAux delim (delim ++ l) acc r h = r ++ #[acc] ++ splitOnListAux delim l #[] #[] h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_delim
[1095, 1]
[1110, 99]
have ⟨head, tail, heq⟩ :=List.exists_cons_of_ne_nil h
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α delim l : List α h : delim ≠ [] ⊢ (match _h₀ : delim ++ l with | [] => Array.push r acc | head :: tail => match h : getRest (delim ++ l) delim with | none => splitOnListAux delim tail (Array.push acc head) r h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (delim ++ l)); splitOnListAux delim rest #[] (Array.push r acc) h) = r ++ #[acc] ++ splitOnListAux delim l #[] #[] h
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α delim l : List α h : delim ≠ [] head : α tail : List α heq : delim = head :: tail ⊢ (match _h₀ : delim ++ l with | [] => Array.push r acc | head :: tail => match h : getRest (delim ++ l) delim with | none => splitOnListAux delim tail (Array.push acc head) r h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (delim ++ l)); splitOnListAux delim rest #[] (Array.push r acc) h) = r ++ #[acc] ++ splitOnListAux delim l #[] #[] h
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α delim l : List α h : delim ≠ [] ⊢ (match _h₀ : delim ++ l with | [] => Array.push r acc | head :: tail => match h : getRest (delim ++ l) delim with | none => splitOnListAux delim tail (Array.push acc head) r h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (delim ++ l)); splitOnListAux delim rest #[] (Array.push r acc) h) = r ++ #[acc] ++ splitOnListAux delim l #[] #[] h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_delim
[1095, 1]
[1110, 99]
subst heq
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α delim l : List α h : delim ≠ [] head : α tail : List α heq : delim = head :: tail ⊢ (match _h₀ : delim ++ l with | [] => Array.push r acc | head :: tail => match h : getRest (delim ++ l) delim with | none => splitOnListAux delim tail (Array.push acc head) r h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (delim ++ l)); splitOnListAux delim rest #[] (Array.push r acc) h) = r ++ #[acc] ++ splitOnListAux delim l #[] #[] h
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] ⊢ (match _h₀ : head :: tail ++ l with | [] => Array.push r acc | head_1 :: tail_1 => match h : getRest (head :: tail ++ l) (head :: tail) with | none => splitOnListAux (head :: tail) tail_1 (Array.push acc head_1) r h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (head :: tail ++ l)); splitOnListAux (head :: tail) rest #[] (Array.push r acc) h) = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α delim l : List α h : delim ≠ [] head : α tail : List α heq : delim = head :: tail ⊢ (match _h₀ : delim ++ l with | [] => Array.push r acc | head :: tail => match h : getRest (delim ++ l) delim with | none => splitOnListAux delim tail (Array.push acc head) r h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (delim ++ l)); splitOnListAux delim rest #[] (Array.push r acc) h) = r ++ #[acc] ++ splitOnListAux delim l #[] #[] h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_delim
[1095, 1]
[1110, 99]
simp only [cons_append]
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] ⊢ (match _h₀ : head :: tail ++ l with | [] => Array.push r acc | head_1 :: tail_1 => match h : getRest (head :: tail ++ l) (head :: tail) with | none => splitOnListAux (head :: tail) tail_1 (Array.push acc head_1) r h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (head :: tail ++ l)); splitOnListAux (head :: tail) rest #[] (Array.push r acc) h) = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] ⊢ (match h : getRest (head :: (tail ++ l)) (head :: tail) with | none => splitOnListAux (head :: tail) (tail ++ l) (Array.push acc head) r h | some rest => splitOnListAux (head :: tail) rest #[] (Array.push r acc) h) = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] ⊢ (match _h₀ : head :: tail ++ l with | [] => Array.push r acc | head_1 :: tail_1 => match h : getRest (head :: tail ++ l) (head :: tail) with | none => splitOnListAux (head :: tail) tail_1 (Array.push acc head_1) r h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (head :: tail ++ l)); splitOnListAux (head :: tail) rest #[] (Array.push r acc) h) = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_delim
[1095, 1]
[1110, 99]
split
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] ⊢ (match h : getRest (head :: (tail ++ l)) (head :: tail) with | none => splitOnListAux (head :: tail) (tail ++ l) (Array.push acc head) r h | some rest => splitOnListAux (head :: tail) rest #[] (Array.push r acc) h) = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h
case h_1 α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] heq✝ : getRest (head :: (tail ++ l)) (head :: tail) = none ⊢ splitOnListAux (head :: tail) (tail ++ l) (Array.push acc head) r h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h case h_2 α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest✝ : List α heq✝ : getRest (head :: (tail ++ l)) (head :: tail) = some rest✝ ⊢ splitOnListAux (head :: tail) rest✝ #[] (Array.push r acc) h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] ⊢ (match h : getRest (head :: (tail ++ l)) (head :: tail) with | none => splitOnListAux (head :: tail) (tail ++ l) (Array.push acc head) r h | some rest => splitOnListAux (head :: tail) rest #[] (Array.push r acc) h) = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_delim
[1095, 1]
[1110, 99]
case h_1 heq => unfold getRest at heq simp at heq
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] heq : getRest (head :: (tail ++ l)) (head :: tail) = none ⊢ splitOnListAux (head :: tail) (tail ++ l) (Array.push acc head) r h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] heq : getRest (head :: (tail ++ l)) (head :: tail) = none ⊢ splitOnListAux (head :: tail) (tail ++ l) (Array.push acc head) r h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_delim
[1095, 1]
[1110, 99]
case h_2 rest heq => have h₂ : (Array.push r acc) = r ++ #[acc] ++ #[] := by simp only [Array.ext_iff, Array.push_data, Array.append_data, Array.data_toArray, append_nil] rw [h₂, List.splitOnListAux_r] congr have h₃ := List.eq_append_of_getRest heq simp_all only [ne_eq, not_false_iff, cons_append, cons.injEq, append_cancel_left_eq, true_and]
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest : List α heq : getRest (head :: (tail ++ l)) (head :: tail) = some rest ⊢ splitOnListAux (head :: tail) rest #[] (Array.push r acc) h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest : List α heq : getRest (head :: (tail ++ l)) (head :: tail) = some rest ⊢ splitOnListAux (head :: tail) rest #[] (Array.push r acc) h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_delim
[1095, 1]
[1110, 99]
unfold getRest at heq
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] heq : getRest (head :: (tail ++ l)) (head :: tail) = none ⊢ splitOnListAux (head :: tail) (tail ++ l) (Array.push acc head) r h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] heq : (if head = head then getRest (tail ++ l) tail else none) = none ⊢ splitOnListAux (head :: tail) (tail ++ l) (Array.push acc head) r h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] heq : getRest (head :: (tail ++ l)) (head :: tail) = none ⊢ splitOnListAux (head :: tail) (tail ++ l) (Array.push acc head) r h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_delim
[1095, 1]
[1110, 99]
simp at heq
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] heq : (if head = head then getRest (tail ++ l) tail else none) = none ⊢ splitOnListAux (head :: tail) (tail ++ l) (Array.push acc head) r h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] heq : (if head = head then getRest (tail ++ l) tail else none) = none ⊢ splitOnListAux (head :: tail) (tail ++ l) (Array.push acc head) r h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_delim
[1095, 1]
[1110, 99]
have h₂ : (Array.push r acc) = r ++ #[acc] ++ #[] := by simp only [Array.ext_iff, Array.push_data, Array.append_data, Array.data_toArray, append_nil]
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest : List α heq : getRest (head :: (tail ++ l)) (head :: tail) = some rest ⊢ splitOnListAux (head :: tail) rest #[] (Array.push r acc) h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest : List α heq : getRest (head :: (tail ++ l)) (head :: tail) = some rest h₂ : Array.push r acc = r ++ #[acc] ++ #[] ⊢ splitOnListAux (head :: tail) rest #[] (Array.push r acc) h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest : List α heq : getRest (head :: (tail ++ l)) (head :: tail) = some rest ⊢ splitOnListAux (head :: tail) rest #[] (Array.push r acc) h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_delim
[1095, 1]
[1110, 99]
rw [h₂, List.splitOnListAux_r]
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest : List α heq : getRest (head :: (tail ++ l)) (head :: tail) = some rest h₂ : Array.push r acc = r ++ #[acc] ++ #[] ⊢ splitOnListAux (head :: tail) rest #[] (Array.push r acc) h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest : List α heq : getRest (head :: (tail ++ l)) (head :: tail) = some rest h₂ : Array.push r acc = r ++ #[acc] ++ #[] ⊢ r ++ #[acc] ++ splitOnListAux (head :: tail) rest #[] #[] h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest : List α heq : getRest (head :: (tail ++ l)) (head :: tail) = some rest h₂ : Array.push r acc = r ++ #[acc] ++ #[] ⊢ splitOnListAux (head :: tail) rest #[] (Array.push r acc) h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_delim
[1095, 1]
[1110, 99]
congr
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest : List α heq : getRest (head :: (tail ++ l)) (head :: tail) = some rest h₂ : Array.push r acc = r ++ #[acc] ++ #[] ⊢ r ++ #[acc] ++ splitOnListAux (head :: tail) rest #[] #[] h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h
case e_a.e_l α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest : List α heq : getRest (head :: (tail ++ l)) (head :: tail) = some rest h₂ : Array.push r acc = r ++ #[acc] ++ #[] ⊢ rest = l
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest : List α heq : getRest (head :: (tail ++ l)) (head :: tail) = some rest h₂ : Array.push r acc = r ++ #[acc] ++ #[] ⊢ r ++ #[acc] ++ splitOnListAux (head :: tail) rest #[] #[] h = r ++ #[acc] ++ splitOnListAux (head :: tail) l #[] #[] h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_delim
[1095, 1]
[1110, 99]
have h₃ := List.eq_append_of_getRest heq
case e_a.e_l α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest : List α heq : getRest (head :: (tail ++ l)) (head :: tail) = some rest h₂ : Array.push r acc = r ++ #[acc] ++ #[] ⊢ rest = l
case e_a.e_l α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest : List α heq : getRest (head :: (tail ++ l)) (head :: tail) = some rest h₂ : Array.push r acc = r ++ #[acc] ++ #[] h₃ : head :: (tail ++ l) = head :: tail ++ rest ⊢ rest = l
Please generate a tactic in lean4 to solve the state. STATE: case e_a.e_l α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest : List α heq : getRest (head :: (tail ++ l)) (head :: tail) = some rest h₂ : Array.push r acc = r ++ #[acc] ++ #[] ⊢ rest = l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_delim
[1095, 1]
[1110, 99]
simp_all only [ne_eq, not_false_iff, cons_append, cons.injEq, append_cancel_left_eq, true_and]
case e_a.e_l α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest : List α heq : getRest (head :: (tail ++ l)) (head :: tail) = some rest h₂ : Array.push r acc = r ++ #[acc] ++ #[] h₃ : head :: (tail ++ l) = head :: tail ++ rest ⊢ rest = l
no goals
Please generate a tactic in lean4 to solve the state. STATE: case e_a.e_l α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest : List α heq : getRest (head :: (tail ++ l)) (head :: tail) = some rest h₂ : Array.push r acc = r ++ #[acc] ++ #[] h₃ : head :: (tail ++ l) = head :: tail ++ rest ⊢ rest = l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_delim
[1095, 1]
[1110, 99]
simp only [Array.ext_iff, Array.push_data, Array.append_data, Array.data_toArray, append_nil]
α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest : List α heq : getRest (head :: (tail ++ l)) (head :: tail) = some rest ⊢ Array.push r acc = r ++ #[acc] ++ #[]
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 acc : Array α r : Array (Array α) inst✝ : DecidableEq α l : List α head : α tail : List α h : head :: tail ≠ [] rest : List α heq : getRest (head :: (tail ++ l)) (head :: tail) = some rest ⊢ Array.push r acc = r ++ #[acc] ++ #[] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_nonmatching
[1113, 1]
[1128, 85]
unfold splitOnListAux
α : Type u_1 delim : List α inst✝ : DecidableEq α l : List α h₁ : ¬delim <:+: l h : delim ≠ [] ⊢ splitOnListAux delim l #[] #[] h = #[toArray l]
α : Type u_1 delim : List α inst✝ : DecidableEq α l : List α h₁ : ¬delim <:+: l h : delim ≠ [] ⊢ (match _h₀ : l with | [] => Array.push #[] #[] | head :: tail => match h : getRest l delim with | none => splitOnListAux delim tail (Array.push #[] head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf l); splitOnListAux delim rest #[] (Array.push #[] #[]) h) = #[toArray l]
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 delim : List α inst✝ : DecidableEq α l : List α h₁ : ¬delim <:+: l h : delim ≠ [] ⊢ splitOnListAux delim l #[] #[] h = #[toArray l] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_nonmatching
[1113, 1]
[1128, 85]
split
α : Type u_1 delim : List α inst✝ : DecidableEq α l : List α h₁ : ¬delim <:+: l h : delim ≠ [] ⊢ (match _h₀ : l with | [] => Array.push #[] #[] | head :: tail => match h : getRest l delim with | none => splitOnListAux delim tail (Array.push #[] head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf l); splitOnListAux delim rest #[] (Array.push #[] #[]) h) = #[toArray l]
case h_1 α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] h₁ : ¬delim <:+: [] ⊢ Array.push #[] #[] = #[#[]] case h_2 α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head✝ : α tail✝ : List α h₁ : ¬delim <:+: head✝ :: tail✝ ⊢ (match h : getRest (head✝ :: tail✝) delim with | none => splitOnListAux delim tail✝ (Array.push #[] head✝) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (head✝ :: tail✝)); splitOnListAux delim rest #[] (Array.push #[] #[]) h) = #[toArray (head✝ :: tail✝)]
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 delim : List α inst✝ : DecidableEq α l : List α h₁ : ¬delim <:+: l h : delim ≠ [] ⊢ (match _h₀ : l with | [] => Array.push #[] #[] | head :: tail => match h : getRest l delim with | none => splitOnListAux delim tail (Array.push #[] head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf l); splitOnListAux delim rest #[] (Array.push #[] #[]) h) = #[toArray l] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_nonmatching
[1113, 1]
[1128, 85]
case h_1 => simp only [Array.ext_iff, Array.push_data, Array.data_toArray, nil_append]
α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] h₁ : ¬delim <:+: [] ⊢ Array.push #[] #[] = #[#[]]
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] h₁ : ¬delim <:+: [] ⊢ Array.push #[] #[] = #[#[]] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_nonmatching
[1113, 1]
[1128, 85]
case h_2 head tail => split case h_1 heq => rw [List.splitOnListAux_acc, List.splitOnListAux_nonmatching tail] . simp only [Array.ext_iff, Array.modifyHead_data, modifyHead, Array.data_toArray, Array.append_eq_append, cons.injEq, Array.append_data, Array.push_data, nil_append, singleton_append, and_self] . intro contr apply h₁ exact List.isInfix_cons contr case h_2 head tail heq => simp only [List.eq_append_of_getRest heq, isInfix_append_left, not_true] at h₁
α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail ⊢ (match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push #[] head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (head :: tail)); splitOnListAux delim rest #[] (Array.push #[] #[]) h) = #[toArray (head :: tail)]
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail ⊢ (match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push #[] head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (head :: tail)); splitOnListAux delim rest #[] (Array.push #[] #[]) h) = #[toArray (head :: tail)] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_nonmatching
[1113, 1]
[1128, 85]
simp only [Array.ext_iff, Array.push_data, Array.data_toArray, nil_append]
α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] h₁ : ¬delim <:+: [] ⊢ Array.push #[] #[] = #[#[]]
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] h₁ : ¬delim <:+: [] ⊢ Array.push #[] #[] = #[#[]] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_nonmatching
[1113, 1]
[1128, 85]
split
α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail ⊢ (match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push #[] head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (head :: tail)); splitOnListAux delim rest #[] (Array.push #[] #[]) h) = #[toArray (head :: tail)]
case h_1 α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail heq✝ : getRest (head :: tail) delim = none ⊢ splitOnListAux delim tail (Array.push #[] head) #[] h = #[toArray (head :: tail)] case h_2 α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail rest✝ : List α heq✝ : getRest (head :: tail) delim = some rest✝ ⊢ (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push #[] #[]) h) = #[toArray (head :: tail)]
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail ⊢ (match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push #[] head) #[] h | some rest => let_fun x := (_ : sizeOf rest < sizeOf (head :: tail)); splitOnListAux delim rest #[] (Array.push #[] #[]) h) = #[toArray (head :: tail)] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_nonmatching
[1113, 1]
[1128, 85]
case h_1 heq => rw [List.splitOnListAux_acc, List.splitOnListAux_nonmatching tail] . simp only [Array.ext_iff, Array.modifyHead_data, modifyHead, Array.data_toArray, Array.append_eq_append, cons.injEq, Array.append_data, Array.push_data, nil_append, singleton_append, and_self] . intro contr apply h₁ exact List.isInfix_cons contr
α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail heq : getRest (head :: tail) delim = none ⊢ splitOnListAux delim tail (Array.push #[] head) #[] h = #[toArray (head :: tail)]
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail heq : getRest (head :: tail) delim = none ⊢ splitOnListAux delim tail (Array.push #[] head) #[] h = #[toArray (head :: tail)] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_nonmatching
[1113, 1]
[1128, 85]
case h_2 head tail heq => simp only [List.eq_append_of_getRest heq, isInfix_append_left, not_true] at h₁
α : Type u_1 delim : List α head✝ : DecidableEq α h : delim ≠ [] head : α tail✝ : List α h₁ : ¬delim <:+: head :: tail✝ tail : List α heq : getRest (head :: tail✝) delim = some tail ⊢ (let_fun x := (_ : sizeOf tail < sizeOf (head :: tail✝)); splitOnListAux delim tail #[] (Array.push #[] #[]) h) = #[toArray (head :: tail✝)]
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 delim : List α head✝ : DecidableEq α h : delim ≠ [] head : α tail✝ : List α h₁ : ¬delim <:+: head :: tail✝ tail : List α heq : getRest (head :: tail✝) delim = some tail ⊢ (let_fun x := (_ : sizeOf tail < sizeOf (head :: tail✝)); splitOnListAux delim tail #[] (Array.push #[] #[]) h) = #[toArray (head :: tail✝)] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_nonmatching
[1113, 1]
[1128, 85]
rw [List.splitOnListAux_acc, List.splitOnListAux_nonmatching tail]
α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail heq : getRest (head :: tail) delim = none ⊢ splitOnListAux delim tail (Array.push #[] head) #[] h = #[toArray (head :: tail)]
α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail heq : getRest (head :: tail) delim = none ⊢ Array.modifyHead (Array.append (Array.push #[] head)) #[toArray tail] = #[toArray (head :: tail)] case h₁ α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail heq : getRest (head :: tail) delim = none ⊢ ¬delim <:+: tail
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail heq : getRest (head :: tail) delim = none ⊢ splitOnListAux delim tail (Array.push #[] head) #[] h = #[toArray (head :: tail)] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_nonmatching
[1113, 1]
[1128, 85]
. simp only [Array.ext_iff, Array.modifyHead_data, modifyHead, Array.data_toArray, Array.append_eq_append, cons.injEq, Array.append_data, Array.push_data, nil_append, singleton_append, and_self]
α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail heq : getRest (head :: tail) delim = none ⊢ Array.modifyHead (Array.append (Array.push #[] head)) #[toArray tail] = #[toArray (head :: tail)] case h₁ α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail heq : getRest (head :: tail) delim = none ⊢ ¬delim <:+: tail
case h₁ α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail heq : getRest (head :: tail) delim = none ⊢ ¬delim <:+: tail
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail heq : getRest (head :: tail) delim = none ⊢ Array.modifyHead (Array.append (Array.push #[] head)) #[toArray tail] = #[toArray (head :: tail)] case h₁ α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail heq : getRest (head :: tail) delim = none ⊢ ¬delim <:+: tail TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_nonmatching
[1113, 1]
[1128, 85]
. intro contr apply h₁ exact List.isInfix_cons contr
case h₁ α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail heq : getRest (head :: tail) delim = none ⊢ ¬delim <:+: tail
no goals
Please generate a tactic in lean4 to solve the state. STATE: case h₁ α : Type u_1 delim : List α inst✝ : DecidableEq α h : delim ≠ [] head : α tail : List α h₁ : ¬delim <:+: head :: tail heq : getRest (head :: tail) delim = none ⊢ ¬delim <:+: tail TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_nonmatching
[1113, 1]
[1128, 85]
simp only [List.eq_append_of_getRest heq, isInfix_append_left, not_true] at h₁
α : Type u_1 delim : List α head✝ : DecidableEq α h : delim ≠ [] head : α tail✝ : List α h₁ : ¬delim <:+: head :: tail✝ tail : List α heq : getRest (head :: tail✝) delim = some tail ⊢ (let_fun x := (_ : sizeOf tail < sizeOf (head :: tail✝)); splitOnListAux delim tail #[] (Array.push #[] #[]) h) = #[toArray (head :: tail✝)]
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 delim : List α head✝ : DecidableEq α h : delim ≠ [] head : α tail✝ : List α h₁ : ¬delim <:+: head :: tail✝ tail : List α heq : getRest (head :: tail✝) delim = some tail ⊢ (let_fun x := (_ : sizeOf tail < sizeOf (head :: tail✝)); splitOnListAux delim tail #[] (Array.push #[] #[]) h) = #[toArray (head :: tail✝)] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnList_nonmatching
[1131, 1]
[1139, 15]
unfold List.splitOnList
α : Type u_1 delim : List α inst✝ : DecidableEq α l : List α h₁ : ¬delim <:+: l ⊢ splitOnList delim l = [l]
α : Type u_1 delim : List α inst✝ : DecidableEq α l : List α h₁ : ¬delim <:+: l ⊢ (match delim with | [] => [l] | head :: tail => Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) l #[] #[] (_ : ¬head :: tail = [])))) = [l]
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 delim : List α inst✝ : DecidableEq α l : List α h₁ : ¬delim <:+: l ⊢ splitOnList delim l = [l] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnList_nonmatching
[1131, 1]
[1139, 15]
cases delim with | nil => simp only | cons => simp only rw [List.splitOnListAux_nonmatching] . simp only [Array.toList_eq, Array.map_data, map, Array.data_toArray] . exact h₁
α : Type u_1 delim : List α inst✝ : DecidableEq α l : List α h₁ : ¬delim <:+: l ⊢ (match delim with | [] => [l] | head :: tail => Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) l #[] #[] (_ : ¬head :: tail = [])))) = [l]
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 delim : List α inst✝ : DecidableEq α l : List α h₁ : ¬delim <:+: l ⊢ (match delim with | [] => [l] | head :: tail => Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) l #[] #[] (_ : ¬head :: tail = [])))) = [l] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnList_nonmatching
[1131, 1]
[1139, 15]
simp only
case nil α : Type u_1 inst✝ : DecidableEq α l : List α h₁ : ¬[] <:+: l ⊢ (match [] with | [] => [l] | head :: tail => Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) l #[] #[] (_ : ¬head :: tail = [])))) = [l]
no goals
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 inst✝ : DecidableEq α l : List α h₁ : ¬[] <:+: l ⊢ (match [] with | [] => [l] | head :: tail => Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) l #[] #[] (_ : ¬head :: tail = [])))) = [l] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnList_nonmatching
[1131, 1]
[1139, 15]
simp only
case cons α : Type u_1 inst✝ : DecidableEq α l : List α head✝ : α tail✝ : List α h₁ : ¬head✝ :: tail✝ <:+: l ⊢ (match head✝ :: tail✝ with | [] => [l] | head :: tail => Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) l #[] #[] (_ : ¬head :: tail = [])))) = [l]
case cons α : Type u_1 inst✝ : DecidableEq α l : List α head✝ : α tail✝ : List α h₁ : ¬head✝ :: tail✝ <:+: l ⊢ Array.toList (Array.map Array.toList (splitOnListAux (head✝ :: tail✝) l #[] #[] (_ : ¬head✝ :: tail✝ = []))) = [l]
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 inst✝ : DecidableEq α l : List α head✝ : α tail✝ : List α h₁ : ¬head✝ :: tail✝ <:+: l ⊢ (match head✝ :: tail✝ with | [] => [l] | head :: tail => Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) l #[] #[] (_ : ¬head :: tail = [])))) = [l] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnList_nonmatching
[1131, 1]
[1139, 15]
rw [List.splitOnListAux_nonmatching]
case cons α : Type u_1 inst✝ : DecidableEq α l : List α head✝ : α tail✝ : List α h₁ : ¬head✝ :: tail✝ <:+: l ⊢ Array.toList (Array.map Array.toList (splitOnListAux (head✝ :: tail✝) l #[] #[] (_ : ¬head✝ :: tail✝ = []))) = [l]
case cons α : Type u_1 inst✝ : DecidableEq α l : List α head✝ : α tail✝ : List α h₁ : ¬head✝ :: tail✝ <:+: l ⊢ Array.toList (Array.map Array.toList #[toArray l]) = [l] case cons.h₁ α : Type u_1 inst✝ : DecidableEq α l : List α head✝ : α tail✝ : List α h₁ : ¬head✝ :: tail✝ <:+: l ⊢ ¬head✝ :: tail✝ <:+: l
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 inst✝ : DecidableEq α l : List α head✝ : α tail✝ : List α h₁ : ¬head✝ :: tail✝ <:+: l ⊢ Array.toList (Array.map Array.toList (splitOnListAux (head✝ :: tail✝) l #[] #[] (_ : ¬head✝ :: tail✝ = []))) = [l] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnList_nonmatching
[1131, 1]
[1139, 15]
. simp only [Array.toList_eq, Array.map_data, map, Array.data_toArray]
case cons α : Type u_1 inst✝ : DecidableEq α l : List α head✝ : α tail✝ : List α h₁ : ¬head✝ :: tail✝ <:+: l ⊢ Array.toList (Array.map Array.toList #[toArray l]) = [l] case cons.h₁ α : Type u_1 inst✝ : DecidableEq α l : List α head✝ : α tail✝ : List α h₁ : ¬head✝ :: tail✝ <:+: l ⊢ ¬head✝ :: tail✝ <:+: l
case cons.h₁ α : Type u_1 inst✝ : DecidableEq α l : List α head✝ : α tail✝ : List α h₁ : ¬head✝ :: tail✝ <:+: l ⊢ ¬head✝ :: tail✝ <:+: l
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 inst✝ : DecidableEq α l : List α head✝ : α tail✝ : List α h₁ : ¬head✝ :: tail✝ <:+: l ⊢ Array.toList (Array.map Array.toList #[toArray l]) = [l] case cons.h₁ α : Type u_1 inst✝ : DecidableEq α l : List α head✝ : α tail✝ : List α h₁ : ¬head✝ :: tail✝ <:+: l ⊢ ¬head✝ :: tail✝ <:+: l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnList_nonmatching
[1131, 1]
[1139, 15]
. exact h₁
case cons.h₁ α : Type u_1 inst✝ : DecidableEq α l : List α head✝ : α tail✝ : List α h₁ : ¬head✝ :: tail✝ <:+: l ⊢ ¬head✝ :: tail✝ <:+: l
no goals
Please generate a tactic in lean4 to solve the state. STATE: case cons.h₁ α : Type u_1 inst✝ : DecidableEq α l : List α head✝ : α tail✝ : List α h₁ : ¬head✝ :: tail✝ <:+: l ⊢ ¬head✝ :: tail✝ <:+: l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.isPrefix_take
[1149, 1]
[1159, 41]
apply Iff.intro
α : Type u_1 delim l : List α ⊢ delim <+: take (length delim) l ↔ delim <+: l
case mp α : Type u_1 delim l : List α ⊢ delim <+: take (length delim) l → delim <+: l case mpr α : Type u_1 delim l : List α ⊢ delim <+: l → delim <+: take (length delim) l
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 delim l : List α ⊢ delim <+: take (length delim) l ↔ delim <+: l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.isPrefix_take
[1149, 1]
[1159, 41]
. intro ⟨t, heq⟩ replace heq := congr_arg (take (length delim)) heq simp only [take_left, take_take, min_self] at heq rw [heq] simp only [take_isPrefix]
case mp α : Type u_1 delim l : List α ⊢ delim <+: take (length delim) l → delim <+: l case mpr α : Type u_1 delim l : List α ⊢ delim <+: l → delim <+: take (length delim) l
case mpr α : Type u_1 delim l : List α ⊢ delim <+: l → delim <+: take (length delim) l
Please generate a tactic in lean4 to solve the state. STATE: case mp α : Type u_1 delim l : List α ⊢ delim <+: take (length delim) l → delim <+: l case mpr α : Type u_1 delim l : List α ⊢ delim <+: l → delim <+: take (length delim) l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.isPrefix_take
[1149, 1]
[1159, 41]
. intro ⟨t, heq⟩ subst l simp only [take_left, isPrefix_self]
case mpr α : Type u_1 delim l : List α ⊢ delim <+: l → delim <+: take (length delim) l
no goals
Please generate a tactic in lean4 to solve the state. STATE: case mpr α : Type u_1 delim l : List α ⊢ delim <+: l → delim <+: take (length delim) l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.dropLast_take'
[1162, 1]
[1171, 113]
cases h: decide (n < length l) with | true => simp only [decide_eq_true_eq] at h simp only [List.dropLast_take h, Nat.pred_eq_sub_one, tsub_le_iff_right, ge_iff_le, min_eq_left (le_of_lt h)] | false => simp only [decide_eq_false_iff_not, not_lt] at h rw [List.take_length_le h] simp only [dropLast_eq_take, Nat.pred_eq_sub_one, tsub_le_iff_right, ge_iff_le, min_le_iff, h, min_eq_right]
n : ℕ α✝ : Type u_1 l : List α✝ ⊢ dropLast (take n l) = take (min n (length l) - 1) l
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ α✝ : Type u_1 l : List α✝ ⊢ dropLast (take n l) = take (min n (length l) - 1) l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.dropLast_take'
[1162, 1]
[1171, 113]
simp only [decide_eq_true_eq] at h
case true n : ℕ α✝ : Type u_1 l : List α✝ h : decide (n < length l) = true ⊢ dropLast (take n l) = take (min n (length l) - 1) l
case true n : ℕ α✝ : Type u_1 l : List α✝ h : n < length l ⊢ dropLast (take n l) = take (min n (length l) - 1) l
Please generate a tactic in lean4 to solve the state. STATE: case true n : ℕ α✝ : Type u_1 l : List α✝ h : decide (n < length l) = true ⊢ dropLast (take n l) = take (min n (length l) - 1) l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.dropLast_take'
[1162, 1]
[1171, 113]
simp only [List.dropLast_take h, Nat.pred_eq_sub_one, tsub_le_iff_right, ge_iff_le, min_eq_left (le_of_lt h)]
case true n : ℕ α✝ : Type u_1 l : List α✝ h : n < length l ⊢ dropLast (take n l) = take (min n (length l) - 1) l
no goals
Please generate a tactic in lean4 to solve the state. STATE: case true n : ℕ α✝ : Type u_1 l : List α✝ h : n < length l ⊢ dropLast (take n l) = take (min n (length l) - 1) l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.dropLast_take'
[1162, 1]
[1171, 113]
simp only [decide_eq_false_iff_not, not_lt] at h
case false n : ℕ α✝ : Type u_1 l : List α✝ h : decide (n < length l) = false ⊢ dropLast (take n l) = take (min n (length l) - 1) l
case false n : ℕ α✝ : Type u_1 l : List α✝ h : length l ≤ n ⊢ dropLast (take n l) = take (min n (length l) - 1) l
Please generate a tactic in lean4 to solve the state. STATE: case false n : ℕ α✝ : Type u_1 l : List α✝ h : decide (n < length l) = false ⊢ dropLast (take n l) = take (min n (length l) - 1) l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.dropLast_take'
[1162, 1]
[1171, 113]
rw [List.take_length_le h]
case false n : ℕ α✝ : Type u_1 l : List α✝ h : length l ≤ n ⊢ dropLast (take n l) = take (min n (length l) - 1) l
case false n : ℕ α✝ : Type u_1 l : List α✝ h : length l ≤ n ⊢ dropLast l = take (min n (length l) - 1) l
Please generate a tactic in lean4 to solve the state. STATE: case false n : ℕ α✝ : Type u_1 l : List α✝ h : length l ≤ n ⊢ dropLast (take n l) = take (min n (length l) - 1) l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.dropLast_take'
[1162, 1]
[1171, 113]
simp only [dropLast_eq_take, Nat.pred_eq_sub_one, tsub_le_iff_right, ge_iff_le, min_le_iff, h, min_eq_right]
case false n : ℕ α✝ : Type u_1 l : List α✝ h : length l ≤ n ⊢ dropLast l = take (min n (length l) - 1) l
no goals
Please generate a tactic in lean4 to solve the state. STATE: case false n : ℕ α✝ : Type u_1 l : List α✝ h : length l ≤ n ⊢ dropLast l = take (min n (length l) - 1) l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.isPrefix_of_append_isPrefix_append
[1173, 1]
[1177, 17]
have ⟨t, heq⟩ := h
α✝ : Type u_1 l₁ l₂ l₃ : List α✝ h : l₁ ++ l₂ <+: l₁ ++ l₃ ⊢ l₂ <+: l₃
α✝ : Type u_1 l₁ l₂ l₃ : List α✝ h : l₁ ++ l₂ <+: l₁ ++ l₃ t : List α✝ heq : l₁ ++ l₂ ++ t = l₁ ++ l₃ ⊢ l₂ <+: l₃
Please generate a tactic in lean4 to solve the state. STATE: α✝ : Type u_1 l₁ l₂ l₃ : List α✝ h : l₁ ++ l₂ <+: l₁ ++ l₃ ⊢ l₂ <+: l₃ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.isPrefix_of_append_isPrefix_append
[1173, 1]
[1177, 17]
simp only [append_assoc, append_cancel_left_eq] at heq
α✝ : Type u_1 l₁ l₂ l₃ : List α✝ h : l₁ ++ l₂ <+: l₁ ++ l₃ t : List α✝ heq : l₁ ++ l₂ ++ t = l₁ ++ l₃ ⊢ l₂ <+: l₃
α✝ : Type u_1 l₁ l₂ l₃ : List α✝ h : l₁ ++ l₂ <+: l₁ ++ l₃ t : List α✝ heq : l₂ ++ t = l₃ ⊢ l₂ <+: l₃
Please generate a tactic in lean4 to solve the state. STATE: α✝ : Type u_1 l₁ l₂ l₃ : List α✝ h : l₁ ++ l₂ <+: l₁ ++ l₃ t : List α✝ heq : l₁ ++ l₂ ++ t = l₁ ++ l₃ ⊢ l₂ <+: l₃ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.isPrefix_of_append_isPrefix_append
[1173, 1]
[1177, 17]
exact ⟨t, heq⟩
α✝ : Type u_1 l₁ l₂ l₃ : List α✝ h : l₁ ++ l₂ <+: l₁ ++ l₃ t : List α✝ heq : l₂ ++ t = l₃ ⊢ l₂ <+: l₃
no goals
Please generate a tactic in lean4 to solve the state. STATE: α✝ : Type u_1 l₁ l₂ l₃ : List α✝ h : l₁ ++ l₂ <+: l₁ ++ l₃ t : List α✝ heq : l₂ ++ t = l₃ ⊢ l₂ <+: l₃ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_progress
[1180, 1]
[1229, 51]
induction front with | nil => rw [nil_append, splitOnListAux_delim] simp only [Array.ext_iff, Array.append_data, Array.data_toArray, nil_append, singleton_append] | cons head tail ih => conv => left; unfold splitOnListAux split case h_1 heq => simp only [cons_append, append_assoc] at heq case h_2 head tail heq => split case h_1 heq₂ => injection heq; subst_vars conv => left; rw [List.splitOnListAux_acc] simp only [List.append_eq, append_assoc] simp only [append_assoc] at ih rw [ih] . simp only [Array.ext_iff, Array.modifyHead_data, modifyHead, Array.append_data, Array.data_toArray, singleton_append, Array.append_eq_append, cons.injEq, Array.push_data, nil_append, and_self] . intro h apply h₁ simp only [cons_append, h, isInfix_cons] case h_2 hd tl rest₂ heq₂ => exfalso; apply h₁ apply List.isInfix_of_isPrefix have h₃ := congr_arg (List.take (List.length delim)) (List.eq_append_of_getRest heq₂) rw [List.take_append_of_le_length] at h₃ simp at h₃ conv => left; rw [← h₃] simp only [length_take, length_cons, length_append, min_le_iff, ge_iff_le, cons_append] apply List.isPrefix_take.1 simp only [length_take, length_cons, length_append, min_le_iff, ge_iff_le] rw [min_eq_left] . have h₄: take (length delim) (hd :: (tl ++ delim)) = take (length delim) (hd :: (tl ++ delim.dropLast)) := by rw [← List.cons_append, ← List.cons_append, List.take_append_eq_append_take, List.take_append_eq_append_take] rw [List.dropLast_eq_take, List.take_take, min_eq_left] simp only [length_cons, tsub_le_iff_right, ge_iff_le] calc length delim ≤ Nat.pred (length delim) + 1 := by simp only [Nat.pred_eq_sub_one, tsub_le_iff_right, ge_iff_le, le_refl, Nat.le_add_of_sub_le] _ ≤ Nat.pred (length delim) + Nat.succ (length tl) := by simp only [Nat.succ_eq_add_one, add_le_add_iff_left, le_add_iff_nonneg_left, zero_le, ge_iff_le, nonpos_iff_eq_zero] rw [h₄] simp only [isPrefix_self] . simp only [Nat.succ_eq_add_one, Nat.le_add_one_iff, le_add_iff_nonneg_left, zero_le, ge_iff_le, nonpos_iff_eq_zero, true_or] . simp only [cons_append, length_cons, length_append, le_add_iff_nonneg_left, zero_le, ge_iff_le, nonpos_iff_eq_zero, Nat.le_succ_of_le]
α : Type u_1 inst✝ : DecidableEq α delim front rest : List α h₁ : ¬delim <:+: front ++ dropLast delim h₂ : delim ≠ [] ⊢ splitOnListAux delim (front ++ delim ++ rest) #[] #[] h₂ = #[toArray front] ++ splitOnListAux delim rest #[] #[] h₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim front rest : List α h₁ : ¬delim <:+: front ++ dropLast delim h₂ : delim ≠ [] ⊢ splitOnListAux delim (front ++ delim ++ rest) #[] #[] h₂ = #[toArray front] ++ splitOnListAux delim rest #[] #[] h₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_progress
[1180, 1]
[1229, 51]
rw [nil_append, splitOnListAux_delim]
case nil α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] h₁ : ¬delim <:+: [] ++ dropLast delim ⊢ splitOnListAux delim ([] ++ delim ++ rest) #[] #[] h₂ = #[#[]] ++ splitOnListAux delim rest #[] #[] h₂
case nil α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] h₁ : ¬delim <:+: [] ++ dropLast delim ⊢ #[] ++ #[#[]] ++ splitOnListAux delim rest #[] #[] h₂ = #[#[]] ++ splitOnListAux delim rest #[] #[] h₂
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] h₁ : ¬delim <:+: [] ++ dropLast delim ⊢ splitOnListAux delim ([] ++ delim ++ rest) #[] #[] h₂ = #[#[]] ++ splitOnListAux delim rest #[] #[] h₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_progress
[1180, 1]
[1229, 51]
simp only [Array.ext_iff, Array.append_data, Array.data_toArray, nil_append, singleton_append]
case nil α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] h₁ : ¬delim <:+: [] ++ dropLast delim ⊢ #[] ++ #[#[]] ++ splitOnListAux delim rest #[] #[] h₂ = #[#[]] ++ splitOnListAux delim rest #[] #[] h₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] h₁ : ¬delim <:+: [] ++ dropLast delim ⊢ #[] ++ #[#[]] ++ splitOnListAux delim rest #[] #[] h₂ = #[#[]] ++ splitOnListAux delim rest #[] #[] h₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_progress
[1180, 1]
[1229, 51]
conv => left; unfold splitOnListAux
case cons α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head : α tail : List α ih : ¬delim <:+: tail ++ dropLast delim → splitOnListAux delim (tail ++ delim ++ rest) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head :: tail ++ dropLast delim ⊢ splitOnListAux delim (head :: tail ++ delim ++ rest) #[] #[] h₂ = #[toArray (head :: tail)] ++ splitOnListAux delim rest #[] #[] h₂
case cons α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head : α tail : List α ih : ¬delim <:+: tail ++ dropLast delim → splitOnListAux delim (tail ++ delim ++ rest) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head :: tail ++ dropLast delim ⊢ (match _h₀ : head :: tail ++ delim ++ rest with | [] => Array.push #[] #[] | head_1 :: tail_1 => match h : getRest (head :: tail ++ delim ++ rest) delim with | none => splitOnListAux delim tail_1 (Array.push #[] head_1) #[] h₂ | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf (head :: tail ++ delim ++ rest)); splitOnListAux delim rest_1 #[] (Array.push #[] #[]) h₂) = #[toArray (head :: tail)] ++ splitOnListAux delim rest #[] #[] h₂
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head : α tail : List α ih : ¬delim <:+: tail ++ dropLast delim → splitOnListAux delim (tail ++ delim ++ rest) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head :: tail ++ dropLast delim ⊢ splitOnListAux delim (head :: tail ++ delim ++ rest) #[] #[] h₂ = #[toArray (head :: tail)] ++ splitOnListAux delim rest #[] #[] h₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_progress
[1180, 1]
[1229, 51]
split
case cons α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head : α tail : List α ih : ¬delim <:+: tail ++ dropLast delim → splitOnListAux delim (tail ++ delim ++ rest) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head :: tail ++ dropLast delim ⊢ (match _h₀ : head :: tail ++ delim ++ rest with | [] => Array.push #[] #[] | head_1 :: tail_1 => match h : getRest (head :: tail ++ delim ++ rest) delim with | none => splitOnListAux delim tail_1 (Array.push #[] head_1) #[] h₂ | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf (head :: tail ++ delim ++ rest)); splitOnListAux delim rest_1 #[] (Array.push #[] #[]) h₂) = #[toArray (head :: tail)] ++ splitOnListAux delim rest #[] #[] h₂
case cons.h_1 α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head : α tail : List α ih : ¬delim <:+: tail ++ dropLast delim → splitOnListAux delim (tail ++ delim ++ rest) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head :: tail ++ dropLast delim heq✝ : head :: tail ++ delim ++ rest = [] ⊢ Array.push #[] #[] = #[toArray (head :: tail)] ++ splitOnListAux delim rest #[] #[] h₂ case cons.h_2 α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head : α tail : List α ih : ¬delim <:+: tail ++ dropLast delim → splitOnListAux delim (tail ++ delim ++ rest) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head :: tail ++ dropLast delim head✝ : α tail✝ : List α heq✝ : head :: tail ++ delim ++ rest = head✝ :: tail✝ ⊢ (match h : getRest (head :: tail ++ delim ++ rest) delim with | none => splitOnListAux delim tail✝ (Array.push #[] head✝) #[] h₂ | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf (head :: tail ++ delim ++ rest)); splitOnListAux delim rest_1 #[] (Array.push #[] #[]) h₂) = #[toArray (head :: tail)] ++ splitOnListAux delim rest #[] #[] h₂
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head : α tail : List α ih : ¬delim <:+: tail ++ dropLast delim → splitOnListAux delim (tail ++ delim ++ rest) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head :: tail ++ dropLast delim ⊢ (match _h₀ : head :: tail ++ delim ++ rest with | [] => Array.push #[] #[] | head_1 :: tail_1 => match h : getRest (head :: tail ++ delim ++ rest) delim with | none => splitOnListAux delim tail_1 (Array.push #[] head_1) #[] h₂ | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf (head :: tail ++ delim ++ rest)); splitOnListAux delim rest_1 #[] (Array.push #[] #[]) h₂) = #[toArray (head :: tail)] ++ splitOnListAux delim rest #[] #[] h₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_progress
[1180, 1]
[1229, 51]
case h_1 heq => simp only [cons_append, append_assoc] at heq
α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head : α tail : List α ih : ¬delim <:+: tail ++ dropLast delim → splitOnListAux delim (tail ++ delim ++ rest) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head :: tail ++ dropLast delim heq : head :: tail ++ delim ++ rest = [] ⊢ Array.push #[] #[] = #[toArray (head :: tail)] ++ splitOnListAux delim rest #[] #[] h₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head : α tail : List α ih : ¬delim <:+: tail ++ dropLast delim → splitOnListAux delim (tail ++ delim ++ rest) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head :: tail ++ dropLast delim heq : head :: tail ++ delim ++ rest = [] ⊢ Array.push #[] #[] = #[toArray (head :: tail)] ++ splitOnListAux delim rest #[] #[] h₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_progress
[1180, 1]
[1229, 51]
case h_2 head tail heq => split case h_1 heq₂ => injection heq; subst_vars conv => left; rw [List.splitOnListAux_acc] simp only [List.append_eq, append_assoc] simp only [append_assoc] at ih rw [ih] . simp only [Array.ext_iff, Array.modifyHead_data, modifyHead, Array.append_data, Array.data_toArray, singleton_append, Array.append_eq_append, cons.injEq, Array.push_data, nil_append, and_self] . intro h apply h₁ simp only [cons_append, h, isInfix_cons] case h_2 hd tl rest₂ heq₂ => exfalso; apply h₁ apply List.isInfix_of_isPrefix have h₃ := congr_arg (List.take (List.length delim)) (List.eq_append_of_getRest heq₂) rw [List.take_append_of_le_length] at h₃ simp at h₃ conv => left; rw [← h₃] simp only [length_take, length_cons, length_append, min_le_iff, ge_iff_le, cons_append] apply List.isPrefix_take.1 simp only [length_take, length_cons, length_append, min_le_iff, ge_iff_le] rw [min_eq_left] . have h₄: take (length delim) (hd :: (tl ++ delim)) = take (length delim) (hd :: (tl ++ delim.dropLast)) := by rw [← List.cons_append, ← List.cons_append, List.take_append_eq_append_take, List.take_append_eq_append_take] rw [List.dropLast_eq_take, List.take_take, min_eq_left] simp only [length_cons, tsub_le_iff_right, ge_iff_le] calc length delim ≤ Nat.pred (length delim) + 1 := by simp only [Nat.pred_eq_sub_one, tsub_le_iff_right, ge_iff_le, le_refl, Nat.le_add_of_sub_le] _ ≤ Nat.pred (length delim) + Nat.succ (length tl) := by simp only [Nat.succ_eq_add_one, add_le_add_iff_left, le_add_iff_nonneg_left, zero_le, ge_iff_le, nonpos_iff_eq_zero] rw [h₄] simp only [isPrefix_self] . simp only [Nat.succ_eq_add_one, Nat.le_add_one_iff, le_add_iff_nonneg_left, zero_le, ge_iff_le, nonpos_iff_eq_zero, true_or] . simp only [cons_append, length_cons, length_append, le_add_iff_nonneg_left, zero_le, ge_iff_le, nonpos_iff_eq_zero, Nat.le_succ_of_le]
α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head✝ : α tail✝ : List α ih : ¬delim <:+: tail✝ ++ dropLast delim → splitOnListAux delim (tail✝ ++ delim ++ rest) #[] #[] h₂ = #[toArray tail✝] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head✝ :: tail✝ ++ dropLast delim head : α tail : List α heq : head✝ :: tail✝ ++ delim ++ rest = head :: tail ⊢ (match h : getRest (head✝ :: tail✝ ++ delim ++ rest) delim with | none => splitOnListAux delim tail (Array.push #[] head) #[] h₂ | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf (head✝ :: tail✝ ++ delim ++ rest)); splitOnListAux delim rest_1 #[] (Array.push #[] #[]) h₂) = #[toArray (head✝ :: tail✝)] ++ splitOnListAux delim rest #[] #[] h₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head✝ : α tail✝ : List α ih : ¬delim <:+: tail✝ ++ dropLast delim → splitOnListAux delim (tail✝ ++ delim ++ rest) #[] #[] h₂ = #[toArray tail✝] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head✝ :: tail✝ ++ dropLast delim head : α tail : List α heq : head✝ :: tail✝ ++ delim ++ rest = head :: tail ⊢ (match h : getRest (head✝ :: tail✝ ++ delim ++ rest) delim with | none => splitOnListAux delim tail (Array.push #[] head) #[] h₂ | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf (head✝ :: tail✝ ++ delim ++ rest)); splitOnListAux delim rest_1 #[] (Array.push #[] #[]) h₂) = #[toArray (head✝ :: tail✝)] ++ splitOnListAux delim rest #[] #[] h₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_progress
[1180, 1]
[1229, 51]
simp only [cons_append, append_assoc] at heq
α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head : α tail : List α ih : ¬delim <:+: tail ++ dropLast delim → splitOnListAux delim (tail ++ delim ++ rest) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head :: tail ++ dropLast delim heq : head :: tail ++ delim ++ rest = [] ⊢ Array.push #[] #[] = #[toArray (head :: tail)] ++ splitOnListAux delim rest #[] #[] h₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head : α tail : List α ih : ¬delim <:+: tail ++ dropLast delim → splitOnListAux delim (tail ++ delim ++ rest) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head :: tail ++ dropLast delim heq : head :: tail ++ delim ++ rest = [] ⊢ Array.push #[] #[] = #[toArray (head :: tail)] ++ splitOnListAux delim rest #[] #[] h₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_progress
[1180, 1]
[1229, 51]
split
α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head✝ : α tail✝ : List α ih : ¬delim <:+: tail✝ ++ dropLast delim → splitOnListAux delim (tail✝ ++ delim ++ rest) #[] #[] h₂ = #[toArray tail✝] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head✝ :: tail✝ ++ dropLast delim head : α tail : List α heq : head✝ :: tail✝ ++ delim ++ rest = head :: tail ⊢ (match h : getRest (head✝ :: tail✝ ++ delim ++ rest) delim with | none => splitOnListAux delim tail (Array.push #[] head) #[] h₂ | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf (head✝ :: tail✝ ++ delim ++ rest)); splitOnListAux delim rest_1 #[] (Array.push #[] #[]) h₂) = #[toArray (head✝ :: tail✝)] ++ splitOnListAux delim rest #[] #[] h₂
case h_1 α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head✝ : α tail✝ : List α ih : ¬delim <:+: tail✝ ++ dropLast delim → splitOnListAux delim (tail✝ ++ delim ++ rest) #[] #[] h₂ = #[toArray tail✝] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head✝ :: tail✝ ++ dropLast delim head : α tail : List α heq : head✝ :: tail✝ ++ delim ++ rest = head :: tail heq✝ : getRest (head✝ :: tail✝ ++ delim ++ rest) delim = none ⊢ splitOnListAux delim tail (Array.push #[] head) #[] h₂ = #[toArray (head✝ :: tail✝)] ++ splitOnListAux delim rest #[] #[] h₂ case h_2 α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head✝ : α tail✝ : List α ih : ¬delim <:+: tail✝ ++ dropLast delim → splitOnListAux delim (tail✝ ++ delim ++ rest) #[] #[] h₂ = #[toArray tail✝] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head✝ :: tail✝ ++ dropLast delim head : α tail : List α heq : head✝ :: tail✝ ++ delim ++ rest = head :: tail rest✝ : List α heq✝ : getRest (head✝ :: tail✝ ++ delim ++ rest) delim = some rest✝ ⊢ (let_fun x := (_ : sizeOf rest✝ < sizeOf (head✝ :: tail✝ ++ delim ++ rest)); splitOnListAux delim rest✝ #[] (Array.push #[] #[]) h₂) = #[toArray (head✝ :: tail✝)] ++ splitOnListAux delim rest #[] #[] h₂
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head✝ : α tail✝ : List α ih : ¬delim <:+: tail✝ ++ dropLast delim → splitOnListAux delim (tail✝ ++ delim ++ rest) #[] #[] h₂ = #[toArray tail✝] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head✝ :: tail✝ ++ dropLast delim head : α tail : List α heq : head✝ :: tail✝ ++ delim ++ rest = head :: tail ⊢ (match h : getRest (head✝ :: tail✝ ++ delim ++ rest) delim with | none => splitOnListAux delim tail (Array.push #[] head) #[] h₂ | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf (head✝ :: tail✝ ++ delim ++ rest)); splitOnListAux delim rest_1 #[] (Array.push #[] #[]) h₂) = #[toArray (head✝ :: tail✝)] ++ splitOnListAux delim rest #[] #[] h₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_progress
[1180, 1]
[1229, 51]
case h_1 heq₂ => injection heq; subst_vars conv => left; rw [List.splitOnListAux_acc] simp only [List.append_eq, append_assoc] simp only [append_assoc] at ih rw [ih] . simp only [Array.ext_iff, Array.modifyHead_data, modifyHead, Array.append_data, Array.data_toArray, singleton_append, Array.append_eq_append, cons.injEq, Array.push_data, nil_append, and_self] . intro h apply h₁ simp only [cons_append, h, isInfix_cons]
α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head✝ : α tail✝ : List α ih : ¬delim <:+: tail✝ ++ dropLast delim → splitOnListAux delim (tail✝ ++ delim ++ rest) #[] #[] h₂ = #[toArray tail✝] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head✝ :: tail✝ ++ dropLast delim head : α tail : List α heq : head✝ :: tail✝ ++ delim ++ rest = head :: tail heq₂ : getRest (head✝ :: tail✝ ++ delim ++ rest) delim = none ⊢ splitOnListAux delim tail (Array.push #[] head) #[] h₂ = #[toArray (head✝ :: tail✝)] ++ splitOnListAux delim rest #[] #[] h₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head✝ : α tail✝ : List α ih : ¬delim <:+: tail✝ ++ dropLast delim → splitOnListAux delim (tail✝ ++ delim ++ rest) #[] #[] h₂ = #[toArray tail✝] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head✝ :: tail✝ ++ dropLast delim head : α tail : List α heq : head✝ :: tail✝ ++ delim ++ rest = head :: tail heq₂ : getRest (head✝ :: tail✝ ++ delim ++ rest) delim = none ⊢ splitOnListAux delim tail (Array.push #[] head) #[] h₂ = #[toArray (head✝ :: tail✝)] ++ splitOnListAux delim rest #[] #[] h₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_progress
[1180, 1]
[1229, 51]
case h_2 hd tl rest₂ heq₂ => exfalso; apply h₁ apply List.isInfix_of_isPrefix have h₃ := congr_arg (List.take (List.length delim)) (List.eq_append_of_getRest heq₂) rw [List.take_append_of_le_length] at h₃ simp at h₃ conv => left; rw [← h₃] simp only [length_take, length_cons, length_append, min_le_iff, ge_iff_le, cons_append] apply List.isPrefix_take.1 simp only [length_take, length_cons, length_append, min_le_iff, ge_iff_le] rw [min_eq_left] . have h₄: take (length delim) (hd :: (tl ++ delim)) = take (length delim) (hd :: (tl ++ delim.dropLast)) := by rw [← List.cons_append, ← List.cons_append, List.take_append_eq_append_take, List.take_append_eq_append_take] rw [List.dropLast_eq_take, List.take_take, min_eq_left] simp only [length_cons, tsub_le_iff_right, ge_iff_le] calc length delim ≤ Nat.pred (length delim) + 1 := by simp only [Nat.pred_eq_sub_one, tsub_le_iff_right, ge_iff_le, le_refl, Nat.le_add_of_sub_le] _ ≤ Nat.pred (length delim) + Nat.succ (length tl) := by simp only [Nat.succ_eq_add_one, add_le_add_iff_left, le_add_iff_nonneg_left, zero_le, ge_iff_le, nonpos_iff_eq_zero] rw [h₄] simp only [isPrefix_self] . simp only [Nat.succ_eq_add_one, Nat.le_add_one_iff, le_add_iff_nonneg_left, zero_le, ge_iff_le, nonpos_iff_eq_zero, true_or] . simp only [cons_append, length_cons, length_append, le_add_iff_nonneg_left, zero_le, ge_iff_le, nonpos_iff_eq_zero, Nat.le_succ_of_le]
α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] hd : α tl : List α ih : ¬delim <:+: tl ++ dropLast delim → splitOnListAux delim (tl ++ delim ++ rest) #[] #[] h₂ = #[toArray tl] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: hd :: tl ++ dropLast delim head : α tail : List α heq : hd :: tl ++ delim ++ rest = head :: tail rest₂ : List α heq₂ : getRest (hd :: tl ++ delim ++ rest) delim = some rest₂ ⊢ (let_fun x := (_ : sizeOf rest₂ < sizeOf (hd :: tl ++ delim ++ rest)); splitOnListAux delim rest₂ #[] (Array.push #[] #[]) h₂) = #[toArray (hd :: tl)] ++ splitOnListAux delim rest #[] #[] h₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] hd : α tl : List α ih : ¬delim <:+: tl ++ dropLast delim → splitOnListAux delim (tl ++ delim ++ rest) #[] #[] h₂ = #[toArray tl] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: hd :: tl ++ dropLast delim head : α tail : List α heq : hd :: tl ++ delim ++ rest = head :: tail rest₂ : List α heq₂ : getRest (hd :: tl ++ delim ++ rest) delim = some rest₂ ⊢ (let_fun x := (_ : sizeOf rest₂ < sizeOf (hd :: tl ++ delim ++ rest)); splitOnListAux delim rest₂ #[] (Array.push #[] #[]) h₂) = #[toArray (hd :: tl)] ++ splitOnListAux delim rest #[] #[] h₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_progress
[1180, 1]
[1229, 51]
injection heq
α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head✝ : α tail✝ : List α ih : ¬delim <:+: tail✝ ++ dropLast delim → splitOnListAux delim (tail✝ ++ delim ++ rest) #[] #[] h₂ = #[toArray tail✝] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head✝ :: tail✝ ++ dropLast delim head : α tail : List α heq : head✝ :: tail✝ ++ delim ++ rest = head :: tail heq₂ : getRest (head✝ :: tail✝ ++ delim ++ rest) delim = none ⊢ splitOnListAux delim tail (Array.push #[] head) #[] h₂ = #[toArray (head✝ :: tail✝)] ++ splitOnListAux delim rest #[] #[] h₂
α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head✝ : α tail✝ : List α ih : ¬delim <:+: tail✝ ++ dropLast delim → splitOnListAux delim (tail✝ ++ delim ++ rest) #[] #[] h₂ = #[toArray tail✝] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head✝ :: tail✝ ++ dropLast delim head : α tail : List α heq₂ : getRest (head✝ :: tail✝ ++ delim ++ rest) delim = none head_eq✝ : head✝ = head tail_eq✝ : List.append (List.append tail✝ delim) rest = tail ⊢ splitOnListAux delim tail (Array.push #[] head) #[] h₂ = #[toArray (head✝ :: tail✝)] ++ splitOnListAux delim rest #[] #[] h₂
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head✝ : α tail✝ : List α ih : ¬delim <:+: tail✝ ++ dropLast delim → splitOnListAux delim (tail✝ ++ delim ++ rest) #[] #[] h₂ = #[toArray tail✝] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head✝ :: tail✝ ++ dropLast delim head : α tail : List α heq : head✝ :: tail✝ ++ delim ++ rest = head :: tail heq₂ : getRest (head✝ :: tail✝ ++ delim ++ rest) delim = none ⊢ splitOnListAux delim tail (Array.push #[] head) #[] h₂ = #[toArray (head✝ :: tail✝)] ++ splitOnListAux delim rest #[] #[] h₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_progress
[1180, 1]
[1229, 51]
subst_vars
α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head✝ : α tail✝ : List α ih : ¬delim <:+: tail✝ ++ dropLast delim → splitOnListAux delim (tail✝ ++ delim ++ rest) #[] #[] h₂ = #[toArray tail✝] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head✝ :: tail✝ ++ dropLast delim head : α tail : List α heq₂ : getRest (head✝ :: tail✝ ++ delim ++ rest) delim = none head_eq✝ : head✝ = head tail_eq✝ : List.append (List.append tail✝ delim) rest = tail ⊢ splitOnListAux delim tail (Array.push #[] head) #[] h₂ = #[toArray (head✝ :: tail✝)] ++ splitOnListAux delim rest #[] #[] h₂
α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] tail : List α ih : ¬delim <:+: tail ++ dropLast delim → splitOnListAux delim (tail ++ delim ++ rest) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂ head : α h₁ : ¬delim <:+: head :: tail ++ dropLast delim heq₂ : getRest (head :: tail ++ delim ++ rest) delim = none ⊢ splitOnListAux delim (List.append (List.append tail delim) rest) (Array.push #[] head) #[] h₂ = #[toArray (head :: tail)] ++ splitOnListAux delim rest #[] #[] h₂
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim rest : List α h₂ : delim ≠ [] head✝ : α tail✝ : List α ih : ¬delim <:+: tail✝ ++ dropLast delim → splitOnListAux delim (tail✝ ++ delim ++ rest) #[] #[] h₂ = #[toArray tail✝] ++ splitOnListAux delim rest #[] #[] h₂ h₁ : ¬delim <:+: head✝ :: tail✝ ++ dropLast delim head : α tail : List α heq₂ : getRest (head✝ :: tail✝ ++ delim ++ rest) delim = none head_eq✝ : head✝ = head tail_eq✝ : List.append (List.append tail✝ delim) rest = tail ⊢ splitOnListAux delim tail (Array.push #[] head) #[] h₂ = #[toArray (head✝ :: tail✝)] ++ splitOnListAux delim rest #[] #[] h₂ TACTIC: