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
String.toIntΔ_inv_IntreprΔ
[841, 1]
[862, 22]
split
case ofNat n : ℕ ⊢ (match Nat.toDigits 10 n with | [] => 0 | h :: tail => if h = Char.ofNat 45 then -↑(toNatΔ tail) else ↑(toNatΔ (h :: tail))) = ↑n
case ofNat.h_1 n : ℕ s✝ : List Char heq✝ : Nat.toDigits 10 n = [] ⊢ 0 = ↑n case ofNat.h_2 n : ℕ s✝ : List Char head✝ : Char tail✝ : List Char heq✝ : Nat.toDigits 10 n = head✝ :: tail✝ ⊢ (if head✝ = Char.ofNat 45 then -↑(toNatΔ tail✝) else ↑(toNatΔ (head✝ :: tail✝))) = ↑n
Please generate a tactic in lean4 to solve the state. STATE: case ofNat n : ℕ ⊢ (match Nat.toDigits 10 n with | [] => 0 | h :: tail => if h = Char.ofNat 45 then -↑(toNatΔ tail) else ↑(toNatΔ (h :: tail))) = ↑n TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toIntΔ_inv_IntreprΔ
[841, 1]
[862, 22]
case h_1 s heq => simp only [Nat.toDigits_ne_nil ] at heq
n : ℕ s : List Char heq : Nat.toDigits 10 n = [] ⊢ 0 = ↑n
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ s : List Char heq : Nat.toDigits 10 n = [] ⊢ 0 = ↑n TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toIntΔ_inv_IntreprΔ
[841, 1]
[862, 22]
case h_2 head tail heq => split case inl h => have h₂: (List.all (head::tail) Char.isDigit == true) = true := by rw [← heq] apply Nat.toDigits_digits <;> decide simp at h₂ have ⟨ h₃, _⟩ :=h₂ simp only [h] at h₃ . simp only [← heq, toNatΔ_inv_NattoDigits]
n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail ⊢ (if head = Char.ofNat 45 then -↑(toNatΔ tail) else ↑(toNatΔ (head :: tail))) = ↑n
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail ⊢ (if head = Char.ofNat 45 then -↑(toNatΔ tail) else ↑(toNatΔ (head :: tail))) = ↑n TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toIntΔ_inv_IntreprΔ
[841, 1]
[862, 22]
simp only [Nat.toDigits_ne_nil ] at heq
n : ℕ s : List Char heq : Nat.toDigits 10 n = [] ⊢ 0 = ↑n
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ s : List Char heq : Nat.toDigits 10 n = [] ⊢ 0 = ↑n TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toIntΔ_inv_IntreprΔ
[841, 1]
[862, 22]
split
n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail ⊢ (if head = Char.ofNat 45 then -↑(toNatΔ tail) else ↑(toNatΔ (head :: tail))) = ↑n
case inl n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h✝ : head = Char.ofNat 45 ⊢ -↑(toNatΔ tail) = ↑n case inr n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h✝ : ¬head = Char.ofNat 45 ⊢ ↑(toNatΔ (head :: tail)) = ↑n
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail ⊢ (if head = Char.ofNat 45 then -↑(toNatΔ tail) else ↑(toNatΔ (head :: tail))) = ↑n TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toIntΔ_inv_IntreprΔ
[841, 1]
[862, 22]
case inl h => have h₂: (List.all (head::tail) Char.isDigit == true) = true := by rw [← heq] apply Nat.toDigits_digits <;> decide simp at h₂ have ⟨ h₃, _⟩ :=h₂ simp only [h] at h₃
n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h : head = Char.ofNat 45 ⊢ -↑(toNatΔ tail) = ↑n
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h : head = Char.ofNat 45 ⊢ -↑(toNatΔ tail) = ↑n TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toIntΔ_inv_IntreprΔ
[841, 1]
[862, 22]
. simp only [← heq, toNatΔ_inv_NattoDigits]
case inr n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h✝ : ¬head = Char.ofNat 45 ⊢ ↑(toNatΔ (head :: tail)) = ↑n
no goals
Please generate a tactic in lean4 to solve the state. STATE: case inr n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h✝ : ¬head = Char.ofNat 45 ⊢ ↑(toNatΔ (head :: tail)) = ↑n TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toIntΔ_inv_IntreprΔ
[841, 1]
[862, 22]
have h₂: (List.all (head::tail) Char.isDigit == true) = true := by rw [← heq] apply Nat.toDigits_digits <;> decide
n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h : head = Char.ofNat 45 ⊢ -↑(toNatΔ tail) = ↑n
n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h : head = Char.ofNat 45 h₂ : (List.all (head :: tail) Char.isDigit == true) = true ⊢ -↑(toNatΔ tail) = ↑n
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h : head = Char.ofNat 45 ⊢ -↑(toNatΔ tail) = ↑n TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toIntΔ_inv_IntreprΔ
[841, 1]
[862, 22]
simp at h₂
n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h : head = Char.ofNat 45 h₂ : (List.all (head :: tail) Char.isDigit == true) = true ⊢ -↑(toNatΔ tail) = ↑n
n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h : head = Char.ofNat 45 h₂ : Char.isDigit head = true ∧ ∀ (x : Char), x ∈ tail → Char.isDigit x = true ⊢ -↑(toNatΔ tail) = ↑n
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h : head = Char.ofNat 45 h₂ : (List.all (head :: tail) Char.isDigit == true) = true ⊢ -↑(toNatΔ tail) = ↑n TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toIntΔ_inv_IntreprΔ
[841, 1]
[862, 22]
have ⟨ h₃, _⟩ :=h₂
n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h : head = Char.ofNat 45 h₂ : Char.isDigit head = true ∧ ∀ (x : Char), x ∈ tail → Char.isDigit x = true ⊢ -↑(toNatΔ tail) = ↑n
n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h : head = Char.ofNat 45 h₂ : Char.isDigit head = true ∧ ∀ (x : Char), x ∈ tail → Char.isDigit x = true h₃ : Char.isDigit head = true right✝ : ∀ (x : Char), x ∈ tail → Char.isDigit x = true ⊢ -↑(toNatΔ tail) = ↑n
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h : head = Char.ofNat 45 h₂ : Char.isDigit head = true ∧ ∀ (x : Char), x ∈ tail → Char.isDigit x = true ⊢ -↑(toNatΔ tail) = ↑n TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toIntΔ_inv_IntreprΔ
[841, 1]
[862, 22]
simp only [h] at h₃
n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h : head = Char.ofNat 45 h₂ : Char.isDigit head = true ∧ ∀ (x : Char), x ∈ tail → Char.isDigit x = true h₃ : Char.isDigit head = true right✝ : ∀ (x : Char), x ∈ tail → Char.isDigit x = true ⊢ -↑(toNatΔ tail) = ↑n
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h : head = Char.ofNat 45 h₂ : Char.isDigit head = true ∧ ∀ (x : Char), x ∈ tail → Char.isDigit x = true h₃ : Char.isDigit head = true right✝ : ∀ (x : Char), x ∈ tail → Char.isDigit x = true ⊢ -↑(toNatΔ tail) = ↑n TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toIntΔ_inv_IntreprΔ
[841, 1]
[862, 22]
rw [← heq]
n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h : head = Char.ofNat 45 ⊢ (List.all (head :: tail) Char.isDigit == true) = true
n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h : head = Char.ofNat 45 ⊢ (List.all (Nat.toDigits 10 n) Char.isDigit == true) = true
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h : head = Char.ofNat 45 ⊢ (List.all (head :: tail) Char.isDigit == true) = true TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toIntΔ_inv_IntreprΔ
[841, 1]
[862, 22]
apply Nat.toDigits_digits <;> decide
n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h : head = Char.ofNat 45 ⊢ (List.all (Nat.toDigits 10 n) Char.isDigit == true) = true
no goals
Please generate a tactic in lean4 to solve the state. STATE: n : ℕ s✝ : List Char head : Char tail : List Char heq : Nat.toDigits 10 n = head :: tail h : head = Char.ofNat 45 ⊢ (List.all (Nat.toDigits 10 n) Char.isDigit == true) = true TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toIntΔ_inv_IntreprΔ
[841, 1]
[862, 22]
simp only [List.singleton_append, toNatΔ_inv_NattoDigits, Nat.cast_succ, neg_add_rev, ite_true, Int.negSucc_eq]
case negSucc n : ℕ ⊢ (match match Int.negSucc n with | Int.ofNat m => Nat.toDigits 10 m | Int.negSucc m => [Char.ofNat 45] ++ Nat.toDigits 10 (Nat.succ m) with | [] => 0 | h :: tail => if h = Char.ofNat 45 then -↑(toNatΔ tail) else ↑(toNatΔ (h :: tail))) = Int.negSucc n
no goals
Please generate a tactic in lean4 to solve the state. STATE: case negSucc n : ℕ ⊢ (match match Int.negSucc n with | Int.ofNat m => Nat.toDigits 10 m | Int.negSucc m => [Char.ofNat 45] ++ Nat.toDigits 10 (Nat.succ m) with | [] => 0 | h :: tail => if h = Char.ofNat 45 then -↑(toNatΔ tail) else ↑(toNatΔ (h :: tail))) = Int.negSucc n TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
induction l₁ generalizing l l₂ with | nil => unfold getRest at P simp only [Option.some.injEq] at P simp only [P, nil_append] | cons head tail ih => unfold getRest at P split at P case h_1 heq => simp only at heq case h_2 => simp only at P case h_3 hd tl y l₁ heq => split at P case inr heq₂ => contradiction case inl heq₂ => injection heq subst hd y l₁ simp only [cons_append, cons.injEq, true_and] apply ih apply P
α : Type u_1 inst✝ : DecidableEq α l l₁ l₂ : List α P : getRest l l₁ = some l₂ ⊢ l = l₁ ++ l₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α l l₁ l₂ : List α P : getRest l l₁ = some l₂ ⊢ l = l₁ ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
unfold getRest at P
case nil α : Type u_1 inst✝ : DecidableEq α l l₂ : List α P : getRest l [] = some l₂ ⊢ l = [] ++ l₂
case nil α : Type u_1 inst✝ : DecidableEq α l l₂ : List α P : (match l, [] with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ l = [] ++ l₂
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 inst✝ : DecidableEq α l l₂ : List α P : getRest l [] = some l₂ ⊢ l = [] ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
simp only [Option.some.injEq] at P
case nil α : Type u_1 inst✝ : DecidableEq α l l₂ : List α P : (match l, [] with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ l = [] ++ l₂
case nil α : Type u_1 inst✝ : DecidableEq α l l₂ : List α P : l = l₂ ⊢ l = [] ++ l₂
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 inst✝ : DecidableEq α l l₂ : List α P : (match l, [] with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ l = [] ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
simp only [P, nil_append]
case nil α : Type u_1 inst✝ : DecidableEq α l l₂ : List α P : l = l₂ ⊢ l = [] ++ l₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 inst✝ : DecidableEq α l l₂ : List α P : l = l₂ ⊢ l = [] ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
unfold getRest at P
case cons α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l l₂ : List α P : getRest l (head :: tail) = some l₂ ⊢ l = head :: tail ++ l₂
case cons α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l l₂ : List α P : (match l, head :: tail with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ l = head :: tail ++ l₂
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l l₂ : List α P : getRest l (head :: tail) = some l₂ ⊢ l = head :: tail ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
split at P
case cons α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l l₂ : List α P : (match l, head :: tail with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ l = head :: tail ++ l₂
case cons.h_1 α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝² x✝¹ x✝ : List α heq✝ : head :: tail = [] P : some x✝² = some l₂ ⊢ x✝² = head :: tail ++ l₂ case cons.h_2 α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝² x✝¹ : List α x✝ : head :: tail = [] → False P : none = some l₂ ⊢ [] = head :: tail ++ l₂ case cons.h_3 α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝² x✝¹ : List α x✝ : α l✝ : List α y✝ : α l₁✝ : List α heq✝ : head :: tail = y✝ :: l₁✝ P : (if x✝ = y✝ then getRest l✝ l₁✝ else none) = some l₂ ⊢ x✝ :: l✝ = head :: tail ++ l₂
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l l₂ : List α P : (match l, head :: tail with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ l = head :: tail ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
case h_1 heq => simp only at heq
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝² x✝¹ x✝ : List α heq : head :: tail = [] P : some x✝² = some l₂ ⊢ x✝² = head :: tail ++ l₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝² x✝¹ x✝ : List α heq : head :: tail = [] P : some x✝² = some l₂ ⊢ x✝² = head :: tail ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
case h_2 => simp only at P
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝² x✝¹ : List α x✝ : head :: tail = [] → False P : none = some l₂ ⊢ [] = head :: tail ++ l₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝² x✝¹ : List α x✝ : head :: tail = [] → False P : none = some l₂ ⊢ [] = head :: tail ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
case h_3 hd tl y l₁ heq => split at P case inr heq₂ => contradiction case inl heq₂ => injection heq subst hd y l₁ simp only [cons_append, cons.injEq, true_and] apply ih apply P
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ : List α hd : α tl : List α y : α l₁ : List α heq : head :: tail = y :: l₁ P : (if hd = y then getRest tl l₁ else none) = some l₂ ⊢ hd :: tl = head :: tail ++ l₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ : List α hd : α tl : List α y : α l₁ : List α heq : head :: tail = y :: l₁ P : (if hd = y then getRest tl l₁ else none) = some l₂ ⊢ hd :: tl = head :: tail ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
simp only at heq
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝² x✝¹ x✝ : List α heq : head :: tail = [] P : some x✝² = some l₂ ⊢ x✝² = head :: tail ++ l₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝² x✝¹ x✝ : List α heq : head :: tail = [] P : some x✝² = some l₂ ⊢ x✝² = head :: tail ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
simp only at P
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝² x✝¹ : List α x✝ : head :: tail = [] → False P : none = some l₂ ⊢ [] = head :: tail ++ l₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝² x✝¹ : List α x✝ : head :: tail = [] → False P : none = some l₂ ⊢ [] = head :: tail ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
split at P
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ : List α hd : α tl : List α y : α l₁ : List α heq : head :: tail = y :: l₁ P : (if hd = y then getRest tl l₁ else none) = some l₂ ⊢ hd :: tl = head :: tail ++ l₂
case inl α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ : List α hd : α tl : List α y : α l₁ : List α heq : head :: tail = y :: l₁ h✝ : hd = y P : getRest tl l₁ = some l₂ ⊢ hd :: tl = head :: tail ++ l₂ case inr α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ : List α hd : α tl : List α y : α l₁ : List α heq : head :: tail = y :: l₁ h✝ : ¬hd = y P : False ⊢ hd :: tl = head :: tail ++ l₂
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ : List α hd : α tl : List α y : α l₁ : List α heq : head :: tail = y :: l₁ P : (if hd = y then getRest tl l₁ else none) = some l₂ ⊢ hd :: tl = head :: tail ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
case inr heq₂ => contradiction
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ : List α hd : α tl : List α y : α l₁ : List α heq : head :: tail = y :: l₁ heq₂ : ¬hd = y P : False ⊢ hd :: tl = head :: tail ++ l₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ : List α hd : α tl : List α y : α l₁ : List α heq : head :: tail = y :: l₁ heq₂ : ¬hd = y P : False ⊢ hd :: tl = head :: tail ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
case inl heq₂ => injection heq subst hd y l₁ simp only [cons_append, cons.injEq, true_and] apply ih apply P
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ : List α hd : α tl : List α y : α l₁ : List α heq : head :: tail = y :: l₁ heq₂ : hd = y P : getRest tl l₁ = some l₂ ⊢ hd :: tl = head :: tail ++ l₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ : List α hd : α tl : List α y : α l₁ : List α heq : head :: tail = y :: l₁ heq₂ : hd = y P : getRest tl l₁ = some l₂ ⊢ hd :: tl = head :: tail ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
contradiction
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ : List α hd : α tl : List α y : α l₁ : List α heq : head :: tail = y :: l₁ heq₂ : ¬hd = y P : False ⊢ hd :: tl = head :: tail ++ l₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ : List α hd : α tl : List α y : α l₁ : List α heq : head :: tail = y :: l₁ heq₂ : ¬hd = y P : False ⊢ hd :: tl = head :: tail ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
injection heq
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ : List α hd : α tl : List α y : α l₁ : List α heq : head :: tail = y :: l₁ heq₂ : hd = y P : getRest tl l₁ = some l₂ ⊢ hd :: tl = head :: tail ++ l₂
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ : List α hd : α tl : List α y : α l₁ : List α heq₂ : hd = y P : getRest tl l₁ = some l₂ head_eq✝ : head = y tail_eq✝ : tail = l₁ ⊢ hd :: tl = head :: tail ++ l₂
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ : List α hd : α tl : List α y : α l₁ : List α heq : head :: tail = y :: l₁ heq₂ : hd = y P : getRest tl l₁ = some l₂ ⊢ hd :: tl = head :: tail ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
subst hd y l₁
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ : List α hd : α tl : List α y : α l₁ : List α heq₂ : hd = y P : getRest tl l₁ = some l₂ head_eq✝ : head = y tail_eq✝ : tail = l₁ ⊢ hd :: tl = head :: tail ++ l₂
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ tl : List α P : getRest tl tail = some l₂ ⊢ head :: tl = head :: tail ++ l₂
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ : List α hd : α tl : List α y : α l₁ : List α heq₂ : hd = y P : getRest tl l₁ = some l₂ head_eq✝ : head = y tail_eq✝ : tail = l₁ ⊢ hd :: tl = head :: tail ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
simp only [cons_append, cons.injEq, true_and]
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ tl : List α P : getRest tl tail = some l₂ ⊢ head :: tl = head :: tail ++ l₂
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ tl : List α P : getRest tl tail = some l₂ ⊢ tl = tail ++ l₂
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ tl : List α P : getRest tl tail = some l₂ ⊢ head :: tl = head :: tail ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
apply ih
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ tl : List α P : getRest tl tail = some l₂ ⊢ tl = tail ++ l₂
case P α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ tl : List α P : getRest tl tail = some l₂ ⊢ getRest tl tail = some l₂
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ tl : List α P : getRest tl tail = some l₂ ⊢ tl = tail ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.eq_append_of_getRest
[864, 1]
[883, 16]
apply P
case P α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ tl : List α P : getRest tl tail = some l₂ ⊢ getRest tl tail = some l₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: case P α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l l₂ : List α}, getRest l tail = some l₂ → l = tail ++ l₂ l₂ x✝¹ x✝ tl : List α P : getRest tl tail = some l₂ ⊢ getRest tl tail = some l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.getRest_nil
[886, 1]
[889, 12]
unfold getRest
α : Type u_1 inst✝ : DecidableEq α l : List α ⊢ getRest l [] = some l
α : Type u_1 inst✝ : DecidableEq α l : List α ⊢ (match l, [] with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α l : List α ⊢ getRest l [] = some l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.getRest_nil
[886, 1]
[889, 12]
simp only
α : Type u_1 inst✝ : DecidableEq α l : List α ⊢ (match l, [] with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α l : List α ⊢ (match l, [] with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.getRest_delim_append
[891, 1]
[897, 42]
induction l₁ with | nil => simp only [nil_append, getRest_nil] | cons head tail ih => unfold getRest simp only [cons_append, ih, ite_true]
α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ getRest (l₁ ++ l₂) l₁ = some l₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ getRest (l₁ ++ l₂) l₁ = some l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.getRest_delim_append
[891, 1]
[897, 42]
simp only [nil_append, getRest_nil]
case nil α : Type u_1 inst✝ : DecidableEq α l₂ : List α ⊢ getRest ([] ++ l₂) [] = some l₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 inst✝ : DecidableEq α l₂ : List α ⊢ getRest ([] ++ l₂) [] = some l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.getRest_delim_append
[891, 1]
[897, 42]
unfold getRest
case cons α : Type u_1 inst✝ : DecidableEq α l₂ : List α head : α tail : List α ih : getRest (tail ++ l₂) tail = some l₂ ⊢ getRest (head :: tail ++ l₂) (head :: tail) = some l₂
case cons α : Type u_1 inst✝ : DecidableEq α l₂ : List α head : α tail : List α ih : getRest (tail ++ l₂) tail = some l₂ ⊢ (match head :: tail ++ l₂, head :: tail with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 inst✝ : DecidableEq α l₂ : List α head : α tail : List α ih : getRest (tail ++ l₂) tail = some l₂ ⊢ getRest (head :: tail ++ l₂) (head :: tail) = some l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.getRest_delim_append
[891, 1]
[897, 42]
simp only [cons_append, ih, ite_true]
case cons α : Type u_1 inst✝ : DecidableEq α l₂ : List α head : α tail : List α ih : getRest (tail ++ l₂) tail = some l₂ ⊢ (match head :: tail ++ l₂, head :: tail with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 inst✝ : DecidableEq α l₂ : List α head : α tail : List α ih : getRest (tail ++ l₂) tail = some l₂ ⊢ (match head :: tail ++ l₂, head :: tail with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.nil_isInfix
[899, 1]
[903, 11]
unfold List.isInfix
α✝ : Type u_1 l : List α✝ ⊢ [] <:+: l
α✝ : Type u_1 l : List α✝ ⊢ ∃ s t, s ++ [] ++ t = l
Please generate a tactic in lean4 to solve the state. STATE: α✝ : Type u_1 l : List α✝ ⊢ [] <:+: l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.nil_isInfix
[899, 1]
[903, 11]
exists []
α✝ : Type u_1 l : List α✝ ⊢ ∃ s t, s ++ [] ++ t = l
α✝ : Type u_1 l : List α✝ ⊢ ∃ t, [] ++ [] ++ t = l
Please generate a tactic in lean4 to solve the state. STATE: α✝ : Type u_1 l : List α✝ ⊢ ∃ s t, s ++ [] ++ t = l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.nil_isInfix
[899, 1]
[903, 11]
exists l
α✝ : Type u_1 l : List α✝ ⊢ ∃ t, [] ++ [] ++ t = l
no goals
Please generate a tactic in lean4 to solve the state. STATE: α✝ : Type u_1 l : List α✝ ⊢ ∃ t, [] ++ [] ++ t = l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.nil_isPrefix
[905, 1]
[908, 11]
unfold List.isPrefix
α✝ : Type u_1 l : List α✝ ⊢ [] <+: l
α✝ : Type u_1 l : List α✝ ⊢ ∃ t, [] ++ t = l
Please generate a tactic in lean4 to solve the state. STATE: α✝ : Type u_1 l : List α✝ ⊢ [] <+: l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.nil_isPrefix
[905, 1]
[908, 11]
exists l
α✝ : Type u_1 l : List α✝ ⊢ ∃ t, [] ++ t = l
no goals
Please generate a tactic in lean4 to solve the state. STATE: α✝ : Type u_1 l : List α✝ ⊢ ∃ t, [] ++ t = l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.nil_isSuffix
[911, 1]
[914, 36]
unfold List.isSuffix
α✝ : Type u_1 l : List α✝ ⊢ [] <:+ l
α✝ : Type u_1 l : List α✝ ⊢ ∃ t, t ++ [] = l
Please generate a tactic in lean4 to solve the state. STATE: α✝ : Type u_1 l : List α✝ ⊢ [] <:+ l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.nil_isSuffix
[911, 1]
[914, 36]
simp only [append_nil, exists_eq]
α✝ : Type u_1 l : List α✝ ⊢ ∃ t, t ++ [] = l
no goals
Please generate a tactic in lean4 to solve the state. STATE: α✝ : Type u_1 l : List α✝ ⊢ ∃ t, t ++ [] = l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.isInfix_cons
[916, 1]
[921, 47]
unfold List.isInfix at *
α : Type u_1 head : α l tail : List α h : l <:+: tail ⊢ l <:+: head :: tail
α : Type u_1 head : α l tail : List α h : ∃ s t, s ++ l ++ t = tail ⊢ ∃ s t, s ++ l ++ t = head :: tail
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 head : α l tail : List α h : l <:+: tail ⊢ l <:+: head :: tail TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.isInfix_cons
[916, 1]
[921, 47]
match h with | ⟨s, t, P⟩ => exists head::s, t simp only [cons_append, append_assoc, ← P]
α : Type u_1 head : α l tail : List α h : ∃ s t, s ++ l ++ t = tail ⊢ ∃ s t, s ++ l ++ t = head :: tail
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 head : α l tail : List α h : ∃ s t, s ++ l ++ t = tail ⊢ ∃ s t, s ++ l ++ t = head :: tail TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.isInfix_cons
[916, 1]
[921, 47]
exists head::s, t
α : Type u_1 head : α l tail : List α h : ∃ s t, s ++ l ++ t = tail s t : List α P : s ++ l ++ t = tail ⊢ ∃ s t, s ++ l ++ t = head :: tail
α : Type u_1 head : α l tail : List α h : ∃ s t, s ++ l ++ t = tail s t : List α P : s ++ l ++ t = tail ⊢ head :: s ++ l ++ t = head :: tail
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 head : α l tail : List α h : ∃ s t, s ++ l ++ t = tail s t : List α P : s ++ l ++ t = tail ⊢ ∃ s t, s ++ l ++ t = head :: tail TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.isInfix_cons
[916, 1]
[921, 47]
simp only [cons_append, append_assoc, ← P]
α : Type u_1 head : α l tail : List α h : ∃ s t, s ++ l ++ t = tail s t : List α P : s ++ l ++ t = tail ⊢ head :: s ++ l ++ t = head :: tail
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 head : α l tail : List α h : ∃ s t, s ++ l ++ t = tail s t : List α P : s ++ l ++ t = tail ⊢ head :: s ++ l ++ t = head :: tail TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.isInfix_append_left
[923, 1]
[924, 93]
exact ⟨ [], l₂, rfl⟩
α : Type u_1 l₁ l₂ : List α ⊢ l₁ <:+: l₁ ++ l₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 l₁ l₂ : List α ⊢ l₁ <:+: l₁ ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.isInfix_append_right
[926, 1]
[927, 108]
exact ⟨ l₁, [], List.append_nil _⟩
α : Type u_1 l₁ l₂ : List α ⊢ l₂ <:+: l₁ ++ l₂
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 l₁ l₂ : List α ⊢ l₂ <:+: l₁ ++ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.isInfix_self
[929, 1]
[930, 74]
exact ⟨[], [], List.append_nil _⟩
α✝ : Type u_1 l : List α✝ ⊢ l <:+: l
no goals
Please generate a tactic in lean4 to solve the state. STATE: α✝ : Type u_1 l : List α✝ ⊢ l <:+: l TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.getRest_none
[933, 1]
[944, 53]
apply iff_not_comm.1
α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ getRest l₁ l₂ = none ↔ ¬l₂ <+: l₁
α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ l₂ <+: l₁ ↔ ¬getRest l₁ l₂ = none
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ getRest l₁ l₂ = none ↔ ¬l₂ <+: l₁ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.getRest_none
[933, 1]
[944, 53]
rw [← ne_eq, Option.ne_none_iff_exists]
α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ l₂ <+: l₁ ↔ ¬getRest l₁ l₂ = none
α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ l₂ <+: l₁ ↔ ∃ x, some x = getRest l₁ l₂
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ l₂ <+: l₁ ↔ ¬getRest l₁ l₂ = none TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.getRest_none
[933, 1]
[944, 53]
apply Iff.intro
α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ l₂ <+: l₁ ↔ ∃ x, some x = getRest l₁ l₂
case mp α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ l₂ <+: l₁ → ∃ x, some x = getRest l₁ l₂ case mpr α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ (∃ x, some x = getRest l₁ l₂) → l₂ <+: l₁
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ l₂ <+: l₁ ↔ ∃ x, some x = getRest l₁ l₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.getRest_none
[933, 1]
[944, 53]
. intro ⟨l₃, h⟩ subst h exists l₃ exact Eq.symm getRest_delim_append
case mp α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ l₂ <+: l₁ → ∃ x, some x = getRest l₁ l₂ case mpr α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ (∃ x, some x = getRest l₁ l₂) → l₂ <+: l₁
case mpr α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ (∃ x, some x = getRest l₁ l₂) → l₂ <+: l₁
Please generate a tactic in lean4 to solve the state. STATE: case mp α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ l₂ <+: l₁ → ∃ x, some x = getRest l₁ l₂ case mpr α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ (∃ x, some x = getRest l₁ l₂) → l₂ <+: l₁ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.getRest_none
[933, 1]
[944, 53]
. intro ⟨l₃, h⟩ exists l₃ exact Eq.symm (eq_append_of_getRest (Eq.symm h))
case mpr α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ (∃ x, some x = getRest l₁ l₂) → l₂ <+: l₁
no goals
Please generate a tactic in lean4 to solve the state. STATE: case mpr α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α ⊢ (∃ x, some x = getRest l₁ l₂) → l₂ <+: l₁ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_getRest
[947, 1]
[967, 73]
induction l generalizing l₁ l₂ with | nil => unfold getRest at h cases l₁ . simp only [Option.some.injEq] at h subst h simp only [nil.sizeOf_spec, add_tsub_cancel_right, ge_iff_le] . simp only at h | cons head tail ih => unfold getRest at h split at h <;> try contradiction case h_1 heq => injection h; simp_all only [tsub_le_iff_right, ge_iff_le, nil.sizeOf_spec, add_tsub_cancel_left, add_le_iff_nonpos_right, nonpos_iff_eq_zero, zero_le] case h_3 heq => split at h <;> try contradiction case inl heq₂ => injection heq subst_vars simp only [ih h, tsub_le_iff_right, ge_iff_le, cons.sizeOf_spec, sizeOf_default, add_zero, zero_le, nonpos_iff_eq_zero, Nat.add_sub_add_left, add_le_add_iff_left]
α : Type u_1 inst✝ : DecidableEq α l l₁ l₂ : List α h : getRest l l₁ = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf l - sizeOf l₁
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α l l₁ l₂ : List α h : getRest l l₁ = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf l - sizeOf l₁ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_getRest
[947, 1]
[967, 73]
unfold getRest at h
case nil α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α h : getRest [] l₁ = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf [] - sizeOf l₁
case nil α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α h : (match [], l₁ with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf [] - sizeOf l₁
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α h : getRest [] l₁ = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf [] - sizeOf l₁ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_getRest
[947, 1]
[967, 73]
cases l₁
case nil α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α h : (match [], l₁ with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf [] - sizeOf l₁
case nil.nil α : Type u_1 inst✝ : DecidableEq α l₂ : List α h : (match [], [] with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf [] - sizeOf [] case nil.cons α : Type u_1 inst✝ : DecidableEq α l₂ : List α head✝ : α tail✝ : List α h : (match [], head✝ :: tail✝ with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf [] - sizeOf (head✝ :: tail✝)
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 inst✝ : DecidableEq α l₁ l₂ : List α h : (match [], l₁ with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf [] - sizeOf l₁ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_getRest
[947, 1]
[967, 73]
. simp only [Option.some.injEq] at h subst h simp only [nil.sizeOf_spec, add_tsub_cancel_right, ge_iff_le]
case nil.nil α : Type u_1 inst✝ : DecidableEq α l₂ : List α h : (match [], [] with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf [] - sizeOf [] case nil.cons α : Type u_1 inst✝ : DecidableEq α l₂ : List α head✝ : α tail✝ : List α h : (match [], head✝ :: tail✝ with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf [] - sizeOf (head✝ :: tail✝)
case nil.cons α : Type u_1 inst✝ : DecidableEq α l₂ : List α head✝ : α tail✝ : List α h : (match [], head✝ :: tail✝ with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf [] - sizeOf (head✝ :: tail✝)
Please generate a tactic in lean4 to solve the state. STATE: case nil.nil α : Type u_1 inst✝ : DecidableEq α l₂ : List α h : (match [], [] with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf [] - sizeOf [] case nil.cons α : Type u_1 inst✝ : DecidableEq α l₂ : List α head✝ : α tail✝ : List α h : (match [], head✝ :: tail✝ with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf [] - sizeOf (head✝ :: tail✝) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_getRest
[947, 1]
[967, 73]
. simp only at h
case nil.cons α : Type u_1 inst✝ : DecidableEq α l₂ : List α head✝ : α tail✝ : List α h : (match [], head✝ :: tail✝ with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf [] - sizeOf (head✝ :: tail✝)
no goals
Please generate a tactic in lean4 to solve the state. STATE: case nil.cons α : Type u_1 inst✝ : DecidableEq α l₂ : List α head✝ : α tail✝ : List α h : (match [], head✝ :: tail✝ with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf [] - sizeOf (head✝ :: tail✝) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_getRest
[947, 1]
[967, 73]
unfold getRest at h
case cons α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₁ l₂ : List α h : getRest (head :: tail) l₁ = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf l₁
case cons α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₁ l₂ : List α h : (match head :: tail, l₁ with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf l₁
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₁ l₂ : List α h : getRest (head :: tail) l₁ = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf l₁ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_getRest
[947, 1]
[967, 73]
split at h <;> try contradiction
case cons α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₁ l₂ : List α h : (match head :: tail, l₁ with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf l₁
case cons.h_1 α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝¹ x✝ : List α h : some (head :: tail) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf [] case cons.h_3 α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝² x✝¹ : List α x✝ : α l✝ : List α y✝ : α l₁✝ : List α heq✝ : head :: tail = x✝ :: l✝ h : (if x✝ = y✝ then getRest l✝ l₁✝ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf (y✝ :: l₁✝)
Please generate a tactic in lean4 to solve the state. STATE: case cons α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₁ l₂ : List α h : (match head :: tail, l₁ with | l, [] => some l | [], x => none | x :: l, y :: l₁ => if x = y then getRest l l₁ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf l₁ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_getRest
[947, 1]
[967, 73]
case h_1 heq => injection h; simp_all only [tsub_le_iff_right, ge_iff_le, nil.sizeOf_spec, add_tsub_cancel_left, add_le_iff_nonpos_right, nonpos_iff_eq_zero, zero_le]
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝ heq : List α h : some (head :: tail) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf []
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝ heq : List α h : some (head :: tail) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_getRest
[947, 1]
[967, 73]
case h_3 heq => split at h <;> try contradiction case inl heq₂ => injection heq subst_vars simp only [ih h, tsub_le_iff_right, ge_iff_le, cons.sizeOf_spec, sizeOf_default, add_zero, zero_le, nonpos_iff_eq_zero, Nat.add_sub_add_left, add_le_add_iff_left]
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝² x✝¹ : List α x✝ : α l✝ : List α y✝ : α l₁✝ : List α heq : head :: tail = x✝ :: l✝ h : (if x✝ = y✝ then getRest l✝ l₁✝ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf (y✝ :: l₁✝)
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝² x✝¹ : List α x✝ : α l✝ : List α y✝ : α l₁✝ : List α heq : head :: tail = x✝ :: l✝ h : (if x✝ = y✝ then getRest l✝ l₁✝ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf (y✝ :: l₁✝) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_getRest
[947, 1]
[967, 73]
contradiction
case cons.h_2 α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝³ x✝² x✝¹ : List α heq✝ : head :: tail = [] x✝ : x✝³ = [] → False h : none = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf x✝³
no goals
Please generate a tactic in lean4 to solve the state. STATE: case cons.h_2 α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝³ x✝² x✝¹ : List α heq✝ : head :: tail = [] x✝ : x✝³ = [] → False h : none = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf x✝³ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_getRest
[947, 1]
[967, 73]
injection h
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝ heq : List α h : some (head :: tail) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf []
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝ heq : List α val_eq✝ : head :: tail = l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf []
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝ heq : List α h : some (head :: tail) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_getRest
[947, 1]
[967, 73]
simp_all only [tsub_le_iff_right, ge_iff_le, nil.sizeOf_spec, add_tsub_cancel_left, add_le_iff_nonpos_right, nonpos_iff_eq_zero, zero_le]
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝ heq : List α val_eq✝ : head :: tail = l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf []
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝ heq : List α val_eq✝ : head :: tail = l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_getRest
[947, 1]
[967, 73]
split at h <;> try contradiction
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝² x✝¹ : List α x✝ : α l✝ : List α y✝ : α l₁✝ : List α heq : head :: tail = x✝ :: l✝ h : (if x✝ = y✝ then getRest l✝ l₁✝ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf (y✝ :: l₁✝)
case inl α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝² x✝¹ : List α x✝ : α l✝ : List α y✝ : α l₁✝ : List α heq : head :: tail = x✝ :: l✝ h✝ : x✝ = y✝ h : getRest l✝ l₁✝ = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf (y✝ :: l₁✝)
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝² x✝¹ : List α x✝ : α l✝ : List α y✝ : α l₁✝ : List α heq : head :: tail = x✝ :: l✝ h : (if x✝ = y✝ then getRest l✝ l₁✝ else none) = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf (y✝ :: l₁✝) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_getRest
[947, 1]
[967, 73]
case inl heq₂ => injection heq subst_vars simp only [ih h, tsub_le_iff_right, ge_iff_le, cons.sizeOf_spec, sizeOf_default, add_zero, zero_le, nonpos_iff_eq_zero, Nat.add_sub_add_left, add_le_add_iff_left]
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝² x✝¹ : List α x✝ : α l✝ : List α y✝ : α l₁✝ : List α heq : head :: tail = x✝ :: l✝ heq₂ : x✝ = y✝ h : getRest l✝ l₁✝ = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf (y✝ :: l₁✝)
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝² x✝¹ : List α x✝ : α l✝ : List α y✝ : α l₁✝ : List α heq : head :: tail = x✝ :: l✝ heq₂ : x✝ = y✝ h : getRest l✝ l₁✝ = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf (y✝ :: l₁✝) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_getRest
[947, 1]
[967, 73]
contradiction
case inr α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝² x✝¹ : List α x✝ : α l✝ : List α y✝ : α l₁✝ : List α heq : head :: tail = x✝ :: l✝ h✝ : ¬x✝ = y✝ h : False ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf (y✝ :: l₁✝)
no goals
Please generate a tactic in lean4 to solve the state. STATE: case inr α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝² x✝¹ : List α x✝ : α l✝ : List α y✝ : α l₁✝ : List α heq : head :: tail = x✝ :: l✝ h✝ : ¬x✝ = y✝ h : False ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf (y✝ :: l₁✝) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_getRest
[947, 1]
[967, 73]
injection heq
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝² x✝¹ : List α x✝ : α l✝ : List α y✝ : α l₁✝ : List α heq : head :: tail = x✝ :: l✝ heq₂ : x✝ = y✝ h : getRest l✝ l₁✝ = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf (y✝ :: l₁✝)
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝² x✝¹ : List α x✝ : α l✝ : List α y✝ : α l₁✝ : List α heq₂ : x✝ = y✝ h : getRest l✝ l₁✝ = some l₂ head_eq✝ : head = x✝ tail_eq✝ : tail = l✝ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf (y✝ :: l₁✝)
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝² x✝¹ : List α x✝ : α l✝ : List α y✝ : α l₁✝ : List α heq : head :: tail = x✝ :: l✝ heq₂ : x✝ = y✝ h : getRest l✝ l₁✝ = some l₂ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf (y✝ :: l₁✝) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_getRest
[947, 1]
[967, 73]
subst_vars
α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝² x✝¹ : List α x✝ : α l✝ : List α y✝ : α l₁✝ : List α heq₂ : x✝ = y✝ h : getRest l✝ l₁✝ = some l₂ head_eq✝ : head = x✝ tail_eq✝ : tail = l✝ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf (y✝ :: l₁✝)
α : Type u_1 inst✝ : DecidableEq α l₂ x✝¹ x✝ l✝ : List α y✝ : α l₁✝ : List α h : getRest l✝ l₁✝ = some l₂ ih : ∀ {l₁ l₂ : List α}, getRest l✝ l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf l✝ - sizeOf l₁ ⊢ sizeOf l₂ = 1 + sizeOf (y✝ :: l✝) - sizeOf (y✝ :: l₁✝)
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α head : α tail : List α ih : ∀ {l₁ l₂ : List α}, getRest tail l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf tail - sizeOf l₁ l₂ x✝² x✝¹ : List α x✝ : α l✝ : List α y✝ : α l₁✝ : List α heq₂ : x✝ = y✝ h : getRest l✝ l₁✝ = some l₂ head_eq✝ : head = x✝ tail_eq✝ : tail = l✝ ⊢ sizeOf l₂ = 1 + sizeOf (head :: tail) - sizeOf (y✝ :: l₁✝) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_getRest
[947, 1]
[967, 73]
simp only [ih h, tsub_le_iff_right, ge_iff_le, cons.sizeOf_spec, sizeOf_default, add_zero, zero_le, nonpos_iff_eq_zero, Nat.add_sub_add_left, add_le_add_iff_left]
α : Type u_1 inst✝ : DecidableEq α l₂ x✝¹ x✝ l✝ : List α y✝ : α l₁✝ : List α h : getRest l✝ l₁✝ = some l₂ ih : ∀ {l₁ l₂ : List α}, getRest l✝ l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf l✝ - sizeOf l₁ ⊢ sizeOf l₂ = 1 + sizeOf (y✝ :: l✝) - sizeOf (y✝ :: l₁✝)
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α l₂ x✝¹ x✝ l✝ : List α y✝ : α l₁✝ : List α h : getRest l✝ l₁✝ = some l₂ ih : ∀ {l₁ l₂ : List α}, getRest l✝ l₁ = some l₂ → sizeOf l₂ = 1 + sizeOf l✝ - sizeOf l₁ ⊢ sizeOf l₂ = 1 + sizeOf (y✝ :: l✝) - sizeOf (y✝ :: l₁✝) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.sizeOf_pos
[969, 1]
[971, 26]
cases l <;> simp only [cons.sizeOf_spec, nil.sizeOf_spec, sizeOf_default, add_zero, zero_le, ge_iff_le, nonpos_iff_eq_zero, gt_iff_lt, add_pos_iff, true_or]
α : Type u_1 l : List α ⊢ sizeOf l > 0
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 l : List α ⊢ sizeOf l > 0 TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.data_injective
[1005, 1]
[1009, 8]
unfold Function.Injective
α : Type u_1 ⊢ Function.Injective data
α : Type u_1 ⊢ ∀ ⦃a₁ a₂ : Array α⦄, a₁.data = a₂.data → a₁ = a₂
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 ⊢ Function.Injective data TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.data_injective
[1005, 1]
[1009, 8]
intro a₁ a₂ h
α : Type u_1 ⊢ ∀ ⦃a₁ a₂ : Array α⦄, a₁.data = a₂.data → a₁ = a₂
α : Type u_1 a₁ a₂ : Array α h : a₁.data = a₂.data ⊢ a₁ = a₂
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 ⊢ ∀ ⦃a₁ a₂ : Array α⦄, a₁.data = a₂.data → a₁ = a₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.data_injective
[1005, 1]
[1009, 8]
rw [← Array.toArray_data a₁, ← Array.toArray_data a₂]
α : Type u_1 a₁ a₂ : Array α h : a₁.data = a₂.data ⊢ a₁ = a₂
α : Type u_1 a₁ a₂ : Array α h : a₁.data = a₂.data ⊢ List.toArray a₁.data = List.toArray a₂.data
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 a₁ a₂ : Array α h : a₁.data = a₂.data ⊢ a₁ = a₂ TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.data_injective
[1005, 1]
[1009, 8]
congr
α : Type u_1 a₁ a₂ : Array α h : a₁.data = a₂.data ⊢ List.toArray a₁.data = List.toArray a₂.data
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 a₁ a₂ : Array α h : a₁.data = a₂.data ⊢ List.toArray a₁.data = List.toArray a₂.data TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_r
[1019, 1]
[1038, 72]
induction l using List.induction_by_length_on generalizing acc r rest with | h l ih => unfold splitOnListAux split case h_1 => simp only [Array.ext_iff, Array.push_data, Array.append_data, append_assoc] case h_2 head tail => split case h_1 heq₂ => simp only [length_cons, gt_iff_lt, Nat.lt_succ_self, ih] case h_2 rst heq₂ => simp only have h₃: Array.push (r ++ rest) acc = r ++ (Array.push rest acc) := by simp only [Array.ext_iff, Array.push_data, Array.append_data, append_assoc] rw [h₃, ih] have h₄:= List.eq_append_of_getRest heq₂ simp only [h₄, length_append, lt_add_iff_pos_left, zero_le, ge_iff_le, nonpos_iff_eq_zero, Nat.pos_iff_ne_zero, ne_eq, length_eq_zero, h, not_false_iff]
α : Type u_1 acc : Array α r rest : Array (Array α) inst✝ : DecidableEq α delim l : List α h : delim ≠ [] ⊢ splitOnListAux delim l acc (r ++ rest) h = r ++ splitOnListAux delim l acc rest h
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 acc : Array α r rest : Array (Array α) inst✝ : DecidableEq α delim l : List α h : delim ≠ [] ⊢ splitOnListAux delim l acc (r ++ rest) h = r ++ splitOnListAux delim l acc rest h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_r
[1019, 1]
[1038, 72]
unfold splitOnListAux
case h α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] l : List α ih : ∀ (l₂ : List α), length l₂ < length l → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h acc : Array α r rest : Array (Array α) ⊢ splitOnListAux delim l acc (r ++ rest) h = r ++ splitOnListAux delim l acc rest h
case h α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] l : List α ih : ∀ (l₂ : List α), length l₂ < length l → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h acc : Array α r rest : Array (Array α) ⊢ (match _h₀ : l with | [] => Array.push (r ++ rest) acc | head :: tail => match h : getRest l delim with | none => splitOnListAux delim tail (Array.push acc head) (r ++ rest) h | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf l); splitOnListAux delim rest_1 #[] (Array.push (r ++ rest) acc) h) = r ++ match _h₀ : l with | [] => Array.push rest acc | head :: tail => match h : getRest l delim with | none => splitOnListAux delim tail (Array.push acc head) rest h | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf l); splitOnListAux delim rest_1 #[] (Array.push rest acc) 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 α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h acc : Array α r rest : Array (Array α) ⊢ splitOnListAux delim l acc (r ++ rest) h = r ++ splitOnListAux delim l acc rest h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_r
[1019, 1]
[1038, 72]
split
case h α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] l : List α ih : ∀ (l₂ : List α), length l₂ < length l → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h acc : Array α r rest : Array (Array α) ⊢ (match _h₀ : l with | [] => Array.push (r ++ rest) acc | head :: tail => match h : getRest l delim with | none => splitOnListAux delim tail (Array.push acc head) (r ++ rest) h | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf l); splitOnListAux delim rest_1 #[] (Array.push (r ++ rest) acc) h) = r ++ match _h₀ : l with | [] => Array.push rest acc | head :: tail => match h : getRest l delim with | none => splitOnListAux delim tail (Array.push acc head) rest h | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf l); splitOnListAux delim rest_1 #[] (Array.push rest acc) h
case h.h_1 α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) ih : ∀ (l₂ : List α), length l₂ < length [] → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h ⊢ Array.push (r ++ rest) acc = r ++ Array.push rest acc case h.h_2 α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head✝ : α tail✝ : List α ih : ∀ (l₂ : List α), length l₂ < length (head✝ :: tail✝) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h ⊢ (match h : getRest (head✝ :: tail✝) delim with | none => splitOnListAux delim tail✝ (Array.push acc head✝) (r ++ rest) h | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf (head✝ :: tail✝)); splitOnListAux delim rest_1 #[] (Array.push (r ++ rest) acc) h) = r ++ match h : getRest (head✝ :: tail✝) delim with | none => splitOnListAux delim tail✝ (Array.push acc head✝) rest h | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf (head✝ :: tail✝)); splitOnListAux delim rest_1 #[] (Array.push rest acc) 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 α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h acc : Array α r rest : Array (Array α) ⊢ (match _h₀ : l with | [] => Array.push (r ++ rest) acc | head :: tail => match h : getRest l delim with | none => splitOnListAux delim tail (Array.push acc head) (r ++ rest) h | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf l); splitOnListAux delim rest_1 #[] (Array.push (r ++ rest) acc) h) = r ++ match _h₀ : l with | [] => Array.push rest acc | head :: tail => match h : getRest l delim with | none => splitOnListAux delim tail (Array.push acc head) rest h | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf l); splitOnListAux delim rest_1 #[] (Array.push rest acc) h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_r
[1019, 1]
[1038, 72]
case h_1 => simp only [Array.ext_iff, Array.push_data, Array.append_data, append_assoc]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) ih : ∀ (l₂ : List α), length l₂ < length [] → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h ⊢ Array.push (r ++ rest) acc = r ++ Array.push rest 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 α r rest : Array (Array α) ih : ∀ (l₂ : List α), length l₂ < length [] → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h ⊢ Array.push (r ++ rest) acc = r ++ Array.push rest acc TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_r
[1019, 1]
[1038, 72]
case h_2 head tail => split case h_1 heq₂ => simp only [length_cons, gt_iff_lt, Nat.lt_succ_self, ih] case h_2 rst heq₂ => simp only have h₃: Array.push (r ++ rest) acc = r ++ (Array.push rest acc) := by simp only [Array.ext_iff, Array.push_data, Array.append_data, append_assoc] rw [h₃, ih] have h₄:= List.eq_append_of_getRest heq₂ simp only [h₄, length_append, lt_add_iff_pos_left, zero_le, ge_iff_le, nonpos_iff_eq_zero, Nat.pos_iff_ne_zero, ne_eq, length_eq_zero, h, not_false_iff]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h ⊢ (match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push acc head) (r ++ rest) h | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf (head :: tail)); splitOnListAux delim rest_1 #[] (Array.push (r ++ rest) acc) h) = r ++ match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push acc head) rest h | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf (head :: tail)); splitOnListAux delim rest_1 #[] (Array.push rest acc) 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 α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h ⊢ (match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push acc head) (r ++ rest) h | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf (head :: tail)); splitOnListAux delim rest_1 #[] (Array.push (r ++ rest) acc) h) = r ++ match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push acc head) rest h | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf (head :: tail)); splitOnListAux delim rest_1 #[] (Array.push rest acc) h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_r
[1019, 1]
[1038, 72]
simp only [Array.ext_iff, Array.push_data, Array.append_data, append_assoc]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) ih : ∀ (l₂ : List α), length l₂ < length [] → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h ⊢ Array.push (r ++ rest) acc = r ++ Array.push rest 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 α r rest : Array (Array α) ih : ∀ (l₂ : List α), length l₂ < length [] → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h ⊢ Array.push (r ++ rest) acc = r ++ Array.push rest acc TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_r
[1019, 1]
[1038, 72]
split
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h ⊢ (match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push acc head) (r ++ rest) h | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf (head :: tail)); splitOnListAux delim rest_1 #[] (Array.push (r ++ rest) acc) h) = r ++ match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push acc head) rest h | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf (head :: tail)); splitOnListAux delim rest_1 #[] (Array.push rest acc) h
case h_1 α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h heq✝ : getRest (head :: tail) delim = none ⊢ splitOnListAux delim tail (Array.push acc head) (r ++ rest) h = r ++ splitOnListAux delim tail (Array.push acc head) rest h case h_2 α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rest✝ : List α heq✝ : getRest (head :: tail) delim = some rest✝ ⊢ (let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push (r ++ rest) acc) h) = r ++ let_fun x := (_ : sizeOf rest✝ < sizeOf (head :: tail)); splitOnListAux delim rest✝ #[] (Array.push rest acc) h
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h ⊢ (match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push acc head) (r ++ rest) h | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf (head :: tail)); splitOnListAux delim rest_1 #[] (Array.push (r ++ rest) acc) h) = r ++ match h : getRest (head :: tail) delim with | none => splitOnListAux delim tail (Array.push acc head) rest h | some rest_1 => let_fun x := (_ : sizeOf rest_1 < sizeOf (head :: tail)); splitOnListAux delim rest_1 #[] (Array.push rest acc) h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_r
[1019, 1]
[1038, 72]
case h_1 heq₂ => simp only [length_cons, gt_iff_lt, Nat.lt_succ_self, ih]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h heq₂ : getRest (head :: tail) delim = none ⊢ splitOnListAux delim tail (Array.push acc head) (r ++ rest) h = r ++ splitOnListAux delim tail (Array.push acc head) 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 α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h heq₂ : getRest (head :: tail) delim = none ⊢ splitOnListAux delim tail (Array.push acc head) (r ++ rest) h = r ++ splitOnListAux delim tail (Array.push acc head) rest h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_r
[1019, 1]
[1038, 72]
case h_2 rst heq₂ => simp only have h₃: Array.push (r ++ rest) acc = r ++ (Array.push rest acc) := by simp only [Array.ext_iff, Array.push_data, Array.append_data, append_assoc] rw [h₃, ih] have h₄:= List.eq_append_of_getRest heq₂ simp only [h₄, length_append, lt_add_iff_pos_left, zero_le, ge_iff_le, nonpos_iff_eq_zero, Nat.pos_iff_ne_zero, ne_eq, length_eq_zero, h, not_false_iff]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rst : List α heq₂ : getRest (head :: tail) delim = some rst ⊢ (let_fun x := (_ : sizeOf rst < sizeOf (head :: tail)); splitOnListAux delim rst #[] (Array.push (r ++ rest) acc) h) = r ++ let_fun x := (_ : sizeOf rst < sizeOf (head :: tail)); splitOnListAux delim rst #[] (Array.push rest acc) 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 α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rst : List α heq₂ : getRest (head :: tail) delim = some rst ⊢ (let_fun x := (_ : sizeOf rst < sizeOf (head :: tail)); splitOnListAux delim rst #[] (Array.push (r ++ rest) acc) h) = r ++ let_fun x := (_ : sizeOf rst < sizeOf (head :: tail)); splitOnListAux delim rst #[] (Array.push rest acc) h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_r
[1019, 1]
[1038, 72]
simp only [length_cons, gt_iff_lt, Nat.lt_succ_self, ih]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h heq₂ : getRest (head :: tail) delim = none ⊢ splitOnListAux delim tail (Array.push acc head) (r ++ rest) h = r ++ splitOnListAux delim tail (Array.push acc head) 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 α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h heq₂ : getRest (head :: tail) delim = none ⊢ splitOnListAux delim tail (Array.push acc head) (r ++ rest) h = r ++ splitOnListAux delim tail (Array.push acc head) rest h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_r
[1019, 1]
[1038, 72]
simp only
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rst : List α heq₂ : getRest (head :: tail) delim = some rst ⊢ (let_fun x := (_ : sizeOf rst < sizeOf (head :: tail)); splitOnListAux delim rst #[] (Array.push (r ++ rest) acc) h) = r ++ let_fun x := (_ : sizeOf rst < sizeOf (head :: tail)); splitOnListAux delim rst #[] (Array.push rest acc) h
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rst : List α heq₂ : getRest (head :: tail) delim = some rst ⊢ splitOnListAux delim rst #[] (Array.push (r ++ rest) acc) h = r ++ splitOnListAux delim rst #[] (Array.push rest acc) h
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rst : List α heq₂ : getRest (head :: tail) delim = some rst ⊢ (let_fun x := (_ : sizeOf rst < sizeOf (head :: tail)); splitOnListAux delim rst #[] (Array.push (r ++ rest) acc) h) = r ++ let_fun x := (_ : sizeOf rst < sizeOf (head :: tail)); splitOnListAux delim rst #[] (Array.push rest acc) h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_r
[1019, 1]
[1038, 72]
have h₃: Array.push (r ++ rest) acc = r ++ (Array.push rest acc) := by simp only [Array.ext_iff, Array.push_data, Array.append_data, append_assoc]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rst : List α heq₂ : getRest (head :: tail) delim = some rst ⊢ splitOnListAux delim rst #[] (Array.push (r ++ rest) acc) h = r ++ splitOnListAux delim rst #[] (Array.push rest acc) h
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rst : List α heq₂ : getRest (head :: tail) delim = some rst h₃ : Array.push (r ++ rest) acc = r ++ Array.push rest acc ⊢ splitOnListAux delim rst #[] (Array.push (r ++ rest) acc) h = r ++ splitOnListAux delim rst #[] (Array.push rest acc) h
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rst : List α heq₂ : getRest (head :: tail) delim = some rst ⊢ splitOnListAux delim rst #[] (Array.push (r ++ rest) acc) h = r ++ splitOnListAux delim rst #[] (Array.push rest acc) h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_r
[1019, 1]
[1038, 72]
rw [h₃, ih]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rst : List α heq₂ : getRest (head :: tail) delim = some rst h₃ : Array.push (r ++ rest) acc = r ++ Array.push rest acc ⊢ splitOnListAux delim rst #[] (Array.push (r ++ rest) acc) h = r ++ splitOnListAux delim rst #[] (Array.push rest acc) h
case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rst : List α heq₂ : getRest (head :: tail) delim = some rst h₃ : Array.push (r ++ rest) acc = r ++ Array.push rest acc ⊢ length rst < 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 α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rst : List α heq₂ : getRest (head :: tail) delim = some rst h₃ : Array.push (r ++ rest) acc = r ++ Array.push rest acc ⊢ splitOnListAux delim rst #[] (Array.push (r ++ rest) acc) h = r ++ splitOnListAux delim rst #[] (Array.push rest acc) h TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_r
[1019, 1]
[1038, 72]
have h₄:= List.eq_append_of_getRest heq₂
case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rst : List α heq₂ : getRest (head :: tail) delim = some rst h₃ : Array.push (r ++ rest) acc = r ++ Array.push rest acc ⊢ length rst < length (head :: tail)
case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rst : List α heq₂ : getRest (head :: tail) delim = some rst h₃ : Array.push (r ++ rest) acc = r ++ Array.push rest acc h₄ : head :: tail = delim ++ rst ⊢ length rst < 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 α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rst : List α heq₂ : getRest (head :: tail) delim = some rst h₃ : Array.push (r ++ rest) acc = r ++ Array.push rest acc ⊢ length rst < length (head :: tail) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_r
[1019, 1]
[1038, 72]
simp only [h₄, length_append, lt_add_iff_pos_left, zero_le, ge_iff_le, nonpos_iff_eq_zero, Nat.pos_iff_ne_zero, ne_eq, length_eq_zero, h, not_false_iff]
case a α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rst : List α heq₂ : getRest (head :: tail) delim = some rst h₃ : Array.push (r ++ rest) acc = r ++ Array.push rest acc h₄ : head :: tail = delim ++ rst ⊢ length rst < 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 α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rst : List α heq₂ : getRest (head :: tail) delim = some rst h₃ : Array.push (r ++ rest) acc = r ++ Array.push rest acc h₄ : head :: tail = delim ++ rst ⊢ length rst < length (head :: tail) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.splitOnListAux_r
[1019, 1]
[1038, 72]
simp only [Array.ext_iff, Array.push_data, Array.append_data, append_assoc]
α : Type u_1 inst✝ : DecidableEq α delim : List α h : delim ≠ [] acc : Array α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rst : List α heq₂ : getRest (head :: tail) delim = some rst ⊢ Array.push (r ++ rest) acc = r ++ Array.push rest 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 α r rest : Array (Array α) head : α tail : List α ih : ∀ (l₂ : List α), length l₂ < length (head :: tail) → ∀ {acc : Array α} {r rest : Array (Array α)}, splitOnListAux delim l₂ acc (r ++ rest) h = r ++ splitOnListAux delim l₂ acc rest h rst : List α heq₂ : getRest (head :: tail) delim = some rst ⊢ Array.push (r ++ rest) acc = r ++ Array.push rest acc TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.modifyHead_data
[1040, 1]
[1064, 49]
unfold modifyHead modify modifyM Id.run
α : Type u_1 f : α → α a : Array α ⊢ (modifyHead f a).data = List.modifyHead f a.data
α : Type u_1 f : α → α a : Array α ⊢ (if h : 0 < size a then let idx := { val := 0, isLt := h }; let v := get a idx; do let v ← f v pure (set a idx v) else 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 α ⊢ (modifyHead f 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]
split
α : Type u_1 f : α → α a : Array α ⊢ (if h : 0 < size a then let idx := { val := 0, isLt := h }; let v := get a idx; do let v ← f v pure (set a idx v) else pure a).data = List.modifyHead f a.data
case inl α : Type u_1 f : α → α a : Array α h✝ : 0 < size a ⊢ (let idx := { val := 0, isLt := h✝ }; let v := get a idx; do let v ← f v pure (set a idx v)).data = List.modifyHead f a.data case inr α : Type u_1 f : α → α a : Array α h✝ : ¬0 < size a ⊢ (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 α ⊢ (if h : 0 < size a then let idx := { val := 0, isLt := h }; let v := get a idx; do let v ← f v pure (set a idx v) else pure a).data = List.modifyHead f a.data TACTIC: