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.isInfixOf_ext | [1364, 1] | [1414, 17] | . intro h
induction l
case nil =>
unfold isInfixOf at h
split at h
. simp only [nil_isInfix]
. simp only at h
. next heq => simp only at heq
case cons head tail ih =>
unfold isInfixOf at h
simp at h
cases h with
| inl heq =>
simp only [List.isPrefixOf_ext] at heq
simp only [heq, List.isInfix_of_isPrefix]
| inr heq =>
have h₂:= ih heq
apply List.isInfix_cons h₂ | 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 | 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:
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
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | . intro h
have ⟨s,t, heq⟩ := h
subst heq
clear h
induction s
case nil =>
unfold isInfixOf
split
case h_1 => simp only
case h_2 hne heq => simp_all only [nil_append, append_eq_nil, forall_true_left]
case h_3 heq =>
simp at heq
rw [← heq]
simp only [Bool.or_eq_true, List.isPrefixOf_ext]
left
exists t
case cons head tail ih =>
unfold isInfixOf
split
case h_1 heq=>
simp only [append_assoc, cons_append, append_eq_nil, and_false] at heq
case h_2 hne heq =>
simp only [append_assoc, cons_append, append_eq_nil, and_false] at heq
case h_3 hd tl heq =>
simp at heq
have ⟨h₁, h₂⟩ := heq
simp only [Bool.or_eq_true]
right
rw [ ← h₂]
rw [append_assoc] at ih
apply ih | case mpr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim l : List α
⊢ delim <:+: l → isInfixOf 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 → isInfixOf delim l = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | unfold isInfixOf at h | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
h : isInfixOf delim [] = true
⊢ delim <:+: [] | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
h :
(match delim, [] with
| [], [] => true
| x, [] => false
| delim, a :: as => isPrefixOf delim (a :: as) || isInfixOf delim as) =
true
⊢ delim <:+: [] | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
h : isInfixOf delim [] = true
⊢ delim <:+: []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | split at h | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
h :
(match delim, [] with
| [], [] => true
| x, [] => false
| delim, a :: as => isPrefixOf delim (a :: as) || isInfixOf delim as) =
true
⊢ delim <:+: [] | case h_1
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝¹ x✝ : List α
heq✝ : [] = []
h : true = true
⊢ [] <:+: []
case h_2
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝³ x✝² x✝¹ : List α
x✝ : x✝³ = [] → False
heq✝ : [] = []
h : false = true
⊢ x✝³ <:+: []
case h_3
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq✝ : [] = a✝ :: as✝
h : (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true
⊢ x✝² <:+: [] | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
h :
(match delim, [] with
| [], [] => true
| x, [] => false
| delim, a :: as => isPrefixOf delim (a :: as) || isInfixOf delim as) =
true
⊢ delim <:+: []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | . simp only [nil_isInfix] | case h_1
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝¹ x✝ : List α
heq✝ : [] = []
h : true = true
⊢ [] <:+: []
case h_2
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝³ x✝² x✝¹ : List α
x✝ : x✝³ = [] → False
heq✝ : [] = []
h : false = true
⊢ x✝³ <:+: []
case h_3
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq✝ : [] = a✝ :: as✝
h : (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true
⊢ x✝² <:+: [] | case h_2
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝³ x✝² x✝¹ : List α
x✝ : x✝³ = [] → False
heq✝ : [] = []
h : false = true
⊢ x✝³ <:+: []
case h_3
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq✝ : [] = a✝ :: as✝
h : (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true
⊢ x✝² <:+: [] | Please generate a tactic in lean4 to solve the state.
STATE:
case h_1
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝¹ x✝ : List α
heq✝ : [] = []
h : true = true
⊢ [] <:+: []
case h_2
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝³ x✝² x✝¹ : List α
x✝ : x✝³ = [] → False
heq✝ : [] = []
h : false = true
⊢ x✝³ <:+: []
case h_3
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq✝ : [] = a✝ :: as✝
h : (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true
⊢ x✝² <:+: []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | . simp only at h | case h_2
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝³ x✝² x✝¹ : List α
x✝ : x✝³ = [] → False
heq✝ : [] = []
h : false = true
⊢ x✝³ <:+: []
case h_3
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq✝ : [] = a✝ :: as✝
h : (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true
⊢ x✝² <:+: [] | case h_3
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq✝ : [] = a✝ :: as✝
h : (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true
⊢ x✝² <:+: [] | Please generate a tactic in lean4 to solve the state.
STATE:
case h_2
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝³ x✝² x✝¹ : List α
x✝ : x✝³ = [] → False
heq✝ : [] = []
h : false = true
⊢ x✝³ <:+: []
case h_3
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq✝ : [] = a✝ :: as✝
h : (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true
⊢ x✝² <:+: []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | . next heq => simp only at heq | case h_3
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq✝ : [] = a✝ :: as✝
h : (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true
⊢ x✝² <:+: [] | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case h_3
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq✝ : [] = a✝ :: as✝
h : (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true
⊢ x✝² <:+: []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | simp only at heq | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq : [] = a✝ :: as✝
h : (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true
⊢ x✝² <:+: [] | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq : [] = a✝ :: as✝
h : (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true
⊢ x✝² <:+: []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | unfold isInfixOf at h | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
head : α
tail : List α
ih : isInfixOf delim tail = true → delim <:+: tail
h : isInfixOf delim (head :: tail) = true
⊢ delim <:+: head :: tail | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
head : α
tail : List α
ih : isInfixOf delim tail = true → delim <:+: tail
h :
(match delim, head :: tail with
| [], [] => true
| x, [] => false
| delim, a :: as => isPrefixOf delim (a :: as) || isInfixOf delim as) =
true
⊢ delim <:+: head :: tail | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
head : α
tail : List α
ih : isInfixOf delim tail = true → delim <:+: tail
h : isInfixOf delim (head :: tail) = true
⊢ delim <:+: head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | simp at h | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
head : α
tail : List α
ih : isInfixOf delim tail = true → delim <:+: tail
h :
(match delim, head :: tail with
| [], [] => true
| x, [] => false
| delim, a :: as => isPrefixOf delim (a :: as) || isInfixOf delim as) =
true
⊢ delim <:+: head :: tail | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
head : α
tail : List α
ih : isInfixOf delim tail = true → delim <:+: tail
h : isPrefixOf delim (head :: tail) = true ∨ isInfixOf delim tail = true
⊢ delim <:+: head :: tail | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
head : α
tail : List α
ih : isInfixOf delim tail = true → delim <:+: tail
h :
(match delim, head :: tail with
| [], [] => true
| x, [] => false
| delim, a :: as => isPrefixOf delim (a :: as) || isInfixOf delim as) =
true
⊢ delim <:+: head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | cases h with
| inl heq =>
simp only [List.isPrefixOf_ext] at heq
simp only [heq, List.isInfix_of_isPrefix]
| inr heq =>
have h₂:= ih heq
apply List.isInfix_cons h₂ | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
head : α
tail : List α
ih : isInfixOf delim tail = true → delim <:+: tail
h : isPrefixOf delim (head :: tail) = true ∨ isInfixOf delim tail = true
⊢ delim <:+: head :: tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
head : α
tail : List α
ih : isInfixOf delim tail = true → delim <:+: tail
h : isPrefixOf delim (head :: tail) = true ∨ isInfixOf delim tail = true
⊢ delim <:+: head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | simp only [List.isPrefixOf_ext] at heq | case inl
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
head : α
tail : List α
ih : isInfixOf delim tail = true → delim <:+: tail
heq : isPrefixOf delim (head :: tail) = true
⊢ delim <:+: head :: tail | case inl
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
head : α
tail : List α
ih : isInfixOf delim tail = true → delim <:+: tail
heq : delim <+: head :: tail
⊢ delim <:+: head :: tail | Please generate a tactic in lean4 to solve the state.
STATE:
case inl
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
head : α
tail : List α
ih : isInfixOf delim tail = true → delim <:+: tail
heq : isPrefixOf delim (head :: tail) = true
⊢ delim <:+: head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | simp only [heq, List.isInfix_of_isPrefix] | case inl
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
head : α
tail : List α
ih : isInfixOf delim tail = true → delim <:+: tail
heq : delim <+: head :: tail
⊢ delim <:+: head :: tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case inl
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
head : α
tail : List α
ih : isInfixOf delim tail = true → delim <:+: tail
heq : delim <+: head :: tail
⊢ delim <:+: head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | have h₂:= ih heq | case inr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
head : α
tail : List α
ih : isInfixOf delim tail = true → delim <:+: tail
heq : isInfixOf delim tail = true
⊢ delim <:+: head :: tail | case inr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
head : α
tail : List α
ih : isInfixOf delim tail = true → delim <:+: tail
heq : isInfixOf delim tail = true
h₂ : delim <:+: tail
⊢ delim <:+: head :: tail | Please generate a tactic in lean4 to solve the state.
STATE:
case inr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
head : α
tail : List α
ih : isInfixOf delim tail = true → delim <:+: tail
heq : isInfixOf delim tail = true
⊢ delim <:+: head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | apply List.isInfix_cons h₂ | case inr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
head : α
tail : List α
ih : isInfixOf delim tail = true → delim <:+: tail
heq : isInfixOf delim tail = true
h₂ : delim <:+: tail
⊢ delim <:+: head :: tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case inr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim : List α
head : α
tail : List α
ih : isInfixOf delim tail = true → delim <:+: tail
heq : isInfixOf delim tail = true
h₂ : delim <:+: tail
⊢ delim <:+: head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | unfold isInfixOf | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim t : List α
⊢ isInfixOf delim ([] ++ delim ++ t) = true | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim t : List α
⊢ (match delim, [] ++ delim ++ t with
| [], [] => true
| x, [] => false
| delim, a :: as => isPrefixOf delim (a :: as) || isInfixOf delim as) =
true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim t : List α
⊢ isInfixOf delim ([] ++ delim ++ t) = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | split | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim t : List α
⊢ (match delim, [] ++ delim ++ t with
| [], [] => true
| x, [] => false
| delim, a :: as => isPrefixOf delim (a :: as) || isInfixOf delim as) =
true | case h_1
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝¹ x✝ : List α
heq✝ : [] ++ [] ++ t = []
⊢ true = true
case h_2
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝³ x✝² x✝¹ : List α
x✝ : x✝³ = [] → False
heq✝ : [] ++ x✝³ ++ t = []
⊢ false = true
case h_3
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq✝ : [] ++ x✝² ++ t = a✝ :: as✝
⊢ (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim t : List α
⊢ (match delim, [] ++ delim ++ t with
| [], [] => true
| x, [] => false
| delim, a :: as => isPrefixOf delim (a :: as) || isInfixOf delim as) =
true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | case h_1 => simp only | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝¹ x✝ : List α
heq✝ : [] ++ [] ++ t = []
⊢ true = true | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝¹ x✝ : List α
heq✝ : [] ++ [] ++ t = []
⊢ true = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | case h_2 hne heq => simp_all only [nil_append, append_eq_nil, forall_true_left] | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
hne : x✝² = [] → False
heq : [] ++ x✝² ++ t = []
⊢ false = true | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
hne : x✝² = [] → False
heq : [] ++ x✝² ++ t = []
⊢ false = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | case h_3 heq =>
simp at heq
rw [← heq]
simp only [Bool.or_eq_true, List.isPrefixOf_ext]
left
exists t | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq : [] ++ x✝² ++ t = a✝ :: as✝
⊢ (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq : [] ++ x✝² ++ t = a✝ :: as✝
⊢ (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | simp only | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝¹ x✝ : List α
heq✝ : [] ++ [] ++ t = []
⊢ true = true | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝¹ x✝ : List α
heq✝ : [] ++ [] ++ t = []
⊢ true = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | simp_all only [nil_append, append_eq_nil, forall_true_left] | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
hne : x✝² = [] → False
heq : [] ++ x✝² ++ t = []
⊢ false = true | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
hne : x✝² = [] → False
heq : [] ++ x✝² ++ t = []
⊢ false = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | simp at heq | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq : [] ++ x✝² ++ t = a✝ :: as✝
⊢ (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq : x✝² ++ t = a✝ :: as✝
⊢ (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq : [] ++ x✝² ++ t = a✝ :: as✝
⊢ (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | rw [← heq] | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq : x✝² ++ t = a✝ :: as✝
⊢ (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq : x✝² ++ t = a✝ :: as✝
⊢ (isPrefixOf x✝² (x✝² ++ t) || isInfixOf x✝² as✝) = true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq : x✝² ++ t = a✝ :: as✝
⊢ (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | simp only [Bool.or_eq_true, List.isPrefixOf_ext] | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq : x✝² ++ t = a✝ :: as✝
⊢ (isPrefixOf x✝² (x✝² ++ t) || isInfixOf x✝² as✝) = true | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq : x✝² ++ t = a✝ :: as✝
⊢ x✝² <+: x✝² ++ t ∨ isInfixOf x✝² as✝ = true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq : x✝² ++ t = a✝ :: as✝
⊢ (isPrefixOf x✝² (x✝² ++ t) || isInfixOf x✝² as✝) = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | left | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq : x✝² ++ t = a✝ :: as✝
⊢ x✝² <+: x✝² ++ t ∨ isInfixOf x✝² as✝ = true | case h
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq : x✝² ++ t = a✝ :: as✝
⊢ x✝² <+: x✝² ++ t | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq : x✝² ++ t = a✝ :: as✝
⊢ x✝² <+: x✝² ++ t ∨ isInfixOf x✝² as✝ = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | exists t | case h
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq : x✝² ++ t = a✝ :: as✝
⊢ x✝² <+: x✝² ++ t | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case h
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
heq : x✝² ++ t = a✝ :: as✝
⊢ x✝² <+: x✝² ++ t
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | unfold isInfixOf | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim t : List α
head : α
tail : List α
ih : isInfixOf delim (tail ++ delim ++ t) = true
⊢ isInfixOf delim (head :: tail ++ delim ++ t) = true | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim t : List α
head : α
tail : List α
ih : isInfixOf delim (tail ++ delim ++ t) = true
⊢ (match delim, head :: tail ++ delim ++ t with
| [], [] => true
| x, [] => false
| delim, a :: as => isPrefixOf delim (a :: as) || isInfixOf delim as) =
true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim t : List α
head : α
tail : List α
ih : isInfixOf delim (tail ++ delim ++ t) = true
⊢ isInfixOf delim (head :: tail ++ delim ++ t) = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | split | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim t : List α
head : α
tail : List α
ih : isInfixOf delim (tail ++ delim ++ t) = true
⊢ (match delim, head :: tail ++ delim ++ t with
| [], [] => true
| x, [] => false
| delim, a :: as => isPrefixOf delim (a :: as) || isInfixOf delim as) =
true | case h_1
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝¹ x✝ : List α
ih : isInfixOf [] (tail ++ [] ++ t) = true
heq✝ : head :: tail ++ [] ++ t = []
⊢ true = true
case h_2
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝³ x✝² x✝¹ : List α
x✝ : x✝³ = [] → False
ih : isInfixOf x✝³ (tail ++ x✝³ ++ t) = true
heq✝ : head :: tail ++ x✝³ ++ t = []
⊢ false = true
case h_3
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
a✝ : α
as✝ : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq✝ : head :: tail ++ x✝² ++ t = a✝ :: as✝
⊢ (isPrefixOf x✝² (a✝ :: as✝) || isInfixOf x✝² as✝) = true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
delim t : List α
head : α
tail : List α
ih : isInfixOf delim (tail ++ delim ++ t) = true
⊢ (match delim, head :: tail ++ delim ++ t with
| [], [] => true
| x, [] => false
| delim, a :: as => isPrefixOf delim (a :: as) || isInfixOf delim as) =
true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | case h_1 heq=>
simp only [append_assoc, cons_append, append_eq_nil, and_false] at heq | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝¹ x✝ : List α
ih : isInfixOf [] (tail ++ [] ++ t) = true
heq : head :: tail ++ [] ++ t = []
⊢ true = true | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝¹ x✝ : List α
ih : isInfixOf [] (tail ++ [] ++ t) = true
heq : head :: tail ++ [] ++ t = []
⊢ true = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | case h_2 hne heq =>
simp only [append_assoc, cons_append, append_eq_nil, and_false] at heq | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hne : x✝² = [] → False
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head :: tail ++ x✝² ++ t = []
⊢ false = true | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hne : x✝² = [] → False
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head :: tail ++ x✝² ++ t = []
⊢ false = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | case h_3 hd tl heq =>
simp at heq
have ⟨h₁, h₂⟩ := heq
simp only [Bool.or_eq_true]
right
rw [ ← h₂]
rw [append_assoc] at ih
apply ih | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head :: tail ++ x✝² ++ t = hd :: tl
⊢ (isPrefixOf x✝² (hd :: tl) || isInfixOf x✝² tl) = true | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head :: tail ++ x✝² ++ t = hd :: tl
⊢ (isPrefixOf x✝² (hd :: tl) || isInfixOf x✝² tl) = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | simp only [append_assoc, cons_append, append_eq_nil, and_false] at heq | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝¹ x✝ : List α
ih : isInfixOf [] (tail ++ [] ++ t) = true
heq : head :: tail ++ [] ++ t = []
⊢ true = true | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝¹ x✝ : List α
ih : isInfixOf [] (tail ++ [] ++ t) = true
heq : head :: tail ++ [] ++ t = []
⊢ true = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | simp only [append_assoc, cons_append, append_eq_nil, and_false] at heq | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hne : x✝² = [] → False
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head :: tail ++ x✝² ++ t = []
⊢ false = true | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hne : x✝² = [] → False
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head :: tail ++ x✝² ++ t = []
⊢ false = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | simp at heq | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head :: tail ++ x✝² ++ t = hd :: tl
⊢ (isPrefixOf x✝² (hd :: tl) || isInfixOf x✝² tl) = true | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head = hd ∧ tail ++ (x✝² ++ t) = tl
⊢ (isPrefixOf x✝² (hd :: tl) || isInfixOf x✝² tl) = true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head :: tail ++ x✝² ++ t = hd :: tl
⊢ (isPrefixOf x✝² (hd :: tl) || isInfixOf x✝² tl) = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | have ⟨h₁, h₂⟩ := heq | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head = hd ∧ tail ++ (x✝² ++ t) = tl
⊢ (isPrefixOf x✝² (hd :: tl) || isInfixOf x✝² tl) = true | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head = hd ∧ tail ++ (x✝² ++ t) = tl
h₁ : head = hd
h₂ : tail ++ (x✝² ++ t) = tl
⊢ (isPrefixOf x✝² (hd :: tl) || isInfixOf x✝² tl) = true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head = hd ∧ tail ++ (x✝² ++ t) = tl
⊢ (isPrefixOf x✝² (hd :: tl) || isInfixOf x✝² tl) = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | simp only [Bool.or_eq_true] | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head = hd ∧ tail ++ (x✝² ++ t) = tl
h₁ : head = hd
h₂ : tail ++ (x✝² ++ t) = tl
⊢ (isPrefixOf x✝² (hd :: tl) || isInfixOf x✝² tl) = true | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head = hd ∧ tail ++ (x✝² ++ t) = tl
h₁ : head = hd
h₂ : tail ++ (x✝² ++ t) = tl
⊢ isPrefixOf x✝² (hd :: tl) = true ∨ isInfixOf x✝² tl = true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head = hd ∧ tail ++ (x✝² ++ t) = tl
h₁ : head = hd
h₂ : tail ++ (x✝² ++ t) = tl
⊢ (isPrefixOf x✝² (hd :: tl) || isInfixOf x✝² tl) = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | right | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head = hd ∧ tail ++ (x✝² ++ t) = tl
h₁ : head = hd
h₂ : tail ++ (x✝² ++ t) = tl
⊢ isPrefixOf x✝² (hd :: tl) = true ∨ isInfixOf x✝² tl = true | case h
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head = hd ∧ tail ++ (x✝² ++ t) = tl
h₁ : head = hd
h₂ : tail ++ (x✝² ++ t) = tl
⊢ isInfixOf x✝² tl = true | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head = hd ∧ tail ++ (x✝² ++ t) = tl
h₁ : head = hd
h₂ : tail ++ (x✝² ++ t) = tl
⊢ isPrefixOf x✝² (hd :: tl) = true ∨ isInfixOf x✝² tl = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | rw [ ← h₂] | case h
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head = hd ∧ tail ++ (x✝² ++ t) = tl
h₁ : head = hd
h₂ : tail ++ (x✝² ++ t) = tl
⊢ isInfixOf x✝² tl = true | case h
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head = hd ∧ tail ++ (x✝² ++ t) = tl
h₁ : head = hd
h₂ : tail ++ (x✝² ++ t) = tl
⊢ isInfixOf x✝² (tail ++ (x✝² ++ t)) = true | Please generate a tactic in lean4 to solve the state.
STATE:
case h
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head = hd ∧ tail ++ (x✝² ++ t) = tl
h₁ : head = hd
h₂ : tail ++ (x✝² ++ t) = tl
⊢ isInfixOf x✝² tl = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | rw [append_assoc] at ih | case h
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head = hd ∧ tail ++ (x✝² ++ t) = tl
h₁ : head = hd
h₂ : tail ++ (x✝² ++ t) = tl
⊢ isInfixOf x✝² (tail ++ (x✝² ++ t)) = true | case h
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ (x✝² ++ t)) = true
heq : head = hd ∧ tail ++ (x✝² ++ t) = tl
h₁ : head = hd
h₂ : tail ++ (x✝² ++ t) = tl
⊢ isInfixOf x✝² (tail ++ (x✝² ++ t)) = true | Please generate a tactic in lean4 to solve the state.
STATE:
case h
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ x✝² ++ t) = true
heq : head = hd ∧ tail ++ (x✝² ++ t) = tl
h₁ : head = hd
h₂ : tail ++ (x✝² ++ t) = tl
⊢ isInfixOf x✝² (tail ++ (x✝² ++ t)) = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfixOf_ext | [1364, 1] | [1414, 17] | apply ih | case h
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ (x✝² ++ t)) = true
heq : head = hd ∧ tail ++ (x✝² ++ t) = tl
h₁ : head = hd
h₂ : tail ++ (x✝² ++ t) = tl
⊢ isInfixOf x✝² (tail ++ (x✝² ++ t)) = true | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case h
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
t : List α
head : α
tail x✝² x✝¹ x✝ : List α
hd : α
tl : List α
ih : isInfixOf x✝² (tail ++ (x✝² ++ t)) = true
heq : head = hd ∧ tail ++ (x✝² ++ t) = tl
h₁ : head = hd
h₂ : tail ++ (x✝² ++ t) = tl
⊢ isInfixOf x✝² (tail ++ (x✝² ++ t)) = true
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefix_self_append | [1416, 1] | [1417, 65] | exists l₂ | α✝ : Type u_1
l₁ l₂ : List α✝
⊢ l₁ <+: l₁ ++ l₂ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ : List α✝
⊢ l₁ <+: l₁ ++ l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPostfix_append_of_isPostfix | [1419, 1] | [1423, 20] | have ⟨s, heq⟩ := h | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+ l₂
⊢ l₁ <:+ l₃ ++ l₂ | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+ l₂
s : List α✝
heq : s ++ l₁ = l₂
⊢ l₁ <:+ l₃ ++ l₂ | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+ l₂
⊢ l₁ <:+ l₃ ++ l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPostfix_append_of_isPostfix | [1419, 1] | [1423, 20] | rw [← heq] | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+ l₂
s : List α✝
heq : s ++ l₁ = l₂
⊢ l₁ <:+ l₃ ++ l₂ | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+ l₂
s : List α✝
heq : s ++ l₁ = l₂
⊢ l₁ <:+ l₃ ++ (s ++ l₁) | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+ l₂
s : List α✝
heq : s ++ l₁ = l₂
⊢ l₁ <:+ l₃ ++ l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPostfix_append_of_isPostfix | [1419, 1] | [1423, 20] | exists l₃ ++ s | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+ l₂
s : List α✝
heq : s ++ l₁ = l₂
⊢ l₁ <:+ l₃ ++ (s ++ l₁) | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+ l₂
s : List α✝
heq : s ++ l₁ = l₂
⊢ l₃ ++ s ++ l₁ = l₃ ++ (s ++ l₁) | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+ l₂
s : List α✝
heq : s ++ l₁ = l₂
⊢ l₁ <:+ l₃ ++ (s ++ l₁)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPostfix_append_of_isPostfix | [1419, 1] | [1423, 20] | rw [append_assoc] | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+ l₂
s : List α✝
heq : s ++ l₁ = l₂
⊢ l₃ ++ s ++ l₁ = l₃ ++ (s ++ l₁) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+ l₂
s : List α✝
heq : s ++ l₁ = l₂
⊢ l₃ ++ s ++ l₁ = l₃ ++ (s ++ l₁)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_append_left_of_isInfix | [1425, 1] | [1429, 27] | have ⟨s, t, heq⟩ := h | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
⊢ l₁ <:+: l₃ ++ l₂ | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ l₁ <:+: l₃ ++ l₂ | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
⊢ l₁ <:+: l₃ ++ l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_append_left_of_isInfix | [1425, 1] | [1429, 27] | rw [← heq] | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ l₁ <:+: l₃ ++ l₂ | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ l₁ <:+: l₃ ++ (s ++ l₁ ++ t) | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ l₁ <:+: l₃ ++ l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_append_left_of_isInfix | [1425, 1] | [1429, 27] | exists l₃ ++ s, t | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ l₁ <:+: l₃ ++ (s ++ l₁ ++ t) | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ l₃ ++ s ++ l₁ ++ t = l₃ ++ (s ++ l₁ ++ t) | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ l₁ <:+: l₃ ++ (s ++ l₁ ++ t)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_append_left_of_isInfix | [1425, 1] | [1429, 27] | simp only [append_assoc] | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ l₃ ++ s ++ l₁ ++ t = l₃ ++ (s ++ l₁ ++ t) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ l₃ ++ s ++ l₁ ++ t = l₃ ++ (s ++ l₁ ++ t)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_append_right_of_isInfix | [1431, 1] | [1435, 27] | have ⟨s, t, heq⟩ := h | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
⊢ l₁ <:+: l₂ ++ l₃ | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ l₁ <:+: l₂ ++ l₃ | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
⊢ l₁ <:+: l₂ ++ l₃
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_append_right_of_isInfix | [1431, 1] | [1435, 27] | rw [← heq] | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ l₁ <:+: l₂ ++ l₃ | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ l₁ <:+: s ++ l₁ ++ t ++ l₃ | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ l₁ <:+: l₂ ++ l₃
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_append_right_of_isInfix | [1431, 1] | [1435, 27] | exists s, t ++ l₃ | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ l₁ <:+: s ++ l₁ ++ t ++ l₃ | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ s ++ l₁ ++ (t ++ l₃) = s ++ l₁ ++ t ++ l₃ | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ l₁ <:+: s ++ l₁ ++ t ++ l₃
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_append_right_of_isInfix | [1431, 1] | [1435, 27] | simp only [append_assoc] | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ s ++ l₁ ++ (t ++ l₃) = s ++ l₁ ++ t ++ l₃ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ s ++ l₁ ++ (t ++ l₃) = s ++ l₁ ++ t ++ l₃
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefix_append | [1437, 1] | [1449, 31] | have ⟨t, heq⟩ := h | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <+: l₂ ++ l₃
⊢ take (length l₂) l₁ <+: l₂ ∧ drop (length l₂) l₁ <+: l₃ | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <+: l₂ ++ l₃
t : List α✝
heq : l₁ ++ t = l₂ ++ l₃
⊢ take (length l₂) l₁ <+: l₂ ∧ drop (length l₂) l₁ <+: l₃ | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <+: l₂ ++ l₃
⊢ take (length l₂) l₁ <+: l₂ ∧ drop (length l₂) l₁ <+: l₃
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefix_append | [1437, 1] | [1449, 31] | apply And.intro | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <+: l₂ ++ l₃
t : List α✝
heq : l₁ ++ t = l₂ ++ l₃
⊢ take (length l₂) l₁ <+: l₂ ∧ drop (length l₂) l₁ <+: l₃ | case left
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <+: l₂ ++ l₃
t : List α✝
heq : l₁ ++ t = l₂ ++ l₃
⊢ take (length l₂) l₁ <+: l₂
case right
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <+: l₂ ++ l₃
t : List α✝
heq : l₁ ++ t = l₂ ++ l₃
⊢ drop (length l₂) l₁ <+: l₃ | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <+: l₂ ++ l₃
t : List α✝
heq : l₁ ++ t = l₂ ++ l₃
⊢ take (length l₂) l₁ <+: l₂ ∧ drop (length l₂) l₁ <+: l₃
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefix_append | [1437, 1] | [1449, 31] | . apply_fun take (length l₂) at heq
simp only [take_append_eq_append_take, tsub_le_iff_right, ge_iff_le, take_length, Nat.sub_self, zero_le,
nonpos_iff_eq_zero, le_refl, tsub_eq_zero_of_le, append_nil, take] at heq
conv => right; rw [← heq]
apply isPrefix_self_append | case left
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <+: l₂ ++ l₃
t : List α✝
heq : l₁ ++ t = l₂ ++ l₃
⊢ take (length l₂) l₁ <+: l₂
case right
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <+: l₂ ++ l₃
t : List α✝
heq : l₁ ++ t = l₂ ++ l₃
⊢ drop (length l₂) l₁ <+: l₃ | case right
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <+: l₂ ++ l₃
t : List α✝
heq : l₁ ++ t = l₂ ++ l₃
⊢ drop (length l₂) l₁ <+: l₃ | Please generate a tactic in lean4 to solve the state.
STATE:
case left
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <+: l₂ ++ l₃
t : List α✝
heq : l₁ ++ t = l₂ ++ l₃
⊢ take (length l₂) l₁ <+: l₂
case right
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <+: l₂ ++ l₃
t : List α✝
heq : l₁ ++ t = l₂ ++ l₃
⊢ drop (length l₂) l₁ <+: l₃
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isPrefix_append | [1437, 1] | [1449, 31] | . apply_fun drop (length l₂) at heq
simp only [drop_append_eq_append_drop, tsub_le_iff_right, ge_iff_le, drop_length, Nat.sub_self, zero_le,
nonpos_iff_eq_zero, le_refl, tsub_eq_zero_of_le, nil_append, drop] at heq
conv => right; rw [← heq]
apply isPrefix_self_append | case right
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <+: l₂ ++ l₃
t : List α✝
heq : l₁ ++ t = l₂ ++ l₃
⊢ drop (length l₂) l₁ <+: l₃ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case right
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <+: l₂ ++ l₃
t : List α✝
heq : l₁ ++ t = l₂ ++ l₃
⊢ drop (length l₂) l₁ <+: l₃
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | have ⟨t,heq⟩ := h | α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
⊢ s ++ l₁ <+: take n l₂ ∨ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) l₂ | α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ s ++ l₁ <+: take n l₂ ∨ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) l₂ | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
⊢ s ++ l₁ <+: take n l₂ ∨ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | rw [← heq] | α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ s ++ l₁ <+: take n l₂ ∨ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) l₂ | α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ s ++ l₁ <+: take n (s ++ l₁ ++ t) ∨ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) (s ++ l₁ ++ t) | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ s ++ l₁ <+: take n l₂ ∨ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | cases hle: decide (length s + length l₁ ≤ n) with
| true =>
simp only [decide_eq_true_eq] at hle
left
exists (take (n-length s - length l₁) t)
have hle₁ : length s ≤ n := by calc
length s ≤ length s + length l₁ := by simp
_ ≤ n := hle
have hle₂ : length l₁ ≤ (n - length s) := by apply Nat.le_sub_of_add_le; rw [add_comm]; exact hle
rw [List.take_append_eq_append_take, List.take_append_eq_append_take, List.take_all_of_le hle₁, List.take_all_of_le hle₂]
simp
congr 1
apply Nat.sub_sub
| false =>
simp only [decide_eq_false_iff_not, not_le] at hle
right
rw [List.drop_append_eq_append_drop, List.drop_append_eq_append_drop]
have heq₁: n + 1 - length l₁ - length s = 0 := by
rw [Nat.sub_sub, Nat.sub_eq_zero_of_le]
apply Nat.add_one_le_iff.2
rw [Nat.add_comm]
apply hle
rw [heq₁, drop]
exists (drop (n + 1 - length l₁ - length (s ++ l₁)) t) | α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ s ++ l₁ <+: take n (s ++ l₁ ++ t) ∨ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) (s ++ l₁ ++ t) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ s ++ l₁ <+: take n (s ++ l₁ ++ t) ∨ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) (s ++ l₁ ++ t)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | simp only [decide_eq_true_eq] at hle | case true
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : decide (length s + length l₁ ≤ n) = true
⊢ s ++ l₁ <+: take n (s ++ l₁ ++ t) ∨ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) (s ++ l₁ ++ t) | case true
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
⊢ s ++ l₁ <+: take n (s ++ l₁ ++ t) ∨ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) (s ++ l₁ ++ t) | Please generate a tactic in lean4 to solve the state.
STATE:
case true
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : decide (length s + length l₁ ≤ n) = true
⊢ s ++ l₁ <+: take n (s ++ l₁ ++ t) ∨ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) (s ++ l₁ ++ t)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | left | case true
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
⊢ s ++ l₁ <+: take n (s ++ l₁ ++ t) ∨ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) (s ++ l₁ ++ t) | case true.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
⊢ s ++ l₁ <+: take n (s ++ l₁ ++ t) | Please generate a tactic in lean4 to solve the state.
STATE:
case true
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
⊢ s ++ l₁ <+: take n (s ++ l₁ ++ t) ∨ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) (s ++ l₁ ++ t)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | exists (take (n-length s - length l₁) t) | case true.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
⊢ s ++ l₁ <+: take n (s ++ l₁ ++ t) | case true.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
⊢ s ++ l₁ ++ take (n - length s - length l₁) t = take n (s ++ l₁ ++ t) | Please generate a tactic in lean4 to solve the state.
STATE:
case true.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
⊢ s ++ l₁ <+: take n (s ++ l₁ ++ t)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | have hle₁ : length s ≤ n := by calc
length s ≤ length s + length l₁ := by simp
_ ≤ n := hle | case true.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
⊢ s ++ l₁ ++ take (n - length s - length l₁) t = take n (s ++ l₁ ++ t) | case true.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
⊢ s ++ l₁ ++ take (n - length s - length l₁) t = take n (s ++ l₁ ++ t) | Please generate a tactic in lean4 to solve the state.
STATE:
case true.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
⊢ s ++ l₁ ++ take (n - length s - length l₁) t = take n (s ++ l₁ ++ t)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | have hle₂ : length l₁ ≤ (n - length s) := by apply Nat.le_sub_of_add_le; rw [add_comm]; exact hle | case true.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
⊢ s ++ l₁ ++ take (n - length s - length l₁) t = take n (s ++ l₁ ++ t) | case true.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
hle₂ : length l₁ ≤ n - length s
⊢ s ++ l₁ ++ take (n - length s - length l₁) t = take n (s ++ l₁ ++ t) | Please generate a tactic in lean4 to solve the state.
STATE:
case true.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
⊢ s ++ l₁ ++ take (n - length s - length l₁) t = take n (s ++ l₁ ++ t)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | rw [List.take_append_eq_append_take, List.take_append_eq_append_take, List.take_all_of_le hle₁, List.take_all_of_le hle₂] | case true.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
hle₂ : length l₁ ≤ n - length s
⊢ s ++ l₁ ++ take (n - length s - length l₁) t = take n (s ++ l₁ ++ t) | case true.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
hle₂ : length l₁ ≤ n - length s
⊢ s ++ l₁ ++ take (n - length s - length l₁) t = s ++ l₁ ++ take (n - length (s ++ l₁)) t | Please generate a tactic in lean4 to solve the state.
STATE:
case true.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
hle₂ : length l₁ ≤ n - length s
⊢ s ++ l₁ ++ take (n - length s - length l₁) t = take n (s ++ l₁ ++ t)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | simp | case true.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
hle₂ : length l₁ ≤ n - length s
⊢ s ++ l₁ ++ take (n - length s - length l₁) t = s ++ l₁ ++ take (n - length (s ++ l₁)) t | case true.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
hle₂ : length l₁ ≤ n - length s
⊢ take (n - length s - length l₁) t = take (n - (length s + length l₁)) t | Please generate a tactic in lean4 to solve the state.
STATE:
case true.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
hle₂ : length l₁ ≤ n - length s
⊢ s ++ l₁ ++ take (n - length s - length l₁) t = s ++ l₁ ++ take (n - length (s ++ l₁)) t
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | congr 1 | case true.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
hle₂ : length l₁ ≤ n - length s
⊢ take (n - length s - length l₁) t = take (n - (length s + length l₁)) t | case true.h.e_a
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
hle₂ : length l₁ ≤ n - length s
⊢ n - length s - length l₁ = n - (length s + length l₁) | Please generate a tactic in lean4 to solve the state.
STATE:
case true.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
hle₂ : length l₁ ≤ n - length s
⊢ take (n - length s - length l₁) t = take (n - (length s + length l₁)) t
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | apply Nat.sub_sub | case true.h.e_a
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
hle₂ : length l₁ ≤ n - length s
⊢ n - length s - length l₁ = n - (length s + length l₁) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case true.h.e_a
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
hle₂ : length l₁ ≤ n - length s
⊢ n - length s - length l₁ = n - (length s + length l₁)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | calc
length s ≤ length s + length l₁ := by simp
_ ≤ n := hle | α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
⊢ length s ≤ n | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
⊢ length s ≤ n
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | simp | α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
⊢ length s ≤ length s + length l₁ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
⊢ length s ≤ length s + length l₁
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | apply Nat.le_sub_of_add_le | α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
⊢ length l₁ ≤ n - length s | case h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
⊢ length l₁ + length s ≤ n | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
⊢ length l₁ ≤ n - length s
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | rw [add_comm] | case h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
⊢ length l₁ + length s ≤ n | case h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
⊢ length s + length l₁ ≤ n | Please generate a tactic in lean4 to solve the state.
STATE:
case h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
⊢ length l₁ + length s ≤ n
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | exact hle | case h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
⊢ length s + length l₁ ≤ n | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : length s + length l₁ ≤ n
hle₁ : length s ≤ n
⊢ length s + length l₁ ≤ n
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | simp only [decide_eq_false_iff_not, not_le] at hle | case false
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : decide (length s + length l₁ ≤ n) = false
⊢ s ++ l₁ <+: take n (s ++ l₁ ++ t) ∨ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) (s ++ l₁ ++ t) | case false
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ s ++ l₁ <+: take n (s ++ l₁ ++ t) ∨ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) (s ++ l₁ ++ t) | Please generate a tactic in lean4 to solve the state.
STATE:
case false
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : decide (length s + length l₁ ≤ n) = false
⊢ s ++ l₁ <+: take n (s ++ l₁ ++ t) ∨ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) (s ++ l₁ ++ t)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | right | case false
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ s ++ l₁ <+: take n (s ++ l₁ ++ t) ∨ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) (s ++ l₁ ++ t) | case false.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) (s ++ l₁ ++ t) | Please generate a tactic in lean4 to solve the state.
STATE:
case false
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ s ++ l₁ <+: take n (s ++ l₁ ++ t) ∨ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) (s ++ l₁ ++ t)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | rw [List.drop_append_eq_append_drop, List.drop_append_eq_append_drop] | case false.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) (s ++ l₁ ++ t) | case false.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ drop (n + 1 - length l₁) s ++ l₁ <+:
drop (n + 1 - length l₁) s ++ drop (n + 1 - length l₁ - length s) l₁ ++
drop (n + 1 - length l₁ - length (s ++ l₁)) t | Please generate a tactic in lean4 to solve the state.
STATE:
case false.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) (s ++ l₁ ++ t)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | have heq₁: n + 1 - length l₁ - length s = 0 := by
rw [Nat.sub_sub, Nat.sub_eq_zero_of_le]
apply Nat.add_one_le_iff.2
rw [Nat.add_comm]
apply hle | case false.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ drop (n + 1 - length l₁) s ++ l₁ <+:
drop (n + 1 - length l₁) s ++ drop (n + 1 - length l₁ - length s) l₁ ++
drop (n + 1 - length l₁ - length (s ++ l₁)) t | case false.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
heq₁ : n + 1 - length l₁ - length s = 0
⊢ drop (n + 1 - length l₁) s ++ l₁ <+:
drop (n + 1 - length l₁) s ++ drop (n + 1 - length l₁ - length s) l₁ ++
drop (n + 1 - length l₁ - length (s ++ l₁)) t | Please generate a tactic in lean4 to solve the state.
STATE:
case false.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ drop (n + 1 - length l₁) s ++ l₁ <+:
drop (n + 1 - length l₁) s ++ drop (n + 1 - length l₁ - length s) l₁ ++
drop (n + 1 - length l₁ - length (s ++ l₁)) t
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | rw [heq₁, drop] | case false.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
heq₁ : n + 1 - length l₁ - length s = 0
⊢ drop (n + 1 - length l₁) s ++ l₁ <+:
drop (n + 1 - length l₁) s ++ drop (n + 1 - length l₁ - length s) l₁ ++
drop (n + 1 - length l₁ - length (s ++ l₁)) t | case false.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
heq₁ : n + 1 - length l₁ - length s = 0
⊢ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) s ++ l₁ ++ drop (n + 1 - length l₁ - length (s ++ l₁)) t | Please generate a tactic in lean4 to solve the state.
STATE:
case false.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
heq₁ : n + 1 - length l₁ - length s = 0
⊢ drop (n + 1 - length l₁) s ++ l₁ <+:
drop (n + 1 - length l₁) s ++ drop (n + 1 - length l₁ - length s) l₁ ++
drop (n + 1 - length l₁ - length (s ++ l₁)) t
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | exists (drop (n + 1 - length l₁ - length (s ++ l₁)) t) | case false.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
heq₁ : n + 1 - length l₁ - length s = 0
⊢ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) s ++ l₁ ++ drop (n + 1 - length l₁ - length (s ++ l₁)) t | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case false.h
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
heq₁ : n + 1 - length l₁ - length s = 0
⊢ drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) s ++ l₁ ++ drop (n + 1 - length l₁ - length (s ++ l₁)) t
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | rw [Nat.sub_sub, Nat.sub_eq_zero_of_le] | α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ n + 1 - length l₁ - length s = 0 | α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ n + 1 ≤ length l₁ + length s | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ n + 1 - length l₁ - length s = 0
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | apply Nat.add_one_le_iff.2 | α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ n + 1 ≤ length l₁ + length s | α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ n < length l₁ + length s | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ n + 1 ≤ length l₁ + length s
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | rw [Nat.add_comm] | α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ n < length l₁ + length s | α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ n < length s + length l₁ | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ n < length l₁ + length s
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.append_isPrefix_split | [1451, 1] | [1477, 59] | apply hle | α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ n < length s + length l₁ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
s l₁ l₂ : List α✝
h : s ++ l₁ <+: l₂
n : ℕ
t : List α✝
heq : s ++ l₁ ++ t = l₂
hle : n < length s + length l₁
⊢ n < length s + length l₁
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_split | [1479, 1] | [1483, 54] | have ⟨s, hPre⟩ := h | α✝ : Type u_1
l₁ l₂ : List α✝
h : l₁ <:+: l₂
n : ℕ
⊢ l₁ <:+: take n l₂ ∨ l₁ <:+: drop (n + 1 - length l₁) l₂ | α✝ : Type u_1
l₁ l₂ : List α✝
h : l₁ <:+: l₂
n : ℕ
s : List α✝
hPre : ∃ t, s ++ l₁ ++ t = l₂
⊢ l₁ <:+: take n l₂ ∨ l₁ <:+: drop (n + 1 - length l₁) l₂ | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ : List α✝
h : l₁ <:+: l₂
n : ℕ
⊢ l₁ <:+: take n l₂ ∨ l₁ <:+: drop (n + 1 - length l₁) l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_split | [1479, 1] | [1483, 54] | cases append_isPrefix_split hPre n with
| inl => left; exists s
| inr => right; exists (drop (n + 1 - length l₁) s) | α✝ : Type u_1
l₁ l₂ : List α✝
h : l₁ <:+: l₂
n : ℕ
s : List α✝
hPre : ∃ t, s ++ l₁ ++ t = l₂
⊢ l₁ <:+: take n l₂ ∨ l₁ <:+: drop (n + 1 - length l₁) l₂ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ : List α✝
h : l₁ <:+: l₂
n : ℕ
s : List α✝
hPre : ∃ t, s ++ l₁ ++ t = l₂
⊢ l₁ <:+: take n l₂ ∨ l₁ <:+: drop (n + 1 - length l₁) l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_split | [1479, 1] | [1483, 54] | left | case inl
α✝ : Type u_1
l₁ l₂ : List α✝
h : l₁ <:+: l₂
n : ℕ
s : List α✝
hPre : ∃ t, s ++ l₁ ++ t = l₂
h✝ : s ++ l₁ <+: take n l₂
⊢ l₁ <:+: take n l₂ ∨ l₁ <:+: drop (n + 1 - length l₁) l₂ | case inl.h
α✝ : Type u_1
l₁ l₂ : List α✝
h : l₁ <:+: l₂
n : ℕ
s : List α✝
hPre : ∃ t, s ++ l₁ ++ t = l₂
h✝ : s ++ l₁ <+: take n l₂
⊢ l₁ <:+: take n l₂ | Please generate a tactic in lean4 to solve the state.
STATE:
case inl
α✝ : Type u_1
l₁ l₂ : List α✝
h : l₁ <:+: l₂
n : ℕ
s : List α✝
hPre : ∃ t, s ++ l₁ ++ t = l₂
h✝ : s ++ l₁ <+: take n l₂
⊢ l₁ <:+: take n l₂ ∨ l₁ <:+: drop (n + 1 - length l₁) l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_split | [1479, 1] | [1483, 54] | exists s | case inl.h
α✝ : Type u_1
l₁ l₂ : List α✝
h : l₁ <:+: l₂
n : ℕ
s : List α✝
hPre : ∃ t, s ++ l₁ ++ t = l₂
h✝ : s ++ l₁ <+: take n l₂
⊢ l₁ <:+: take n l₂ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case inl.h
α✝ : Type u_1
l₁ l₂ : List α✝
h : l₁ <:+: l₂
n : ℕ
s : List α✝
hPre : ∃ t, s ++ l₁ ++ t = l₂
h✝ : s ++ l₁ <+: take n l₂
⊢ l₁ <:+: take n l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_split | [1479, 1] | [1483, 54] | right | case inr
α✝ : Type u_1
l₁ l₂ : List α✝
h : l₁ <:+: l₂
n : ℕ
s : List α✝
hPre : ∃ t, s ++ l₁ ++ t = l₂
h✝ : drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) l₂
⊢ l₁ <:+: take n l₂ ∨ l₁ <:+: drop (n + 1 - length l₁) l₂ | case inr.h
α✝ : Type u_1
l₁ l₂ : List α✝
h : l₁ <:+: l₂
n : ℕ
s : List α✝
hPre : ∃ t, s ++ l₁ ++ t = l₂
h✝ : drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) l₂
⊢ l₁ <:+: drop (n + 1 - length l₁) l₂ | Please generate a tactic in lean4 to solve the state.
STATE:
case inr
α✝ : Type u_1
l₁ l₂ : List α✝
h : l₁ <:+: l₂
n : ℕ
s : List α✝
hPre : ∃ t, s ++ l₁ ++ t = l₂
h✝ : drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) l₂
⊢ l₁ <:+: take n l₂ ∨ l₁ <:+: drop (n + 1 - length l₁) l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_split | [1479, 1] | [1483, 54] | exists (drop (n + 1 - length l₁) s) | case inr.h
α✝ : Type u_1
l₁ l₂ : List α✝
h : l₁ <:+: l₂
n : ℕ
s : List α✝
hPre : ∃ t, s ++ l₁ ++ t = l₂
h✝ : drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) l₂
⊢ l₁ <:+: drop (n + 1 - length l₁) l₂ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case inr.h
α✝ : Type u_1
l₁ l₂ : List α✝
h : l₁ <:+: l₂
n : ℕ
s : List α✝
hPre : ∃ t, s ++ l₁ ++ t = l₂
h✝ : drop (n + 1 - length l₁) s ++ l₁ <+: drop (n + 1 - length l₁) l₂
⊢ l₁ <:+: drop (n + 1 - length l₁) l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_append_split_left | [1485, 1] | [1504, 20] | have split := List.isInfix_split h l₂.length | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
⊢ l₁ <:+: l₂ ∨ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃ | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
split : l₁ <:+: take (length l₂) (l₂ ++ l₃) ∨ l₁ <:+: drop (length l₂ + 1 - length l₁) (l₂ ++ l₃)
⊢ l₁ <:+: l₂ ∨ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃ | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
⊢ l₁ <:+: l₂ ∨ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_append_split_left | [1485, 1] | [1504, 20] | simp only [take_left, ge_iff_le] at split | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
split : l₁ <:+: take (length l₂) (l₂ ++ l₃) ∨ l₁ <:+: drop (length l₂ + 1 - length l₁) (l₂ ++ l₃)
⊢ l₁ <:+: l₂ ∨ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃ | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
split : l₁ <:+: l₂ ∨ l₁ <:+: drop (length l₂ + 1 - length l₁) (l₂ ++ l₃)
⊢ l₁ <:+: l₂ ∨ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃ | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
split : l₁ <:+: take (length l₂) (l₂ ++ l₃) ∨ l₁ <:+: drop (length l₂ + 1 - length l₁) (l₂ ++ l₃)
⊢ l₁ <:+: l₂ ∨ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_append_split_left | [1485, 1] | [1504, 20] | cases split with
| inl h₁ =>
left; assumption
| inr h₂ =>
right
if hzero: l₁.length = 0 then
simp [List.length_eq_zero.1 hzero]
else
rw [List.drop_append_of_le_length] at h₂
. rw [lastN]
convert h₂ using 3
rw [Nat.sub_sub_eq_add_sub_of_le]
rw [Nat.succ_le, pos_iff_ne_zero]
apply hzero
. simp only [ge_iff_le, tsub_le_iff_right, add_le_add_iff_left]
rw [Nat.succ_le, pos_iff_ne_zero]
apply hzero | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
split : l₁ <:+: l₂ ∨ l₁ <:+: drop (length l₂ + 1 - length l₁) (l₂ ++ l₃)
⊢ l₁ <:+: l₂ ∨ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
split : l₁ <:+: l₂ ∨ l₁ <:+: drop (length l₂ + 1 - length l₁) (l₂ ++ l₃)
⊢ l₁ <:+: l₂ ∨ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_append_split_left | [1485, 1] | [1504, 20] | left | case inl
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
h₁ : l₁ <:+: l₂
⊢ l₁ <:+: l₂ ∨ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃ | case inl.h
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
h₁ : l₁ <:+: l₂
⊢ l₁ <:+: l₂ | Please generate a tactic in lean4 to solve the state.
STATE:
case inl
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
h₁ : l₁ <:+: l₂
⊢ l₁ <:+: l₂ ∨ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_append_split_left | [1485, 1] | [1504, 20] | assumption | case inl.h
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
h₁ : l₁ <:+: l₂
⊢ l₁ <:+: l₂ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case inl.h
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
h₁ : l₁ <:+: l₂
⊢ l₁ <:+: l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_append_split_left | [1485, 1] | [1504, 20] | right | case inr
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
h₂ : l₁ <:+: drop (length l₂ + 1 - length l₁) (l₂ ++ l₃)
⊢ l₁ <:+: l₂ ∨ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃ | case inr.h
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
h₂ : l₁ <:+: drop (length l₂ + 1 - length l₁) (l₂ ++ l₃)
⊢ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃ | Please generate a tactic in lean4 to solve the state.
STATE:
case inr
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
h₂ : l₁ <:+: drop (length l₂ + 1 - length l₁) (l₂ ++ l₃)
⊢ l₁ <:+: l₂ ∨ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_append_split_left | [1485, 1] | [1504, 20] | if hzero: l₁.length = 0 then
simp [List.length_eq_zero.1 hzero]
else
rw [List.drop_append_of_le_length] at h₂
. rw [lastN]
convert h₂ using 3
rw [Nat.sub_sub_eq_add_sub_of_le]
rw [Nat.succ_le, pos_iff_ne_zero]
apply hzero
. simp only [ge_iff_le, tsub_le_iff_right, add_le_add_iff_left]
rw [Nat.succ_le, pos_iff_ne_zero]
apply hzero | case inr.h
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
h₂ : l₁ <:+: drop (length l₂ + 1 - length l₁) (l₂ ++ l₃)
⊢ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case inr.h
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
h₂ : l₁ <:+: drop (length l₂ + 1 - length l₁) (l₂ ++ l₃)
⊢ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_append_split_left | [1485, 1] | [1504, 20] | simp [List.length_eq_zero.1 hzero] | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
h₂ : l₁ <:+: drop (length l₂ + 1 - length l₁) (l₂ ++ l₃)
hzero : length l₁ = 0
⊢ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
h₂ : l₁ <:+: drop (length l₂ + 1 - length l₁) (l₂ ++ l₃)
hzero : length l₁ = 0
⊢ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_append_split_left | [1485, 1] | [1504, 20] | rw [List.drop_append_of_le_length] at h₂ | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
h₂ : l₁ <:+: drop (length l₂ + 1 - length l₁) (l₂ ++ l₃)
hzero : ¬length l₁ = 0
⊢ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃ | α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
h₂ : l₁ <:+: drop (length l₂ + 1 - length l₁) l₂ ++ l₃
hzero : ¬length l₁ = 0
⊢ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
h₂ : l₁ <:+: drop (length l₂ + 1 - length l₁) (l₂ ++ l₃)
hzero : ¬length l₁ = 0
⊢ length l₂ + 1 - length l₁ ≤ length l₂ | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ l₃ : List α✝
h : l₁ <:+: l₂ ++ l₃
h₂ : l₁ <:+: drop (length l₂ + 1 - length l₁) (l₂ ++ l₃)
hzero : ¬length l₁ = 0
⊢ l₁ <:+: lastN (length l₁ - 1) l₂ ++ l₃
TACTIC:
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.