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 | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | conv => left; rw [List.splitOnListAux_acc] | α : 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₂ | α : 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
⊢ Array.modifyHead (Array.append (Array.push #[] head))
(splitOnListAux delim (List.append (List.append tail delim) rest) #[] #[] 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 ≠ []
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₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | simp only [List.append_eq, append_assoc] | α : 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
⊢ Array.modifyHead (Array.append (Array.push #[] head))
(splitOnListAux delim (List.append (List.append tail delim) rest) #[] #[] 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
⊢ Array.modifyHead (Array.append (Array.push #[] head)) (splitOnListAux delim (tail ++ (delim ++ rest)) #[] #[] 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 ≠ []
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
⊢ Array.modifyHead (Array.append (Array.push #[] head))
(splitOnListAux delim (List.append (List.append 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] | simp only [append_assoc] at ih | α : 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
⊢ Array.modifyHead (Array.append (Array.push #[] head)) (splitOnListAux delim (tail ++ (delim ++ rest)) #[] #[] h₂) =
#[toArray (head :: tail)] ++ splitOnListAux delim rest #[] #[] h₂ | α : Type u_1
inst✝ : DecidableEq α
delim rest : List α
h₂ : delim ≠ []
tail : List α
head : α
h₁ : ¬delim <:+: head :: tail ++ dropLast delim
heq₂ : getRest (head :: tail ++ delim ++ rest) delim = none
ih :
¬delim <:+: tail ++ dropLast delim →
splitOnListAux delim (tail ++ (delim ++ rest)) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂
⊢ Array.modifyHead (Array.append (Array.push #[] head)) (splitOnListAux delim (tail ++ (delim ++ rest)) #[] #[] 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 ≠ []
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
⊢ Array.modifyHead (Array.append (Array.push #[] head)) (splitOnListAux delim (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] | rw [ih] | α : Type u_1
inst✝ : DecidableEq α
delim rest : List α
h₂ : delim ≠ []
tail : List α
head : α
h₁ : ¬delim <:+: head :: tail ++ dropLast delim
heq₂ : getRest (head :: tail ++ delim ++ rest) delim = none
ih :
¬delim <:+: tail ++ dropLast delim →
splitOnListAux delim (tail ++ (delim ++ rest)) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂
⊢ Array.modifyHead (Array.append (Array.push #[] head)) (splitOnListAux delim (tail ++ (delim ++ rest)) #[] #[] h₂) =
#[toArray (head :: tail)] ++ splitOnListAux delim rest #[] #[] h₂ | α : Type u_1
inst✝ : DecidableEq α
delim rest : List α
h₂ : delim ≠ []
tail : List α
head : α
h₁ : ¬delim <:+: head :: tail ++ dropLast delim
heq₂ : getRest (head :: tail ++ delim ++ rest) delim = none
ih :
¬delim <:+: tail ++ dropLast delim →
splitOnListAux delim (tail ++ (delim ++ rest)) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂
⊢ Array.modifyHead (Array.append (Array.push #[] head)) (#[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂) =
#[toArray (head :: tail)] ++ splitOnListAux delim rest #[] #[] h₂
α : Type u_1
inst✝ : DecidableEq α
delim rest : List α
h₂ : delim ≠ []
tail : List α
head : α
h₁ : ¬delim <:+: head :: tail ++ dropLast delim
heq₂ : getRest (head :: tail ++ delim ++ rest) delim = none
ih :
¬delim <:+: tail ++ dropLast delim →
splitOnListAux delim (tail ++ (delim ++ rest)) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂
⊢ ¬delim <:+: tail ++ dropLast delim | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝ : DecidableEq α
delim rest : List α
h₂ : delim ≠ []
tail : List α
head : α
h₁ : ¬delim <:+: head :: tail ++ dropLast delim
heq₂ : getRest (head :: tail ++ delim ++ rest) delim = none
ih :
¬delim <:+: tail ++ dropLast delim →
splitOnListAux delim (tail ++ (delim ++ rest)) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂
⊢ Array.modifyHead (Array.append (Array.push #[] head)) (splitOnListAux delim (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] | . 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] | α : Type u_1
inst✝ : DecidableEq α
delim rest : List α
h₂ : delim ≠ []
tail : List α
head : α
h₁ : ¬delim <:+: head :: tail ++ dropLast delim
heq₂ : getRest (head :: tail ++ delim ++ rest) delim = none
ih :
¬delim <:+: tail ++ dropLast delim →
splitOnListAux delim (tail ++ (delim ++ rest)) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂
⊢ Array.modifyHead (Array.append (Array.push #[] head)) (#[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂) =
#[toArray (head :: tail)] ++ splitOnListAux delim rest #[] #[] h₂
α : Type u_1
inst✝ : DecidableEq α
delim rest : List α
h₂ : delim ≠ []
tail : List α
head : α
h₁ : ¬delim <:+: head :: tail ++ dropLast delim
heq₂ : getRest (head :: tail ++ delim ++ rest) delim = none
ih :
¬delim <:+: tail ++ dropLast delim →
splitOnListAux delim (tail ++ (delim ++ rest)) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂
⊢ ¬delim <:+: tail ++ dropLast delim | α : Type u_1
inst✝ : DecidableEq α
delim rest : List α
h₂ : delim ≠ []
tail : List α
head : α
h₁ : ¬delim <:+: head :: tail ++ dropLast delim
heq₂ : getRest (head :: tail ++ delim ++ rest) delim = none
ih :
¬delim <:+: tail ++ dropLast delim →
splitOnListAux delim (tail ++ (delim ++ rest)) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂
⊢ ¬delim <:+: tail ++ dropLast delim | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝ : DecidableEq α
delim rest : List α
h₂ : delim ≠ []
tail : List α
head : α
h₁ : ¬delim <:+: head :: tail ++ dropLast delim
heq₂ : getRest (head :: tail ++ delim ++ rest) delim = none
ih :
¬delim <:+: tail ++ dropLast delim →
splitOnListAux delim (tail ++ (delim ++ rest)) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂
⊢ Array.modifyHead (Array.append (Array.push #[] head)) (#[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂) =
#[toArray (head :: tail)] ++ splitOnListAux delim rest #[] #[] h₂
α : Type u_1
inst✝ : DecidableEq α
delim rest : List α
h₂ : delim ≠ []
tail : List α
head : α
h₁ : ¬delim <:+: head :: tail ++ dropLast delim
heq₂ : getRest (head :: tail ++ delim ++ rest) delim = none
ih :
¬delim <:+: tail ++ dropLast delim →
splitOnListAux delim (tail ++ (delim ++ rest)) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂
⊢ ¬delim <:+: tail ++ dropLast delim
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | . intro h
apply h₁
simp only [cons_append, h, isInfix_cons] | α : Type u_1
inst✝ : DecidableEq α
delim rest : List α
h₂ : delim ≠ []
tail : List α
head : α
h₁ : ¬delim <:+: head :: tail ++ dropLast delim
heq₂ : getRest (head :: tail ++ delim ++ rest) delim = none
ih :
¬delim <:+: tail ++ dropLast delim →
splitOnListAux delim (tail ++ (delim ++ rest)) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂
⊢ ¬delim <:+: tail ++ dropLast delim | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝ : DecidableEq α
delim rest : List α
h₂ : delim ≠ []
tail : List α
head : α
h₁ : ¬delim <:+: head :: tail ++ dropLast delim
heq₂ : getRest (head :: tail ++ delim ++ rest) delim = none
ih :
¬delim <:+: tail ++ dropLast delim →
splitOnListAux delim (tail ++ (delim ++ rest)) #[] #[] h₂ = #[toArray tail] ++ splitOnListAux delim rest #[] #[] h₂
⊢ ¬delim <:+: tail ++ dropLast delim
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | exfalso | α : 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₂ | case h
α : 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₂
⊢ False | 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] | apply h₁ | case h
α : 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₂
⊢ False | case h
α : 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₂
⊢ delim <:+: hd :: tl ++ dropLast delim | Please generate a tactic in lean4 to solve the state.
STATE:
case h
α : 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₂
⊢ False
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | apply List.isInfix_of_isPrefix | case h
α : 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₂
⊢ delim <:+: hd :: tl ++ dropLast delim | case h.h
α : 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₂
⊢ delim <+: hd :: tl ++ dropLast delim | Please generate a tactic in lean4 to solve the state.
STATE:
case h
α : 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₂
⊢ delim <:+: hd :: tl ++ dropLast delim
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | have h₃ := congr_arg (List.take (List.length delim)) (List.eq_append_of_getRest heq₂) | case h.h
α : 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₂
⊢ delim <+: hd :: tl ++ dropLast delim | case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ delim <+: hd :: tl ++ dropLast delim | Please generate a tactic in lean4 to solve the state.
STATE:
case h.h
α : 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₂
⊢ delim <+: hd :: tl ++ dropLast delim
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | rw [List.take_append_of_le_length] at h₃ | case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ delim <+: hd :: tl ++ dropLast delim | case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim) = take (length delim) (delim ++ rest₂)
⊢ delim <+: hd :: tl ++ dropLast delim
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim) | Please generate a tactic in lean4 to solve the state.
STATE:
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ delim <+: hd :: tl ++ dropLast delim
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | simp at h₃ | case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim) = take (length delim) (delim ++ rest₂)
⊢ delim <+: hd :: tl ++ dropLast delim
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim) | case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ delim <+: hd :: tl ++ dropLast delim
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim) | Please generate a tactic in lean4 to solve the state.
STATE:
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim) = take (length delim) (delim ++ rest₂)
⊢ delim <+: hd :: tl ++ dropLast delim
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | conv => left; rw [← h₃] | case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ delim <+: hd :: tl ++ dropLast delim
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim) | case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: (tl ++ delim)) <+: hd :: tl ++ dropLast delim
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim) | Please generate a tactic in lean4 to solve the state.
STATE:
case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ delim <+: hd :: tl ++ dropLast delim
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | simp only [length_take, length_cons, length_append, min_le_iff, ge_iff_le, cons_append] | case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: (tl ++ delim)) <+: hd :: tl ++ dropLast delim
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim) | case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: (tl ++ delim)) <+: hd :: (tl ++ dropLast delim)
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim) | Please generate a tactic in lean4 to solve the state.
STATE:
case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: (tl ++ delim)) <+: hd :: tl ++ dropLast delim
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | apply List.isPrefix_take.1 | case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: (tl ++ delim)) <+: hd :: (tl ++ dropLast delim)
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim) | case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: (tl ++ delim)) <+:
take (length (take (length delim) (hd :: (tl ++ delim)))) (hd :: (tl ++ dropLast delim))
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim) | Please generate a tactic in lean4 to solve the state.
STATE:
case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: (tl ++ delim)) <+: hd :: (tl ++ dropLast delim)
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | simp only [length_take, length_cons, length_append, min_le_iff, ge_iff_le] | case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: (tl ++ delim)) <+:
take (length (take (length delim) (hd :: (tl ++ delim)))) (hd :: (tl ++ dropLast delim))
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim) | case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: (tl ++ delim)) <+:
take (min (length delim) (Nat.succ (length tl + length delim))) (hd :: (tl ++ dropLast delim))
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim) | Please generate a tactic in lean4 to solve the state.
STATE:
case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: (tl ++ delim)) <+:
take (length (take (length delim) (hd :: (tl ++ delim)))) (hd :: (tl ++ dropLast delim))
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | rw [min_eq_left] | case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: (tl ++ delim)) <+:
take (min (length delim) (Nat.succ (length tl + length delim))) (hd :: (tl ++ dropLast delim))
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim) | case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: (tl ++ delim)) <+: take (length delim) (hd :: (tl ++ dropLast delim))
case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ length delim ≤ Nat.succ (length tl + length delim)
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim) | Please generate a tactic in lean4 to solve the state.
STATE:
case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: (tl ++ delim)) <+:
take (min (length delim) (Nat.succ (length tl + length delim))) (hd :: (tl ++ dropLast delim))
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | . 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] | case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: (tl ++ delim)) <+: take (length delim) (hd :: (tl ++ dropLast delim))
case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ length delim ≤ Nat.succ (length tl + length delim)
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim) | case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ length delim ≤ Nat.succ (length tl + length delim)
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim) | Please generate a tactic in lean4 to solve the state.
STATE:
case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: (tl ++ delim)) <+: take (length delim) (hd :: (tl ++ dropLast delim))
case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ length delim ≤ Nat.succ (length tl + length delim)
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | . 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] | case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ length delim ≤ Nat.succ (length tl + length delim)
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim) | case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim) | Please generate a tactic in lean4 to solve the state.
STATE:
case h.h
α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ length delim ≤ Nat.succ (length tl + length delim)
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | . 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] | case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case h.h
α : 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₂
h₃ : take (length delim) (hd :: tl ++ delim ++ rest) = take (length delim) (delim ++ rest₂)
⊢ length delim ≤ length (hd :: tl ++ delim)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | rw [← List.cons_append, ← List.cons_append,
List.take_append_eq_append_take, List.take_append_eq_append_take] | α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: (tl ++ delim)) = take (length delim) (hd :: (tl ++ dropLast delim)) | α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: tl) ++ take (length delim - length (hd :: tl)) delim =
take (length delim) (hd :: tl) ++ take (length delim - length (hd :: tl)) (dropLast delim) | 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: (tl ++ delim)) = take (length delim) (hd :: (tl ++ dropLast delim))
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | rw [List.dropLast_eq_take, List.take_take, min_eq_left] | α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: tl) ++ take (length delim - length (hd :: tl)) delim =
take (length delim) (hd :: tl) ++ take (length delim - length (hd :: tl)) (dropLast delim) | α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ length delim - length (hd :: tl) ≤ Nat.pred (length delim) | 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ take (length delim) (hd :: tl) ++ take (length delim - length (hd :: tl)) delim =
take (length delim) (hd :: tl) ++ take (length delim - length (hd :: tl)) (dropLast delim)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | simp only [length_cons, tsub_le_iff_right, ge_iff_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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ length delim - length (hd :: tl) ≤ Nat.pred (length delim) | α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ length delim ≤ Nat.pred (length delim) + Nat.succ (length tl) | 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ length delim - length (hd :: tl) ≤ Nat.pred (length delim)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | 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] | α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ length delim ≤ Nat.pred (length delim) + Nat.succ (length tl) | 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ length delim ≤ Nat.pred (length delim) + Nat.succ (length tl)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | simp only [Nat.pred_eq_sub_one, tsub_le_iff_right, ge_iff_le, le_refl, Nat.le_add_of_sub_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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ length delim ≤ Nat.pred (length delim) + 1 | 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ length delim ≤ Nat.pred (length delim) + 1
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnListAux_progress | [1180, 1] | [1229, 51] | 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] | α : 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ Nat.pred (length delim) + 1 ≤ Nat.pred (length delim) + Nat.succ (length tl) | 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₂
h₃ : take (length delim) (hd :: (tl ++ delim)) = delim
⊢ Nat.pred (length delim) + 1 ≤ Nat.pred (length delim) + Nat.succ (length tl)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_progress | [1231, 1] | [1242, 13] | unfold splitOnList | α : Type u_1
inst✝ : DecidableEq α
delim front rest : List α
h₁ : ¬delim <:+: front ++ dropLast delim
⊢ splitOnList delim (front ++ delim ++ rest) = [front] ++ splitOnList delim rest | α : Type u_1
inst✝ : DecidableEq α
delim front rest : List α
h₁ : ¬delim <:+: front ++ dropLast delim
⊢ (match delim with
| [] => [front ++ delim ++ rest]
| head :: tail =>
Array.toList
(Array.map Array.toList
(splitOnListAux (head :: tail) (front ++ delim ++ rest) #[] #[] (_ : ¬head :: tail = [])))) =
[front] ++
match delim with
| [] => [rest]
| head :: tail =>
Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = []))) | 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
⊢ splitOnList delim (front ++ delim ++ rest) = [front] ++ splitOnList delim rest
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_progress | [1231, 1] | [1242, 13] | cases delim with
| nil =>
simp only [dropLast, append_nil, nil_isInfix, not_true] at h₁
| cons head tail=>
simp only
rw [List.splitOnListAux_progress]
simp only [Array.toList_eq, Array.map_data, Array.append_data, Array.data_toArray, singleton_append]
simp only [map, Array.toList_eq, Array.data_toArray]
exact h₁ | α : Type u_1
inst✝ : DecidableEq α
delim front rest : List α
h₁ : ¬delim <:+: front ++ dropLast delim
⊢ (match delim with
| [] => [front ++ delim ++ rest]
| head :: tail =>
Array.toList
(Array.map Array.toList
(splitOnListAux (head :: tail) (front ++ delim ++ rest) #[] #[] (_ : ¬head :: tail = [])))) =
[front] ++
match delim with
| [] => [rest]
| head :: tail =>
Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = []))) | 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
⊢ (match delim with
| [] => [front ++ delim ++ rest]
| head :: tail =>
Array.toList
(Array.map Array.toList
(splitOnListAux (head :: tail) (front ++ delim ++ rest) #[] #[] (_ : ¬head :: tail = [])))) =
[front] ++
match delim with
| [] => [rest]
| head :: tail =>
Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = [])))
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_progress | [1231, 1] | [1242, 13] | simp only [dropLast, append_nil, nil_isInfix, not_true] at h₁ | case nil
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
h₁ : ¬[] <:+: front ++ dropLast []
⊢ (match [] with
| [] => [front ++ [] ++ rest]
| head :: tail =>
Array.toList
(Array.map Array.toList
(splitOnListAux (head :: tail) (front ++ [] ++ rest) #[] #[] (_ : ¬head :: tail = [])))) =
[front] ++
match [] with
| [] => [rest]
| head :: tail =>
Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = []))) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case nil
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
h₁ : ¬[] <:+: front ++ dropLast []
⊢ (match [] with
| [] => [front ++ [] ++ rest]
| head :: tail =>
Array.toList
(Array.map Array.toList
(splitOnListAux (head :: tail) (front ++ [] ++ rest) #[] #[] (_ : ¬head :: tail = [])))) =
[front] ++
match [] with
| [] => [rest]
| head :: tail =>
Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = [])))
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_progress | [1231, 1] | [1242, 13] | simp only | case cons
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ (match head :: tail with
| [] => [front ++ head :: tail ++ rest]
| head_1 :: tail_1 =>
Array.toList
(Array.map Array.toList
(splitOnListAux (head_1 :: tail_1) (front ++ head :: tail ++ rest) #[] #[] (_ : ¬head_1 :: tail_1 = [])))) =
[front] ++
match head :: tail with
| [] => [rest]
| head :: tail =>
Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = []))) | case cons
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ Array.toList
(Array.map Array.toList
(splitOnListAux (head :: tail) (front ++ head :: tail ++ rest) #[] #[] (_ : ¬head :: tail = []))) =
[front] ++
Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = []))) | Please generate a tactic in lean4 to solve the state.
STATE:
case cons
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ (match head :: tail with
| [] => [front ++ head :: tail ++ rest]
| head_1 :: tail_1 =>
Array.toList
(Array.map Array.toList
(splitOnListAux (head_1 :: tail_1) (front ++ head :: tail ++ rest) #[] #[] (_ : ¬head_1 :: tail_1 = [])))) =
[front] ++
match head :: tail with
| [] => [rest]
| head :: tail =>
Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = [])))
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_progress | [1231, 1] | [1242, 13] | rw [List.splitOnListAux_progress] | case cons
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ Array.toList
(Array.map Array.toList
(splitOnListAux (head :: tail) (front ++ head :: tail ++ rest) #[] #[] (_ : ¬head :: tail = []))) =
[front] ++
Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = []))) | case cons
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ Array.toList
(Array.map Array.toList
(#[toArray front] ++ splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = []))) =
[front] ++
Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = [])))
case cons.h₁
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ ¬head :: tail <:+: front ++ dropLast (head :: tail) | Please generate a tactic in lean4 to solve the state.
STATE:
case cons
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ Array.toList
(Array.map Array.toList
(splitOnListAux (head :: tail) (front ++ head :: tail ++ rest) #[] #[] (_ : ¬head :: tail = []))) =
[front] ++
Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = [])))
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_progress | [1231, 1] | [1242, 13] | simp only [Array.toList_eq, Array.map_data, Array.append_data, Array.data_toArray, singleton_append] | case cons
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ Array.toList
(Array.map Array.toList
(#[toArray front] ++ splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = []))) =
[front] ++
Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = [])))
case cons.h₁
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ ¬head :: tail <:+: front ++ dropLast (head :: tail) | case cons
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ map Array.toList (toArray front :: (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = [])).data) =
front :: map Array.toList (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = [])).data
case cons.h₁
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ ¬head :: tail <:+: front ++ dropLast (head :: tail) | Please generate a tactic in lean4 to solve the state.
STATE:
case cons
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ Array.toList
(Array.map Array.toList
(#[toArray front] ++ splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = []))) =
[front] ++
Array.toList (Array.map Array.toList (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = [])))
case cons.h₁
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ ¬head :: tail <:+: front ++ dropLast (head :: tail)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_progress | [1231, 1] | [1242, 13] | simp only [map, Array.toList_eq, Array.data_toArray] | case cons
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ map Array.toList (toArray front :: (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = [])).data) =
front :: map Array.toList (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = [])).data
case cons.h₁
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ ¬head :: tail <:+: front ++ dropLast (head :: tail) | case cons.h₁
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ ¬head :: tail <:+: front ++ dropLast (head :: tail) | Please generate a tactic in lean4 to solve the state.
STATE:
case cons
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ map Array.toList (toArray front :: (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = [])).data) =
front :: map Array.toList (splitOnListAux (head :: tail) rest #[] #[] (_ : ¬head :: tail = [])).data
case cons.h₁
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ ¬head :: tail <:+: front ++ dropLast (head :: tail)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_progress | [1231, 1] | [1242, 13] | exact h₁ | case cons.h₁
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ ¬head :: tail <:+: front ++ dropLast (head :: tail) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case cons.h₁
α : Type u_1
inst✝ : DecidableEq α
front rest : List α
head : α
tail : List α
h₁ : ¬head :: tail <:+: front ++ dropLast (head :: tail)
⊢ ¬head :: tail <:+: front ++ dropLast (head :: tail)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.join_intersperse_nil | [1244, 1] | [1250, 60] | match l with
| [] => simp only [join]
| [a] => simp only [join, append_nil]
| a :: b :: tail =>
simp only [join, List.join_intersperse_nil, nil_append] | α : Type u_1
l : List (List α)
⊢ join (intersperse [] l) = join l | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
l : List (List α)
⊢ join (intersperse [] l) = join l
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.join_intersperse_nil | [1244, 1] | [1250, 60] | simp only [join] | α : Type u_1
l : List (List α)
⊢ join (intersperse [] []) = join [] | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
l : List (List α)
⊢ join (intersperse [] []) = join []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.join_intersperse_nil | [1244, 1] | [1250, 60] | simp only [join, append_nil] | α : Type u_1
l : List (List α)
a : List α
⊢ join (intersperse [] [a]) = join [a] | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
l : List (List α)
a : List α
⊢ join (intersperse [] [a]) = join [a]
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.join_intersperse_nil | [1244, 1] | [1250, 60] | simp only [join, List.join_intersperse_nil, nil_append] | α : Type u_1
l : List (List α)
a b : List α
tail : List (List α)
⊢ join (intersperse [] (a :: b :: tail)) = join (a :: b :: tail) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
l : List (List α)
a b : List α
tail : List (List α)
⊢ join (intersperse [] (a :: b :: tail)) = join (a :: b :: tail)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Array.modify_data | [1254, 1] | [1264, 35] | unfold modify Id.run modifyM | α : Type u_1
a : Array α
i : ℕ
f : α → α
⊢ (modify a i f).data = List.modifyNth f i a.data | α : Type u_1
a : Array α
i : ℕ
f : α → α
⊢ (if h : i < size a then
let idx := { val := i, isLt := h };
let v := get a idx;
do
let v ← f v
pure (set a idx v)
else pure a).data =
List.modifyNth f i a.data | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
a : Array α
i : ℕ
f : α → α
⊢ (modify a i f).data = List.modifyNth f i a.data
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Array.modify_data | [1254, 1] | [1264, 35] | split | α : Type u_1
a : Array α
i : ℕ
f : α → α
⊢ (if h : i < size a then
let idx := { val := i, isLt := h };
let v := get a idx;
do
let v ← f v
pure (set a idx v)
else pure a).data =
List.modifyNth f i a.data | case inl
α : Type u_1
a : Array α
i : ℕ
f : α → α
h✝ : i < size a
⊢ (let idx := { val := i, isLt := h✝ };
let v := get a idx;
do
let v ← f v
pure (set a idx v)).data =
List.modifyNth f i a.data
case inr
α : Type u_1
a : Array α
i : ℕ
f : α → α
h✝ : ¬i < size a
⊢ (pure a).data = List.modifyNth f i a.data | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
a : Array α
i : ℕ
f : α → α
⊢ (if h : i < size a then
let idx := { val := i, isLt := h };
let v := get a idx;
do
let v ← f v
pure (set a idx v)
else pure a).data =
List.modifyNth f i a.data
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Array.modify_data | [1254, 1] | [1264, 35] | . simp
rw [List.modifyNth_eq_set_get]
congr 1 | case inl
α : Type u_1
a : Array α
i : ℕ
f : α → α
h✝ : i < size a
⊢ (let idx := { val := i, isLt := h✝ };
let v := get a idx;
do
let v ← f v
pure (set a idx v)).data =
List.modifyNth f i a.data
case inr
α : Type u_1
a : Array α
i : ℕ
f : α → α
h✝ : ¬i < size a
⊢ (pure a).data = List.modifyNth f i a.data | case inr
α : Type u_1
a : Array α
i : ℕ
f : α → α
h✝ : ¬i < size a
⊢ (pure a).data = List.modifyNth f i a.data | Please generate a tactic in lean4 to solve the state.
STATE:
case inl
α : Type u_1
a : Array α
i : ℕ
f : α → α
h✝ : i < size a
⊢ (let idx := { val := i, isLt := h✝ };
let v := get a idx;
do
let v ← f v
pure (set a idx v)).data =
List.modifyNth f i a.data
case inr
α : Type u_1
a : Array α
i : ℕ
f : α → α
h✝ : ¬i < size a
⊢ (pure a).data = List.modifyNth f i a.data
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Array.modify_data | [1254, 1] | [1264, 35] | case inr heq =>
simp at heq
rw [List.modifyNth_eq_set_get?]
simp [List.get?_eq_none.2 heq] | α : Type u_1
a : Array α
i : ℕ
f : α → α
heq : ¬i < size a
⊢ (pure a).data = List.modifyNth f i a.data | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
a : Array α
i : ℕ
f : α → α
heq : ¬i < size a
⊢ (pure a).data = List.modifyNth f i a.data
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Array.modify_data | [1254, 1] | [1264, 35] | simp at heq | α : Type u_1
a : Array α
i : ℕ
f : α → α
heq : ¬i < size a
⊢ (pure a).data = List.modifyNth f i a.data | α : Type u_1
a : Array α
i : ℕ
f : α → α
heq : size a ≤ i
⊢ (pure a).data = List.modifyNth f i a.data | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
a : Array α
i : ℕ
f : α → α
heq : ¬i < size a
⊢ (pure a).data = List.modifyNth f i a.data
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Array.modify_data | [1254, 1] | [1264, 35] | rw [List.modifyNth_eq_set_get?] | α : Type u_1
a : Array α
i : ℕ
f : α → α
heq : size a ≤ i
⊢ (pure a).data = List.modifyNth f i a.data | α : Type u_1
a : Array α
i : ℕ
f : α → α
heq : size a ≤ i
⊢ (pure a).data = Option.getD ((fun a_1 => List.set a.data i (f a_1)) <$> List.get? a.data i) a.data | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
a : Array α
i : ℕ
f : α → α
heq : size a ≤ i
⊢ (pure a).data = List.modifyNth f i a.data
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Array.modify_data | [1254, 1] | [1264, 35] | simp [List.get?_eq_none.2 heq] | α : Type u_1
a : Array α
i : ℕ
f : α → α
heq : size a ≤ i
⊢ (pure a).data = Option.getD ((fun a_1 => List.set a.data i (f a_1)) <$> List.get? a.data i) a.data | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
a : Array α
i : ℕ
f : α → α
heq : size a ≤ i
⊢ (pure a).data = Option.getD ((fun a_1 => List.set a.data i (f a_1)) <$> List.get? a.data i) a.data
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyLast_nil | [1266, 1] | [1269, 12] | unfold modifyLast modifyLast.go | α✝ : Type u_1
f : α✝ → α✝
⊢ modifyLast f [] = [] | α✝ : Type u_1
f : α✝ → α✝
⊢ [] = [] | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
f : α✝ → α✝
⊢ modifyLast f [] = []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyLast_nil | [1266, 1] | [1269, 12] | simp only | α✝ : Type u_1
f : α✝ → α✝
⊢ [] = [] | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
f : α✝ → α✝
⊢ [] = []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyNth_nil | [1271, 1] | [1273, 31] | simp [List.modifyNth_eq_set] | α✝ : Type u_1
f : α✝ → α✝
i : ℕ
⊢ modifyNth f i [] = [] | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
f : α✝ → α✝
i : ℕ
⊢ modifyNth f i [] = []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyLast_cons | [1275, 1] | [1279, 43] | rw [← List.dropLast_append_getLast (List.cons_ne_nil head tail),← List.dropLast_append_getLast h,
List.modifyLast_append_one, List.modifyLast_append_one] | α : Type u_1
f : α → α
head : α
tail : List α
h : tail ≠ []
⊢ modifyLast f (head :: tail) = head :: modifyLast f tail | α : Type u_1
f : α → α
head : α
tail : List α
h : tail ≠ []
⊢ dropLast (head :: (dropLast tail ++ [getLast tail h])) ++
[f
(getLast (head :: (dropLast tail ++ [getLast tail h]))
(_ : head :: (dropLast tail ++ [getLast tail h]) ≠ []))] =
head :: (dropLast tail ++ [f (getLast tail h)]) | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
f : α → α
head : α
tail : List α
h : tail ≠ []
⊢ modifyLast f (head :: tail) = head :: modifyLast f tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyLast_cons | [1275, 1] | [1279, 43] | simp only [append_eq_nil, and_false, IsEmpty.forall_iff, dropLast_concat, ne_eq, not_false_iff, getLast_cons,
getLast_append, cons_append, dropLast] | α : Type u_1
f : α → α
head : α
tail : List α
h : tail ≠ []
⊢ dropLast (head :: (dropLast tail ++ [getLast tail h])) ++
[f
(getLast (head :: (dropLast tail ++ [getLast tail h]))
(_ : head :: (dropLast tail ++ [getLast tail h]) ≠ []))] =
head :: (dropLast tail ++ [f (getLast tail h)]) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
f : α → α
head : α
tail : List α
h : tail ≠ []
⊢ dropLast (head :: (dropLast tail ++ [getLast tail h])) ++
[f
(getLast (head :: (dropLast tail ++ [getLast tail h]))
(_ : head :: (dropLast tail ++ [getLast tail h]) ≠ []))] =
head :: (dropLast tail ++ [f (getLast tail h)])
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyLast_eq_modifyNth | [1281, 1] | [1299, 35] | cases l with
| nil => simp only [modifyLast_nil, length_nil, zero_le, ge_iff_le, nonpos_iff_eq_zero, Nat.zero_sub, tsub_eq_zero_of_le, modifyNth_nil]
| cons head tail =>
rw [← List.dropLast_append_getLast (List.cons_ne_nil head tail)]
simp [List.modifyLast_append_one,List.modifyNth_eq_take_drop, List.take_append_eq_append_take]
rw [List.take_all_of_le, List.drop_append_eq_append_drop]
simp only [ne_eq, length_dropLast, length_cons, Nat.succ_sub_succ_eq_sub, tsub_zero, ge_iff_le, zero_le,
nonpos_iff_eq_zero, Nat.sub_self, le_refl, tsub_eq_zero_of_le,
append_cancel_left_eq, drop]
split
case h_1 heq => simp only [ne_eq, append_eq_nil, and_false] at heq
case h_2 heq =>
rw [List.drop_eq_nil_of_le] at heq
simp_all only [tsub_le_iff_right, ge_iff_le, ne_eq, nil_append, cons.injEq]
simp only [length_dropLast, length_cons, Nat.succ_sub_succ_eq_sub, tsub_zero, ge_iff_le, zero_le,
nonpos_iff_eq_zero, le_refl]
simp only [length_dropLast, length_cons, Nat.succ_sub_succ_eq_sub, tsub_zero, ge_iff_le, zero_le,
nonpos_iff_eq_zero, le_refl] | α✝ : Type u_1
f : α✝ → α✝
l : List α✝
⊢ modifyLast f l = modifyNth f (length l - 1) l | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
f : α✝ → α✝
l : List α✝
⊢ modifyLast f l = modifyNth f (length l - 1) l
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyLast_eq_modifyNth | [1281, 1] | [1299, 35] | simp only [modifyLast_nil, length_nil, zero_le, ge_iff_le, nonpos_iff_eq_zero, Nat.zero_sub, tsub_eq_zero_of_le, modifyNth_nil] | case nil
α✝ : Type u_1
f : α✝ → α✝
⊢ modifyLast f [] = modifyNth f (length [] - 1) [] | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case nil
α✝ : Type u_1
f : α✝ → α✝
⊢ modifyLast f [] = modifyNth f (length [] - 1) []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyLast_eq_modifyNth | [1281, 1] | [1299, 35] | rw [← List.dropLast_append_getLast (List.cons_ne_nil head tail)] | case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ modifyLast f (head :: tail) = modifyNth f (length (head :: tail) - 1) (head :: tail) | case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ modifyLast f (dropLast (head :: tail) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])]) =
modifyNth f (length (dropLast (head :: tail) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])]) - 1)
(dropLast (head :: tail) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])]) | Please generate a tactic in lean4 to solve the state.
STATE:
case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ modifyLast f (head :: tail) = modifyNth f (length (head :: tail) - 1) (head :: tail)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyLast_eq_modifyNth | [1281, 1] | [1299, 35] | simp [List.modifyLast_append_one,List.modifyNth_eq_take_drop, List.take_append_eq_append_take] | case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ modifyLast f (dropLast (head :: tail) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])]) =
modifyNth f (length (dropLast (head :: tail) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])]) - 1)
(dropLast (head :: tail) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])]) | case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ dropLast (head :: tail) ++ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] =
take (length tail) (dropLast (head :: tail)) ++
match drop (length tail) (dropLast (head :: tail) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])]) with
| [] => []
| a :: l => f a :: l | Please generate a tactic in lean4 to solve the state.
STATE:
case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ modifyLast f (dropLast (head :: tail) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])]) =
modifyNth f (length (dropLast (head :: tail) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])]) - 1)
(dropLast (head :: tail) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])])
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyLast_eq_modifyNth | [1281, 1] | [1299, 35] | rw [List.take_all_of_le, List.drop_append_eq_append_drop] | case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ dropLast (head :: tail) ++ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] =
take (length tail) (dropLast (head :: tail)) ++
match drop (length tail) (dropLast (head :: tail) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])]) with
| [] => []
| a :: l => f a :: l | case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ dropLast (head :: tail) ++ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] =
dropLast (head :: tail) ++
match
drop (length tail) (dropLast (head :: tail)) ++
drop (length tail - length (dropLast (head :: tail))) [getLast (head :: tail) (_ : head :: tail ≠ [])] with
| [] => []
| a :: l => f a :: l
case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ length (dropLast (head :: tail)) ≤ length tail | Please generate a tactic in lean4 to solve the state.
STATE:
case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ dropLast (head :: tail) ++ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] =
take (length tail) (dropLast (head :: tail)) ++
match drop (length tail) (dropLast (head :: tail) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])]) with
| [] => []
| a :: l => f a :: l
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyLast_eq_modifyNth | [1281, 1] | [1299, 35] | simp only [ne_eq, length_dropLast, length_cons, Nat.succ_sub_succ_eq_sub, tsub_zero, ge_iff_le, zero_le,
nonpos_iff_eq_zero, Nat.sub_self, le_refl, tsub_eq_zero_of_le,
append_cancel_left_eq, drop] | case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ dropLast (head :: tail) ++ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] =
dropLast (head :: tail) ++
match
drop (length tail) (dropLast (head :: tail)) ++
drop (length tail - length (dropLast (head :: tail))) [getLast (head :: tail) (_ : head :: tail ≠ [])] with
| [] => []
| a :: l => f a :: l
case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ length (dropLast (head :: tail)) ≤ length tail | case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] =
match drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] with
| [] => []
| a :: l => f a :: l
case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ length (dropLast (head :: tail)) ≤ length tail | Please generate a tactic in lean4 to solve the state.
STATE:
case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ dropLast (head :: tail) ++ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] =
dropLast (head :: tail) ++
match
drop (length tail) (dropLast (head :: tail)) ++
drop (length tail - length (dropLast (head :: tail))) [getLast (head :: tail) (_ : head :: tail ≠ [])] with
| [] => []
| a :: l => f a :: l
case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ length (dropLast (head :: tail)) ≤ length tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyLast_eq_modifyNth | [1281, 1] | [1299, 35] | split | case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] =
match drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] with
| [] => []
| a :: l => f a :: l
case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ length (dropLast (head :: tail)) ≤ length tail | case cons.h_1
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝ : List α✝
heq✝ : drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = []
⊢ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] = []
case cons.h_2
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝¹ : List α✝
x✝ : α✝
xs✝ : List α✝
heq✝ : drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = x✝ :: xs✝
⊢ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] = f x✝ :: xs✝
case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ length (dropLast (head :: tail)) ≤ length tail | Please generate a tactic in lean4 to solve the state.
STATE:
case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] =
match drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] with
| [] => []
| a :: l => f a :: l
case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ length (dropLast (head :: tail)) ≤ length tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyLast_eq_modifyNth | [1281, 1] | [1299, 35] | case h_1 heq => simp only [ne_eq, append_eq_nil, and_false] at heq | α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝ : List α✝
heq : drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = []
⊢ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] = [] | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝ : List α✝
heq : drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = []
⊢ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] = []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyLast_eq_modifyNth | [1281, 1] | [1299, 35] | case h_2 heq =>
rw [List.drop_eq_nil_of_le] at heq
simp_all only [tsub_le_iff_right, ge_iff_le, ne_eq, nil_append, cons.injEq]
simp only [length_dropLast, length_cons, Nat.succ_sub_succ_eq_sub, tsub_zero, ge_iff_le, zero_le,
nonpos_iff_eq_zero, le_refl] | α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝¹ : List α✝
x✝ : α✝
xs✝ : List α✝
heq : drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = x✝ :: xs✝
⊢ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] = f x✝ :: xs✝ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝¹ : List α✝
x✝ : α✝
xs✝ : List α✝
heq : drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = x✝ :: xs✝
⊢ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] = f x✝ :: xs✝
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyLast_eq_modifyNth | [1281, 1] | [1299, 35] | simp only [length_dropLast, length_cons, Nat.succ_sub_succ_eq_sub, tsub_zero, ge_iff_le, zero_le,
nonpos_iff_eq_zero, le_refl] | case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ length (dropLast (head :: tail)) ≤ length tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case cons
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail : List α✝
⊢ length (dropLast (head :: tail)) ≤ length tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyLast_eq_modifyNth | [1281, 1] | [1299, 35] | simp only [ne_eq, append_eq_nil, and_false] at heq | α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝ : List α✝
heq : drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = []
⊢ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] = [] | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝ : List α✝
heq : drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = []
⊢ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] = []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyLast_eq_modifyNth | [1281, 1] | [1299, 35] | rw [List.drop_eq_nil_of_le] at heq | α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝¹ : List α✝
x✝ : α✝
xs✝ : List α✝
heq : drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = x✝ :: xs✝
⊢ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] = f x✝ :: xs✝ | α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝¹ : List α✝
x✝ : α✝
xs✝ : List α✝
heq : [] ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = x✝ :: xs✝
⊢ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] = f x✝ :: xs✝
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝¹ : List α✝
x✝ : α✝
xs✝ : List α✝
heq : drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = x✝ :: xs✝
⊢ length (dropLast (head :: tail)) ≤ length tail | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝¹ : List α✝
x✝ : α✝
xs✝ : List α✝
heq : drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = x✝ :: xs✝
⊢ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] = f x✝ :: xs✝
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyLast_eq_modifyNth | [1281, 1] | [1299, 35] | simp_all only [tsub_le_iff_right, ge_iff_le, ne_eq, nil_append, cons.injEq] | α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝¹ : List α✝
x✝ : α✝
xs✝ : List α✝
heq : [] ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = x✝ :: xs✝
⊢ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] = f x✝ :: xs✝
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝¹ : List α✝
x✝ : α✝
xs✝ : List α✝
heq : drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = x✝ :: xs✝
⊢ length (dropLast (head :: tail)) ≤ length tail | α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝¹ : List α✝
x✝ : α✝
xs✝ : List α✝
heq : drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = x✝ :: xs✝
⊢ length (dropLast (head :: tail)) ≤ length tail | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝¹ : List α✝
x✝ : α✝
xs✝ : List α✝
heq : [] ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = x✝ :: xs✝
⊢ [f (getLast (head :: tail) (_ : head :: tail ≠ []))] = f x✝ :: xs✝
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝¹ : List α✝
x✝ : α✝
xs✝ : List α✝
heq : drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = x✝ :: xs✝
⊢ length (dropLast (head :: tail)) ≤ length tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.modifyLast_eq_modifyNth | [1281, 1] | [1299, 35] | simp only [length_dropLast, length_cons, Nat.succ_sub_succ_eq_sub, tsub_zero, ge_iff_le, zero_le,
nonpos_iff_eq_zero, le_refl] | α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝¹ : List α✝
x✝ : α✝
xs✝ : List α✝
heq : drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = x✝ :: xs✝
⊢ length (dropLast (head :: tail)) ≤ length tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
f : α✝ → α✝
head : α✝
tail x✝¹ : List α✝
x✝ : α✝
xs✝ : List α✝
heq : drop (length tail) (dropLast (head :: tail)) ++ [getLast (head :: tail) (_ : head :: tail ≠ [])] = x✝ :: xs✝
⊢ length (dropLast (head :: tail)) ≤ length tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Array.modifyLast_data | [1301, 1] | [1305, 56] | unfold modifyLast | α✝ : Type u_1
f : α✝ → α✝
a : Array α✝
⊢ (modifyLast f a).data = List.modifyLast f a.data | α✝ : Type u_1
f : α✝ → α✝
a : Array α✝
⊢ (modify a (size a - 1) f).data = List.modifyLast f a.data | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
f : α✝ → α✝
a : Array α✝
⊢ (modifyLast f a).data = List.modifyLast f a.data
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Array.modifyLast_data | [1301, 1] | [1305, 56] | rw [List.modifyLast_eq_modifyNth] | α✝ : Type u_1
f : α✝ → α✝
a : Array α✝
⊢ (modify a (size a - 1) f).data = List.modifyLast f a.data | α✝ : Type u_1
f : α✝ → α✝
a : Array α✝
⊢ (modify a (size a - 1) f).data = List.modifyNth f (List.length a.data - 1) a.data | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
f : α✝ → α✝
a : Array α✝
⊢ (modify a (size a - 1) f).data = List.modifyLast f a.data
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Array.modifyLast_data | [1301, 1] | [1305, 56] | simp only [tsub_le_iff_right, ge_iff_le, modify_data] | α✝ : Type u_1
f : α✝ → α✝
a : Array α✝
⊢ (modify a (size a - 1) f).data = List.modifyNth f (List.length a.data - 1) a.data | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
f : α✝ → α✝
a : Array α✝
⊢ (modify a (size a - 1) f).data = List.modifyNth f (List.length a.data - 1) a.data
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Nat.sub_sub_eq_add_sub_of_le | [1308, 1] | [1325, 38] | induction a generalizing b c with
| zero => simp only [Nat.zero_eq, zero_le, ge_iff_le, nonpos_iff_eq_zero, tsub_le_iff_right, Nat.zero_sub,
tsub_eq_zero_of_le, zero_add, h]
| succ a ih =>
cases hle: decide (a ≥ (b-c)) with
| true =>
simp only [ decide_eq_true_eq] at hle
rw [Nat.succ_sub hle]
simp only [tsub_le_iff_right, ge_iff_le] at hle
rw [Nat.succ_add, Nat.succ_sub hle, ih h]
| false =>
simp only [ decide_eq_false_iff_not, not_le] at hle
have hle₂ := Nat.succ_le_of_lt hle
rw [Nat.sub_eq_zero_of_le hle₂]
have hle₃ := Nat.add_le_of_le_sub h hle₂
rw [Nat.sub_eq_zero_of_le hle₃] | a b c : ℕ
h : c ≤ b
⊢ a - (b - c) = a + c - b | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
a b c : ℕ
h : c ≤ b
⊢ a - (b - c) = a + c - b
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Nat.sub_sub_eq_add_sub_of_le | [1308, 1] | [1325, 38] | simp only [Nat.zero_eq, zero_le, ge_iff_le, nonpos_iff_eq_zero, tsub_le_iff_right, Nat.zero_sub,
tsub_eq_zero_of_le, zero_add, h] | case zero
b c : ℕ
h : c ≤ b
⊢ zero - (b - c) = zero + c - b | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case zero
b c : ℕ
h : c ≤ b
⊢ zero - (b - c) = zero + c - b
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Nat.sub_sub_eq_add_sub_of_le | [1308, 1] | [1325, 38] | cases hle: decide (a ≥ (b-c)) with
| true =>
simp only [ decide_eq_true_eq] at hle
rw [Nat.succ_sub hle]
simp only [tsub_le_iff_right, ge_iff_le] at hle
rw [Nat.succ_add, Nat.succ_sub hle, ih h]
| false =>
simp only [ decide_eq_false_iff_not, not_le] at hle
have hle₂ := Nat.succ_le_of_lt hle
rw [Nat.sub_eq_zero_of_le hle₂]
have hle₃ := Nat.add_le_of_le_sub h hle₂
rw [Nat.sub_eq_zero_of_le hle₃] | case succ
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
⊢ succ a - (b - c) = succ a + c - b | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case succ
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
⊢ succ a - (b - c) = succ a + c - b
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Nat.sub_sub_eq_add_sub_of_le | [1308, 1] | [1325, 38] | simp only [ decide_eq_true_eq] at hle | case succ.true
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : decide (a ≥ b - c) = true
⊢ succ a - (b - c) = succ a + c - b | case succ.true
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : a ≥ b - c
⊢ succ a - (b - c) = succ a + c - b | Please generate a tactic in lean4 to solve the state.
STATE:
case succ.true
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : decide (a ≥ b - c) = true
⊢ succ a - (b - c) = succ a + c - b
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Nat.sub_sub_eq_add_sub_of_le | [1308, 1] | [1325, 38] | rw [Nat.succ_sub hle] | case succ.true
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : a ≥ b - c
⊢ succ a - (b - c) = succ a + c - b | case succ.true
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : a ≥ b - c
⊢ succ (a - (b - c)) = succ a + c - b | Please generate a tactic in lean4 to solve the state.
STATE:
case succ.true
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : a ≥ b - c
⊢ succ a - (b - c) = succ a + c - b
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Nat.sub_sub_eq_add_sub_of_le | [1308, 1] | [1325, 38] | simp only [tsub_le_iff_right, ge_iff_le] at hle | case succ.true
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : a ≥ b - c
⊢ succ (a - (b - c)) = succ a + c - b | case succ.true
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : b ≤ a + c
⊢ succ (a - (b - c)) = succ a + c - b | Please generate a tactic in lean4 to solve the state.
STATE:
case succ.true
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : a ≥ b - c
⊢ succ (a - (b - c)) = succ a + c - b
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Nat.sub_sub_eq_add_sub_of_le | [1308, 1] | [1325, 38] | rw [Nat.succ_add, Nat.succ_sub hle, ih h] | case succ.true
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : b ≤ a + c
⊢ succ (a - (b - c)) = succ a + c - b | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case succ.true
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : b ≤ a + c
⊢ succ (a - (b - c)) = succ a + c - b
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Nat.sub_sub_eq_add_sub_of_le | [1308, 1] | [1325, 38] | simp only [ decide_eq_false_iff_not, not_le] at hle | case succ.false
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : decide (a ≥ b - c) = false
⊢ succ a - (b - c) = succ a + c - b | case succ.false
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : a < b - c
⊢ succ a - (b - c) = succ a + c - b | Please generate a tactic in lean4 to solve the state.
STATE:
case succ.false
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : decide (a ≥ b - c) = false
⊢ succ a - (b - c) = succ a + c - b
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Nat.sub_sub_eq_add_sub_of_le | [1308, 1] | [1325, 38] | have hle₂ := Nat.succ_le_of_lt hle | case succ.false
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : a < b - c
⊢ succ a - (b - c) = succ a + c - b | case succ.false
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : a < b - c
hle₂ : succ a ≤ b - c
⊢ succ a - (b - c) = succ a + c - b | Please generate a tactic in lean4 to solve the state.
STATE:
case succ.false
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : a < b - c
⊢ succ a - (b - c) = succ a + c - b
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Nat.sub_sub_eq_add_sub_of_le | [1308, 1] | [1325, 38] | rw [Nat.sub_eq_zero_of_le hle₂] | case succ.false
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : a < b - c
hle₂ : succ a ≤ b - c
⊢ succ a - (b - c) = succ a + c - b | case succ.false
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : a < b - c
hle₂ : succ a ≤ b - c
⊢ 0 = succ a + c - b | Please generate a tactic in lean4 to solve the state.
STATE:
case succ.false
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : a < b - c
hle₂ : succ a ≤ b - c
⊢ succ a - (b - c) = succ a + c - b
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Nat.sub_sub_eq_add_sub_of_le | [1308, 1] | [1325, 38] | have hle₃ := Nat.add_le_of_le_sub h hle₂ | case succ.false
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : a < b - c
hle₂ : succ a ≤ b - c
⊢ 0 = succ a + c - b | case succ.false
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : a < b - c
hle₂ : succ a ≤ b - c
hle₃ : succ a + c ≤ b
⊢ 0 = succ a + c - b | Please generate a tactic in lean4 to solve the state.
STATE:
case succ.false
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : a < b - c
hle₂ : succ a ≤ b - c
⊢ 0 = succ a + c - b
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | Nat.sub_sub_eq_add_sub_of_le | [1308, 1] | [1325, 38] | rw [Nat.sub_eq_zero_of_le hle₃] | case succ.false
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : a < b - c
hle₂ : succ a ≤ b - c
hle₃ : succ a + c ≤ b
⊢ 0 = succ a + c - b | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case succ.false
a : ℕ
ih : ∀ {b c : ℕ}, c ≤ b → a - (b - c) = a + c - b
b c : ℕ
h : c ≤ b
hle : a < b - c
hle₂ : succ a ≤ b - c
hle₃ : succ a + c ≤ b
⊢ 0 = succ a + c - b
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | apply Iff.intro | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim l : List α
⊢ isPrefixOf delim l = true ↔ delim <+: l | case mp
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim l : List α
⊢ isPrefixOf delim l = true → delim <+: l
case mpr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim l : List α
⊢ delim <+: l → isPrefixOf delim l = true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim l : List α
⊢ isPrefixOf delim l = true ↔ delim <+: l
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | . intro h
induction l generalizing delim
case nil =>
unfold isPrefixOf at h
cases delim <;> simp_all only [isPrefix_self]
case cons head tail ih =>
unfold isPrefixOf at h
cases delim
case nil => simp only [append_nil, nil_isPrefix]
case cons dhead dtail =>
simp at h
have ⟨h₂,h₃⟩ := h
have ⟨s, heq⟩ := ih dtail h₃
exists s
simp only [h₂, cons_append, heq] | case mp
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim l : List α
⊢ isPrefixOf delim l = true → delim <+: l
case mpr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim l : List α
⊢ delim <+: l → isPrefixOf delim l = true | case mpr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim l : List α
⊢ delim <+: l → isPrefixOf delim l = true | Please generate a tactic in lean4 to solve the state.
STATE:
case mp
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim l : List α
⊢ isPrefixOf delim l = true → delim <+: l
case mpr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim l : List α
⊢ delim <+: l → isPrefixOf delim l = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | . intro h
have ⟨s, heq⟩ := h
rw [← heq]
clear heq h
induction delim generalizing l
case nil =>
unfold isPrefixOf
simp only
case cons head tail ih =>
unfold isPrefixOf
simp
apply ih l | case mpr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim l : List α
⊢ delim <+: l → isPrefixOf delim l = true | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case mpr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim l : List α
⊢ delim <+: l → isPrefixOf delim l = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | unfold isPrefixOf at h | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
h : isPrefixOf delim [] = true
⊢ delim <+: [] | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
h :
(match delim, [] with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true
⊢ delim <+: [] | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
h : isPrefixOf delim [] = true
⊢ delim <+: []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | cases delim <;> simp_all only [isPrefix_self] | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
h :
(match delim, [] with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true
⊢ delim <+: [] | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
h :
(match delim, [] with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true
⊢ delim <+: []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | unfold isPrefixOf at h | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
delim : List α
h : isPrefixOf delim (head :: tail) = true
⊢ delim <+: head :: tail | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
delim : List α
h :
(match delim, head :: tail with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true
⊢ delim <+: head :: tail | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
delim : List α
h : isPrefixOf delim (head :: tail) = true
⊢ delim <+: head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | cases delim | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
delim : List α
h :
(match delim, head :: tail with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true
⊢ delim <+: head :: tail | case nil
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
h :
(match [], head :: tail with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true
⊢ [] <+: head :: tail
case cons
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
head✝ : α
tail✝ : List α
h :
(match head✝ :: tail✝, head :: tail with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true
⊢ head✝ :: tail✝ <+: head :: tail | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
delim : List α
h :
(match delim, head :: tail with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true
⊢ delim <+: head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | case nil => simp only [append_nil, nil_isPrefix] | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
h :
(match [], head :: tail with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true
⊢ [] <+: head :: tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
h :
(match [], head :: tail with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true
⊢ [] <+: head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | case cons dhead dtail =>
simp at h
have ⟨h₂,h₃⟩ := h
have ⟨s, heq⟩ := ih dtail h₃
exists s
simp only [h₂, cons_append, heq] | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
dhead : α
dtail : List α
h :
(match dhead :: dtail, head :: tail with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true
⊢ dhead :: dtail <+: head :: tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
dhead : α
dtail : List α
h :
(match dhead :: dtail, head :: tail with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true
⊢ dhead :: dtail <+: head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | simp only [append_nil, nil_isPrefix] | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
h :
(match [], head :: tail with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true
⊢ [] <+: head :: tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
h :
(match [], head :: tail with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true
⊢ [] <+: head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | simp at h | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
dhead : α
dtail : List α
h :
(match dhead :: dtail, head :: tail with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true
⊢ dhead :: dtail <+: head :: tail | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
dhead : α
dtail : List α
h : dhead = head ∧ isPrefixOf dtail tail = true
⊢ dhead :: dtail <+: head :: tail | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
dhead : α
dtail : List α
h :
(match dhead :: dtail, head :: tail with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true
⊢ dhead :: dtail <+: head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | have ⟨h₂,h₃⟩ := h | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
dhead : α
dtail : List α
h : dhead = head ∧ isPrefixOf dtail tail = true
⊢ dhead :: dtail <+: head :: tail | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
dhead : α
dtail : List α
h : dhead = head ∧ isPrefixOf dtail tail = true
h₂ : dhead = head
h₃ : isPrefixOf dtail tail = true
⊢ dhead :: dtail <+: head :: tail | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
dhead : α
dtail : List α
h : dhead = head ∧ isPrefixOf dtail tail = true
⊢ dhead :: dtail <+: head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | have ⟨s, heq⟩ := ih dtail h₃ | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
dhead : α
dtail : List α
h : dhead = head ∧ isPrefixOf dtail tail = true
h₂ : dhead = head
h₃ : isPrefixOf dtail tail = true
⊢ dhead :: dtail <+: head :: tail | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
dhead : α
dtail : List α
h : dhead = head ∧ isPrefixOf dtail tail = true
h₂ : dhead = head
h₃ : isPrefixOf dtail tail = true
s : List α
heq : dtail ++ s = tail
⊢ dhead :: dtail <+: head :: tail | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
dhead : α
dtail : List α
h : dhead = head ∧ isPrefixOf dtail tail = true
h₂ : dhead = head
h₃ : isPrefixOf dtail tail = true
⊢ dhead :: dtail <+: head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | exists s | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
dhead : α
dtail : List α
h : dhead = head ∧ isPrefixOf dtail tail = true
h₂ : dhead = head
h₃ : isPrefixOf dtail tail = true
s : List α
heq : dtail ++ s = tail
⊢ dhead :: dtail <+: head :: tail | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
dhead : α
dtail : List α
h : dhead = head ∧ isPrefixOf dtail tail = true
h₂ : dhead = head
h₃ : isPrefixOf dtail tail = true
s : List α
heq : dtail ++ s = tail
⊢ dhead :: dtail ++ s = head :: tail | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
dhead : α
dtail : List α
h : dhead = head ∧ isPrefixOf dtail tail = true
h₂ : dhead = head
h₃ : isPrefixOf dtail tail = true
s : List α
heq : dtail ++ s = tail
⊢ dhead :: dtail <+: head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | simp only [h₂, cons_append, heq] | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
dhead : α
dtail : List α
h : dhead = head ∧ isPrefixOf dtail tail = true
h₂ : dhead = head
h₃ : isPrefixOf dtail tail = true
s : List α
heq : dtail ++ s = tail
⊢ dhead :: dtail ++ s = head :: tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
head : α
tail : List α
ih : ∀ (delim : List α), isPrefixOf delim tail = true → delim <+: tail
dhead : α
dtail : List α
h : dhead = head ∧ isPrefixOf dtail tail = true
h₂ : dhead = head
h₃ : isPrefixOf dtail tail = true
s : List α
heq : dtail ++ s = tail
⊢ dhead :: dtail ++ s = head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | unfold isPrefixOf | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
s l : List α
⊢ isPrefixOf [] ([] ++ s) = true | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
s l : List α
⊢ (match [], [] ++ s with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
s l : List α
⊢ isPrefixOf [] ([] ++ s) = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | simp only | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
s l : List α
⊢ (match [], [] ++ s with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
s l : List α
⊢ (match [], [] ++ s with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | unfold isPrefixOf | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
s : List α
head : α
tail : List α
ih : List α → isPrefixOf tail (tail ++ s) = true
l : List α
⊢ isPrefixOf (head :: tail) (head :: tail ++ s) = true | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
s : List α
head : α
tail : List α
ih : List α → isPrefixOf tail (tail ++ s) = true
l : List α
⊢ (match head :: tail, head :: tail ++ s with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
s : List α
head : α
tail : List α
ih : List α → isPrefixOf tail (tail ++ s) = true
l : List α
⊢ isPrefixOf (head :: tail) (head :: tail ++ s) = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | simp | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
s : List α
head : α
tail : List α
ih : List α → isPrefixOf tail (tail ++ s) = true
l : List α
⊢ (match head :: tail, head :: tail ++ s with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
s : List α
head : α
tail : List α
ih : List α → isPrefixOf tail (tail ++ s) = true
l : List α
⊢ isPrefixOf tail (tail ++ s) = true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
s : List α
head : α
tail : List α
ih : List α → isPrefixOf tail (tail ++ s) = true
l : List α
⊢ (match head :: tail, head :: tail ++ s with
| [], x => true
| x, [] => false
| a :: as, b :: bs => a == b && isPrefixOf as bs) =
true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefixOf_ext | [1333, 1] | [1361, 17] | apply ih l | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
s : List α
head : α
tail : List α
ih : List α → isPrefixOf tail (tail ++ s) = true
l : List α
⊢ isPrefixOf tail (tail ++ s) = true | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
s : List α
head : α
tail : List α
ih : List α → isPrefixOf tail (tail ++ s) = true
l : List α
⊢ isPrefixOf tail (tail ++ s) = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | apply Iff.intro | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim l : List α
⊢ isInfixOf delim l = true ↔ delim <:+: l | case mp
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim l : List α
⊢ isInfixOf delim l = true → delim <:+: l
case mpr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim l : List α
⊢ delim <:+: l → isInfixOf delim l = true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim l : List α
⊢ isInfixOf delim l = true ↔ delim <:+: l
TACTIC:
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.