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.count_nil | [2135, 1] | [2138, 19] | apply countp_nil | α : Type u_1
inst✝ : BEq α
a : α
⊢ countp (fun x => x == a) [] = 0 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝ : BEq α
a : α
⊢ countp (fun x => x == a) [] = 0
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_cons | [2140, 1] | [2142, 20] | unfold count | α : Type u_1
a : α
inst✝ : BEq α
head : α
tail : List α
⊢ count a (head :: tail) = (if (head == a) = true then 1 else 0) + count a tail | α : Type u_1
a : α
inst✝ : BEq α
head : α
tail : List α
⊢ countp (fun x => x == a) (head :: tail) = (if (head == a) = true then 1 else 0) + countp (fun x => x == a) tail | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
a : α
inst✝ : BEq α
head : α
tail : List α
⊢ count a (head :: tail) = (if (head == a) = true then 1 else 0) + count a tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_cons | [2140, 1] | [2142, 20] | apply countp_cons | α : Type u_1
a : α
inst✝ : BEq α
head : α
tail : List α
⊢ countp (fun x => x == a) (head :: tail) = (if (head == a) = true then 1 else 0) + countp (fun x => x == a) tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
a : α
inst✝ : BEq α
head : α
tail : List α
⊢ countp (fun x => x == a) (head :: tail) = (if (head == a) = true then 1 else 0) + countp (fun x => x == a) tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.countp_append | [2144, 1] | [2148, 117] | induction l₁ with
| nil => simp only [nil_append, countp_nil, zero_le, ge_iff_le, nonpos_iff_eq_zero, zero_add]
| cons head tail ih => simp only [cons_append, countp_cons, ih, zero_le, ge_iff_le, nonpos_iff_eq_zero, add_assoc] | α✝ : Type u_1
p : α✝ → Bool
l₁ l₂ : List α✝
⊢ countp p (l₁ ++ l₂) = countp p l₁ + countp p l₂ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
p : α✝ → Bool
l₁ l₂ : List α✝
⊢ countp p (l₁ ++ l₂) = countp p l₁ + countp p l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.countp_append | [2144, 1] | [2148, 117] | simp only [nil_append, countp_nil, zero_le, ge_iff_le, nonpos_iff_eq_zero, zero_add] | case nil
α✝ : Type u_1
p : α✝ → Bool
l₂ : List α✝
⊢ countp p ([] ++ l₂) = countp p [] + countp p l₂ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case nil
α✝ : Type u_1
p : α✝ → Bool
l₂ : List α✝
⊢ countp p ([] ++ l₂) = countp p [] + countp p l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.countp_append | [2144, 1] | [2148, 117] | simp only [cons_append, countp_cons, ih, zero_le, ge_iff_le, nonpos_iff_eq_zero, add_assoc] | case cons
α✝ : Type u_1
p : α✝ → Bool
l₂ : List α✝
head : α✝
tail : List α✝
ih : countp p (tail ++ l₂) = countp p tail + countp p l₂
⊢ countp p (head :: tail ++ l₂) = countp p (head :: tail) + countp p l₂ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case cons
α✝ : Type u_1
p : α✝ → Bool
l₂ : List α✝
head : α✝
tail : List α✝
ih : countp p (tail ++ l₂) = countp p tail + countp p l₂
⊢ countp p (head :: tail ++ l₂) = countp p (head :: tail) + countp p l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_append | [2150, 1] | [2153, 27] | unfold count | α : Type u_1
inst✝ : BEq α
a : α
l₁ l₂ : List α
⊢ count a (l₁ ++ l₂) = count a l₁ + count a l₂ | α : Type u_1
inst✝ : BEq α
a : α
l₁ l₂ : List α
⊢ countp (fun x => x == a) (l₁ ++ l₂) = countp (fun x => x == a) l₁ + countp (fun x => x == a) l₂ | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝ : BEq α
a : α
l₁ l₂ : List α
⊢ count a (l₁ ++ l₂) = count a l₁ + count a l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_append | [2150, 1] | [2153, 27] | apply List.countp_append | α : Type u_1
inst✝ : BEq α
a : α
l₁ l₂ : List α
⊢ countp (fun x => x == a) (l₁ ++ l₂) = countp (fun x => x == a) l₁ + countp (fun x => x == a) l₂ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝ : BEq α
a : α
l₁ l₂ : List α
⊢ countp (fun x => x == a) (l₁ ++ l₂) = countp (fun x => x == a) l₁ + countp (fun x => x == a) l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_countp_le | [2156, 1] | [2161, 11] | have ⟨s,t,heq⟩ := h | α✝ : Type u_1
l₁ l₂ : List α✝
p : α✝ → Bool
h : l₁ <:+: l₂
⊢ countp p l₁ ≤ countp p l₂ | α✝ : Type u_1
l₁ l₂ : List α✝
p : α✝ → Bool
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ countp p l₁ ≤ countp p l₂ | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ : List α✝
p : α✝ → Bool
h : l₁ <:+: l₂
⊢ countp p l₁ ≤ countp p l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_countp_le | [2156, 1] | [2161, 11] | apply_fun countp p at heq | α✝ : Type u_1
l₁ l₂ : List α✝
p : α✝ → Bool
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ countp p l₁ ≤ countp p l₂ | α✝ : Type u_1
l₁ l₂ : List α✝
p : α✝ → Bool
h : l₁ <:+: l₂
s t : List α✝
heq : countp p (s ++ l₁ ++ t) = countp p l₂
⊢ countp p l₁ ≤ countp p l₂ | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ : List α✝
p : α✝ → Bool
h : l₁ <:+: l₂
s t : List α✝
heq : s ++ l₁ ++ t = l₂
⊢ countp p l₁ ≤ countp p l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_countp_le | [2156, 1] | [2161, 11] | simp only [append_assoc, countp_append] at heq | α✝ : Type u_1
l₁ l₂ : List α✝
p : α✝ → Bool
h : l₁ <:+: l₂
s t : List α✝
heq : countp p (s ++ l₁ ++ t) = countp p l₂
⊢ countp p l₁ ≤ countp p l₂ | α✝ : Type u_1
l₁ l₂ : List α✝
p : α✝ → Bool
h : l₁ <:+: l₂
s t : List α✝
heq : countp p s + (countp p l₁ + countp p t) = countp p l₂
⊢ countp p l₁ ≤ countp p l₂ | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ : List α✝
p : α✝ → Bool
h : l₁ <:+: l₂
s t : List α✝
heq : countp p (s ++ l₁ ++ t) = countp p l₂
⊢ countp p l₁ ≤ countp p l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_countp_le | [2156, 1] | [2161, 11] | rw [← heq] | α✝ : Type u_1
l₁ l₂ : List α✝
p : α✝ → Bool
h : l₁ <:+: l₂
s t : List α✝
heq : countp p s + (countp p l₁ + countp p t) = countp p l₂
⊢ countp p l₁ ≤ countp p l₂ | α✝ : Type u_1
l₁ l₂ : List α✝
p : α✝ → Bool
h : l₁ <:+: l₂
s t : List α✝
heq : countp p s + (countp p l₁ + countp p t) = countp p l₂
⊢ countp p l₁ ≤ countp p s + (countp p l₁ + countp p t) | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ : List α✝
p : α✝ → Bool
h : l₁ <:+: l₂
s t : List α✝
heq : countp p s + (countp p l₁ + countp p t) = countp p l₂
⊢ countp p l₁ ≤ countp p l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_countp_le | [2156, 1] | [2161, 11] | linarith | α✝ : Type u_1
l₁ l₂ : List α✝
p : α✝ → Bool
h : l₁ <:+: l₂
s t : List α✝
heq : countp p s + (countp p l₁ + countp p t) = countp p l₂
⊢ countp p l₁ ≤ countp p s + (countp p l₁ + countp p t) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α✝ : Type u_1
l₁ l₂ : List α✝
p : α✝ → Bool
h : l₁ <:+: l₂
s t : List α✝
heq : countp p s + (countp p l₁ + countp p t) = countp p l₂
⊢ countp p l₁ ≤ countp p s + (countp p l₁ + countp p t)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_count_le | [2163, 1] | [2165, 33] | unfold count | α : Type u_1
inst✝ : BEq α
a : α
l₁ l₂ : List α
h : l₁ <:+: l₂
⊢ count a l₁ ≤ count a l₂ | α : Type u_1
inst✝ : BEq α
a : α
l₁ l₂ : List α
h : l₁ <:+: l₂
⊢ countp (fun x => x == a) l₁ ≤ countp (fun x => x == a) l₂ | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝ : BEq α
a : α
l₁ l₂ : List α
h : l₁ <:+: l₂
⊢ count a l₁ ≤ count a l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.isInfix_count_le | [2163, 1] | [2165, 33] | apply List.isInfix_countp_le h | α : Type u_1
inst✝ : BEq α
a : α
l₁ l₂ : List α
h : l₁ <:+: l₂
⊢ countp (fun x => x == a) l₁ ≤ countp (fun x => x == a) l₂ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝ : BEq α
a : α
l₁ l₂ : List α
h : l₁ <:+: l₂
⊢ countp (fun x => x == a) l₁ ≤ countp (fun x => x == a) l₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | apply Iff.intro | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a : α
l : List α
⊢ count a l > 0 ↔ a ∈ l | case mp
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a : α
l : List α
⊢ count a l > 0 → a ∈ l
case mpr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a : α
l : List α
⊢ a ∈ l → count a l > 0 | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a : α
l : List α
⊢ count a l > 0 ↔ a ∈ l
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | . intro count_pos
induction l with
| nil => simp only [count_nil, zero_le, ge_iff_le, nonpos_iff_eq_zero, lt_self_iff_false] at count_pos
| cons head tail ih=>
simp only [count_cons, beq_iff_eq, zero_le, ge_iff_le, nonpos_iff_eq_zero, gt_iff_lt, add_pos_iff] at count_pos
cases count_pos with
| inl hlt =>
split at hlt
case inl heq => simp at heq; simp [heq]
case inr heq => simp only at hlt
| inr hlt =>
apply mem_cons.2; right
apply ih hlt | case mp
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a : α
l : List α
⊢ count a l > 0 → a ∈ l
case mpr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a : α
l : List α
⊢ a ∈ l → count a l > 0 | case mpr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a : α
l : List α
⊢ a ∈ l → count a l > 0 | Please generate a tactic in lean4 to solve the state.
STATE:
case mp
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a : α
l : List α
⊢ count a l > 0 → a ∈ l
case mpr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a : α
l : List α
⊢ a ∈ l → count a l > 0
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | . intro ain
induction l with
| nil => simp only [not_mem_nil] at ain
| cons head tail ih =>
cases mem_cons.1 ain with
| inl heq =>
simp only [heq, count_cons, beq_self_eq_true, ite_true, zero_le, ge_iff_le, nonpos_iff_eq_zero, gt_iff_lt,
add_pos_iff, true_or]
| inr hin =>
simp only [count_cons, beq_iff_eq, zero_le, ge_iff_le, nonpos_iff_eq_zero, gt_iff_lt, add_pos_iff, ih hin, or_true] | case mpr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a : α
l : List α
⊢ a ∈ l → count a l > 0 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case mpr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a : α
l : List α
⊢ a ∈ l → count a l > 0
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | simp only [count_nil, zero_le, ge_iff_le, nonpos_iff_eq_zero, lt_self_iff_false] at count_pos | case mp.nil
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a : α
count_pos : count a [] > 0
⊢ a ∈ [] | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case mp.nil
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a : α
count_pos : count a [] > 0
⊢ a ∈ []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | simp only [count_cons, beq_iff_eq, zero_le, ge_iff_le, nonpos_iff_eq_zero, gt_iff_lt, add_pos_iff] at count_pos | case mp.cons
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
count_pos : count a (head :: tail) > 0
⊢ a ∈ head :: tail | case mp.cons
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
count_pos : (0 < if (head == a) = true then 1 else 0) ∨ 0 < count a tail
⊢ a ∈ head :: tail | Please generate a tactic in lean4 to solve the state.
STATE:
case mp.cons
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
count_pos : count a (head :: tail) > 0
⊢ a ∈ head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | cases count_pos with
| inl hlt =>
split at hlt
case inl heq => simp at heq; simp [heq]
case inr heq => simp only at hlt
| inr hlt =>
apply mem_cons.2; right
apply ih hlt | case mp.cons
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
count_pos : (0 < if (head == a) = true then 1 else 0) ∨ 0 < count a tail
⊢ a ∈ head :: tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case mp.cons
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
count_pos : (0 < if (head == a) = true then 1 else 0) ∨ 0 < count a tail
⊢ a ∈ head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | split at hlt | case mp.cons.inl
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
hlt : 0 < if (head == a) = true then 1 else 0
⊢ a ∈ head :: tail | case mp.cons.inl.inl
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
h✝ : (head == a) = true
hlt : 0 < 1
⊢ a ∈ head :: tail
case mp.cons.inl.inr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
h✝ : ¬(head == a) = true
hlt : 0 < 0
⊢ a ∈ head :: tail | Please generate a tactic in lean4 to solve the state.
STATE:
case mp.cons.inl
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
hlt : 0 < if (head == a) = true then 1 else 0
⊢ a ∈ head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | case inl heq => simp at heq; simp [heq] | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
heq : (head == a) = true
hlt : 0 < 1
⊢ a ∈ head :: tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
heq : (head == a) = true
hlt : 0 < 1
⊢ a ∈ head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | case inr heq => simp only at hlt | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
heq : ¬(head == a) = true
hlt : 0 < 0
⊢ a ∈ head :: tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
heq : ¬(head == a) = true
hlt : 0 < 0
⊢ a ∈ head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | simp at heq | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
heq : (head == a) = true
hlt : 0 < 1
⊢ a ∈ head :: tail | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
hlt : 0 < 1
heq : head = a
⊢ a ∈ head :: tail | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
heq : (head == a) = true
hlt : 0 < 1
⊢ a ∈ head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | simp [heq] | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
hlt : 0 < 1
heq : head = a
⊢ a ∈ head :: tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
hlt : 0 < 1
heq : head = a
⊢ a ∈ head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | simp only at hlt | α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
heq : ¬(head == a) = true
hlt : 0 < 0
⊢ a ∈ head :: tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
heq : ¬(head == a) = true
hlt : 0 < 0
⊢ a ∈ head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | apply mem_cons.2 | case mp.cons.inr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
hlt : 0 < count a tail
⊢ a ∈ head :: tail | case mp.cons.inr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
hlt : 0 < count a tail
⊢ a = head ∨ a ∈ tail | Please generate a tactic in lean4 to solve the state.
STATE:
case mp.cons.inr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
hlt : 0 < count a tail
⊢ a ∈ head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | right | case mp.cons.inr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
hlt : 0 < count a tail
⊢ a = head ∨ a ∈ tail | case mp.cons.inr.h
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
hlt : 0 < count a tail
⊢ a ∈ tail | Please generate a tactic in lean4 to solve the state.
STATE:
case mp.cons.inr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
hlt : 0 < count a tail
⊢ a = head ∨ a ∈ tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | apply ih hlt | case mp.cons.inr.h
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
hlt : 0 < count a tail
⊢ a ∈ tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case mp.cons.inr.h
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : count a tail > 0 → a ∈ tail
hlt : 0 < count a tail
⊢ a ∈ tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | simp only [not_mem_nil] at ain | case mpr.nil
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a : α
ain : a ∈ []
⊢ count a [] > 0 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case mpr.nil
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a : α
ain : a ∈ []
⊢ count a [] > 0
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | cases mem_cons.1 ain with
| inl heq =>
simp only [heq, count_cons, beq_self_eq_true, ite_true, zero_le, ge_iff_le, nonpos_iff_eq_zero, gt_iff_lt,
add_pos_iff, true_or]
| inr hin =>
simp only [count_cons, beq_iff_eq, zero_le, ge_iff_le, nonpos_iff_eq_zero, gt_iff_lt, add_pos_iff, ih hin, or_true] | case mpr.cons
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : a ∈ tail → count a tail > 0
ain : a ∈ head :: tail
⊢ count a (head :: tail) > 0 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case mpr.cons
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : a ∈ tail → count a tail > 0
ain : a ∈ head :: tail
⊢ count a (head :: tail) > 0
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | simp only [heq, count_cons, beq_self_eq_true, ite_true, zero_le, ge_iff_le, nonpos_iff_eq_zero, gt_iff_lt,
add_pos_iff, true_or] | case mpr.cons.inl
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : a ∈ tail → count a tail > 0
ain : a ∈ head :: tail
heq : a = head
⊢ count a (head :: tail) > 0 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case mpr.cons.inl
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : a ∈ tail → count a tail > 0
ain : a ∈ head :: tail
heq : a = head
⊢ count a (head :: tail) > 0
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.count_pos_iff_mem | [2167, 1] | [2191, 124] | simp only [count_cons, beq_iff_eq, zero_le, ge_iff_le, nonpos_iff_eq_zero, gt_iff_lt, add_pos_iff, ih hin, or_true] | case mpr.cons.inr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : a ∈ tail → count a tail > 0
ain : a ∈ head :: tail
hin : a ∈ tail
⊢ count a (head :: tail) > 0 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case mpr.cons.inr
α : Type u_1
inst✝¹ : BEq α
inst✝ : LawfulBEq α
a head : α
tail : List α
ih : a ∈ tail → count a tail > 0
ain : a ∈ head :: tail
hin : a ∈ tail
⊢ count a (head :: tail) > 0
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | induction l with
| nil =>
contradiction
| cons head tail ih=>
cases delim
case nil =>
simp only [find?, mem_cons, dropLast, append_nil, nil_isInfix, not_true, forall_eq_or_imp, false_and] at h head
case cons dhead dtail=>
unfold intercalate
cases h₂:tail with
| nil =>
subst tail
simp only [join, append_nil]
apply List.splitOnList_nonmatching
have h₃ := (h head (List.mem_singleton_self _))
intro ⟨s,t, hcontr⟩
apply h₃
exists s, (t ++ dropLast (dhead :: dtail))
simp only [append_assoc, cons_append, ← hcontr]
| cons mid tail₂ =>
simp only [join]
rw [← List.append_assoc, List.splitOnList_progress, ← List.intercalate, ← h₂, ih]
. simp only [singleton_append]
. intro e ein
apply h
subst h₂
simp_all only [find?, mem_cons, ne_eq, not_false_iff, or_true, implies_true, forall_const, forall_true_left,
forall_eq_or_imp]
. simp only [h₂, ne_eq, not_false_iff]
. intro contr
apply h head
apply List.mem_cons_self
exact contr | α : Type u_1
inst✝ : DecidableEq α
delim : List α
l : List (List α)
h : ∀ (e : List α), e ∈ l → ¬delim <:+: e ++ dropLast delim
h₂ : l ≠ []
⊢ splitOnList delim (intercalate delim l) = l | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝ : DecidableEq α
delim : List α
l : List (List α)
h : ∀ (e : List α), e ∈ l → ¬delim <:+: e ++ dropLast delim
h₂ : l ≠ []
⊢ splitOnList delim (intercalate delim l) = l
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | contradiction | case nil
α : Type u_1
inst✝ : DecidableEq α
delim : List α
h : ∀ (e : List α), e ∈ [] → ¬delim <:+: e ++ dropLast delim
h₂ : [] ≠ []
⊢ splitOnList delim (intercalate delim []) = [] | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case nil
α : Type u_1
inst✝ : DecidableEq α
delim : List α
h : ∀ (e : List α), e ∈ [] → ¬delim <:+: e ++ dropLast delim
h₂ : [] ≠ []
⊢ splitOnList delim (intercalate delim []) = []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | cases delim | case cons
α : Type u_1
inst✝ : DecidableEq α
delim head : List α
tail : List (List α)
ih :
(∀ (e : List α), e ∈ tail → ¬delim <:+: e ++ dropLast delim) →
tail ≠ [] → splitOnList delim (intercalate delim tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬delim <:+: e ++ dropLast delim
h₂ : head :: tail ≠ []
⊢ splitOnList delim (intercalate delim (head :: tail)) = head :: tail | case cons.nil
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂ : head :: tail ≠ []
ih : (∀ (e : List α), e ∈ tail → ¬[] <:+: e ++ dropLast []) → tail ≠ [] → splitOnList [] (intercalate [] tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬[] <:+: e ++ dropLast []
⊢ splitOnList [] (intercalate [] (head :: tail)) = head :: tail
case cons.cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂ : head :: tail ≠ []
head✝ : α
tail✝ : List α
ih :
(∀ (e : List α), e ∈ tail → ¬head✝ :: tail✝ <:+: e ++ dropLast (head✝ :: tail✝)) →
tail ≠ [] → splitOnList (head✝ :: tail✝) (intercalate (head✝ :: tail✝) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬head✝ :: tail✝ <:+: e ++ dropLast (head✝ :: tail✝)
⊢ splitOnList (head✝ :: tail✝) (intercalate (head✝ :: tail✝) (head :: tail)) = head :: tail | Please generate a tactic in lean4 to solve the state.
STATE:
case cons
α : Type u_1
inst✝ : DecidableEq α
delim head : List α
tail : List (List α)
ih :
(∀ (e : List α), e ∈ tail → ¬delim <:+: e ++ dropLast delim) →
tail ≠ [] → splitOnList delim (intercalate delim tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬delim <:+: e ++ dropLast delim
h₂ : head :: tail ≠ []
⊢ splitOnList delim (intercalate delim (head :: tail)) = head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | case nil =>
simp only [find?, mem_cons, dropLast, append_nil, nil_isInfix, not_true, forall_eq_or_imp, false_and] at h head | α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂ : head :: tail ≠ []
ih : (∀ (e : List α), e ∈ tail → ¬[] <:+: e ++ dropLast []) → tail ≠ [] → splitOnList [] (intercalate [] tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬[] <:+: e ++ dropLast []
⊢ splitOnList [] (intercalate [] (head :: tail)) = head :: tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂ : head :: tail ≠ []
ih : (∀ (e : List α), e ∈ tail → ¬[] <:+: e ++ dropLast []) → tail ≠ [] → splitOnList [] (intercalate [] tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬[] <:+: e ++ dropLast []
⊢ splitOnList [] (intercalate [] (head :: tail)) = head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | case cons dhead dtail=>
unfold intercalate
cases h₂:tail with
| nil =>
subst tail
simp only [join, append_nil]
apply List.splitOnList_nonmatching
have h₃ := (h head (List.mem_singleton_self _))
intro ⟨s,t, hcontr⟩
apply h₃
exists s, (t ++ dropLast (dhead :: dtail))
simp only [append_assoc, cons_append, ← hcontr]
| cons mid tail₂ =>
simp only [join]
rw [← List.append_assoc, List.splitOnList_progress, ← List.intercalate, ← h₂, ih]
. simp only [singleton_append]
. intro e ein
apply h
subst h₂
simp_all only [find?, mem_cons, ne_eq, not_false_iff, or_true, implies_true, forall_const, forall_true_left,
forall_eq_or_imp]
. simp only [h₂, ne_eq, not_false_iff]
. intro contr
apply h head
apply List.mem_cons_self
exact contr | α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
⊢ splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) (head :: tail)) = head :: tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
⊢ splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) (head :: tail)) = head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | simp only [find?, mem_cons, dropLast, append_nil, nil_isInfix, not_true, forall_eq_or_imp, false_and] at h head | α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂ : head :: tail ≠ []
ih : (∀ (e : List α), e ∈ tail → ¬[] <:+: e ++ dropLast []) → tail ≠ [] → splitOnList [] (intercalate [] tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬[] <:+: e ++ dropLast []
⊢ splitOnList [] (intercalate [] (head :: tail)) = head :: tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂ : head :: tail ≠ []
ih : (∀ (e : List α), e ∈ tail → ¬[] <:+: e ++ dropLast []) → tail ≠ [] → splitOnList [] (intercalate [] tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬[] <:+: e ++ dropLast []
⊢ splitOnList [] (intercalate [] (head :: tail)) = head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | unfold intercalate | α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
⊢ splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) (head :: tail)) = head :: tail | α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
⊢ splitOnList (dhead :: dtail) (join (intersperse (dhead :: dtail) (head :: tail))) = head :: tail | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
⊢ splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) (head :: tail)) = head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | cases h₂:tail with
| nil =>
subst tail
simp only [join, append_nil]
apply List.splitOnList_nonmatching
have h₃ := (h head (List.mem_singleton_self _))
intro ⟨s,t, hcontr⟩
apply h₃
exists s, (t ++ dropLast (dhead :: dtail))
simp only [append_assoc, cons_append, ← hcontr]
| cons mid tail₂ =>
simp only [join]
rw [← List.append_assoc, List.splitOnList_progress, ← List.intercalate, ← h₂, ih]
. simp only [singleton_append]
. intro e ein
apply h
subst h₂
simp_all only [find?, mem_cons, ne_eq, not_false_iff, or_true, implies_true, forall_const, forall_true_left,
forall_eq_or_imp]
. simp only [h₂, ne_eq, not_false_iff]
. intro contr
apply h head
apply List.mem_cons_self
exact contr | α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
⊢ splitOnList (dhead :: dtail) (join (intersperse (dhead :: dtail) (head :: tail))) = head :: tail | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
⊢ splitOnList (dhead :: dtail) (join (intersperse (dhead :: dtail) (head :: tail))) = head :: tail
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | subst tail | case nil
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
h₂ : tail = []
⊢ splitOnList (dhead :: dtail) (join (intersperse (dhead :: dtail) [head])) = [head] | case nil
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
⊢ splitOnList (dhead :: dtail) (join (intersperse (dhead :: dtail) [head])) = [head] | Please generate a tactic in lean4 to solve the state.
STATE:
case nil
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
h₂ : tail = []
⊢ splitOnList (dhead :: dtail) (join (intersperse (dhead :: dtail) [head])) = [head]
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | simp only [join, append_nil] | case nil
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
⊢ splitOnList (dhead :: dtail) (join (intersperse (dhead :: dtail) [head])) = [head] | case nil
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
⊢ splitOnList (dhead :: dtail) head = [head] | Please generate a tactic in lean4 to solve the state.
STATE:
case nil
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
⊢ splitOnList (dhead :: dtail) (join (intersperse (dhead :: dtail) [head])) = [head]
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | apply List.splitOnList_nonmatching | case nil
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
⊢ splitOnList (dhead :: dtail) head = [head] | case nil.h₁
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
⊢ ¬dhead :: dtail <:+: head | Please generate a tactic in lean4 to solve the state.
STATE:
case nil
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
⊢ splitOnList (dhead :: dtail) head = [head]
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | have h₃ := (h head (List.mem_singleton_self _)) | case nil.h₁
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
⊢ ¬dhead :: dtail <:+: head | case nil.h₁
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
h₃ : ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail)
⊢ ¬dhead :: dtail <:+: head | Please generate a tactic in lean4 to solve the state.
STATE:
case nil.h₁
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
⊢ ¬dhead :: dtail <:+: head
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | intro ⟨s,t, hcontr⟩ | case nil.h₁
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
h₃ : ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail)
⊢ ¬dhead :: dtail <:+: head | case nil.h₁
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
h₃ : ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail)
s t : List α
hcontr : s ++ dhead :: dtail ++ t = head
⊢ False | Please generate a tactic in lean4 to solve the state.
STATE:
case nil.h₁
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
h₃ : ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail)
⊢ ¬dhead :: dtail <:+: head
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | apply h₃ | case nil.h₁
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
h₃ : ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail)
s t : List α
hcontr : s ++ dhead :: dtail ++ t = head
⊢ False | case nil.h₁
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
h₃ : ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail)
s t : List α
hcontr : s ++ dhead :: dtail ++ t = head
⊢ dhead :: dtail <:+: head ++ dropLast (dhead :: dtail) | Please generate a tactic in lean4 to solve the state.
STATE:
case nil.h₁
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
h₃ : ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail)
s t : List α
hcontr : s ++ dhead :: dtail ++ t = head
⊢ False
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | exists s, (t ++ dropLast (dhead :: dtail)) | case nil.h₁
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
h₃ : ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail)
s t : List α
hcontr : s ++ dhead :: dtail ++ t = head
⊢ dhead :: dtail <:+: head ++ dropLast (dhead :: dtail) | case nil.h₁
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
h₃ : ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail)
s t : List α
hcontr : s ++ dhead :: dtail ++ t = head
⊢ s ++ dhead :: dtail ++ (t ++ dropLast (dhead :: dtail)) = head ++ dropLast (dhead :: dtail) | Please generate a tactic in lean4 to solve the state.
STATE:
case nil.h₁
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
h₃ : ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail)
s t : List α
hcontr : s ++ dhead :: dtail ++ t = head
⊢ dhead :: dtail <:+: head ++ dropLast (dhead :: dtail)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | simp only [append_assoc, cons_append, ← hcontr] | case nil.h₁
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
h₃ : ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail)
s t : List α
hcontr : s ++ dhead :: dtail ++ t = head
⊢ s ++ dhead :: dtail ++ (t ++ dropLast (dhead :: dtail)) = head ++ dropLast (dhead :: dtail) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case nil.h₁
α : Type u_1
inst✝ : DecidableEq α
head : List α
dhead : α
dtail : List α
h₂ : [head] ≠ []
ih :
(∀ (e : List α), e ∈ [] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
[] ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) []) = []
h : ∀ (e : List α), e ∈ [head] → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
h₃ : ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail)
s t : List α
hcontr : s ++ dhead :: dtail ++ t = head
⊢ s ++ dhead :: dtail ++ (t ++ dropLast (dhead :: dtail)) = head ++ dropLast (dhead :: dtail)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | simp only [join] | case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ splitOnList (dhead :: dtail) (join (intersperse (dhead :: dtail) (head :: mid :: tail₂))) = head :: mid :: tail₂ | case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ splitOnList (dhead :: dtail) (head ++ (dhead :: dtail ++ join (intersperse (dhead :: dtail) (mid :: tail₂)))) =
head :: mid :: tail₂ | Please generate a tactic in lean4 to solve the state.
STATE:
case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ splitOnList (dhead :: dtail) (join (intersperse (dhead :: dtail) (head :: mid :: tail₂))) = head :: mid :: tail₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | rw [← List.append_assoc, List.splitOnList_progress, ← List.intercalate, ← h₂, ih] | case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ splitOnList (dhead :: dtail) (head ++ (dhead :: dtail ++ join (intersperse (dhead :: dtail) (mid :: tail₂)))) =
head :: mid :: tail₂ | case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ [head] ++ tail = head :: tail
case cons.h
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ ∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
case cons.h₂
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ tail ≠ []
case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail) | Please generate a tactic in lean4 to solve the state.
STATE:
case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ splitOnList (dhead :: dtail) (head ++ (dhead :: dtail ++ join (intersperse (dhead :: dtail) (mid :: tail₂)))) =
head :: mid :: tail₂
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | . simp only [singleton_append] | case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ [head] ++ tail = head :: tail
case cons.h
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ ∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
case cons.h₂
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ tail ≠ []
case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail) | case cons.h
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ ∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
case cons.h₂
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ tail ≠ []
case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail) | Please generate a tactic in lean4 to solve the state.
STATE:
case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ [head] ++ tail = head :: tail
case cons.h
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ ∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
case cons.h₂
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ tail ≠ []
case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | . intro e ein
apply h
subst h₂
simp_all only [find?, mem_cons, ne_eq, not_false_iff, or_true, implies_true, forall_const, forall_true_left,
forall_eq_or_imp] | case cons.h
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ ∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
case cons.h₂
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ tail ≠ []
case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail) | case cons.h₂
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ tail ≠ []
case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail) | Please generate a tactic in lean4 to solve the state.
STATE:
case cons.h
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ ∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
case cons.h₂
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ tail ≠ []
case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | . simp only [h₂, ne_eq, not_false_iff] | case cons.h₂
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ tail ≠ []
case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail) | case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail) | Please generate a tactic in lean4 to solve the state.
STATE:
case cons.h₂
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ tail ≠ []
case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.splitOnList_intercalate | [2194, 1] | [2228, 22] | . intro contr
apply h head
apply List.mem_cons_self
exact contr | case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case cons
α : Type u_1
inst✝ : DecidableEq α
head : List α
tail : List (List α)
h₂✝ : head :: tail ≠ []
dhead : α
dtail : List α
ih :
(∀ (e : List α), e ∈ tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)) →
tail ≠ [] → splitOnList (dhead :: dtail) (intercalate (dhead :: dtail) tail) = tail
h : ∀ (e : List α), e ∈ head :: tail → ¬dhead :: dtail <:+: e ++ dropLast (dhead :: dtail)
mid : List α
tail₂ : List (List α)
h₂ : tail = mid :: tail₂
⊢ ¬dhead :: dtail <:+: head ++ dropLast (dhead :: dtail)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | convIf.id | [2258, 1] | [2260, 21] | simp[convIf] | α : Sort u_1
P : Prop
inst : Decidable P
a : α
⊢ a = convIf P inst (fun x => a) fun x => a | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Sort u_1
P : Prop
inst : Decidable P
a : α
⊢ a = convIf P inst (fun x => a) fun x => a
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | if hempty: elf = [] then
intro contr
have contr := List.isInfix_length contr
simp only [List.length_cons, List.length_singleton, elfToString, hempty,
List.map] at contr
else
unfold elfToString
intro contr
apply List.not_isInfix_intercalate_by_element ['\n', '\n'] ['\n'] (List.map Int.reprΔ elf)
. simp only [List.mem_map', forall_exists_index, and_imp, forall_apply_eq_imp_iff₂]
intro a _ contr₂
cases List.isInfix_append_split_right contr₂ with
| inl h₁ =>
cases List.isInfix_append_split_left h₁ with
| inl h₂ =>
have h₃ := List.isInfix_drop_of_isInfix_append h₂
simp only [List.drop, List.singleton_isInfix_iff_mem] at h₃
apply Int.not_newline_mem_reprΔ h₃
| inr h₄ =>
simp only [List.length_cons, List.length_singleton, ge_iff_le, Nat.succ_sub_succ_eq_sub, tsub_zero,
List.singleton_append, List.lastN_one_eq_getLast, List.take, List.length,List.getLast?_cons] at h₄
rw [Option.to_list_some] at h₄
have newline_in_repr := List.isInfix_take_of_isInfix_append h₄
simp only [List.take, List.singleton_isInfix_iff_mem, List.mem_singleton] at newline_in_repr
rw [List.getLastD_ne_nil] at newline_in_repr
apply Int.not_newline_mem_reprΔ (n:=a)
rw [newline_in_repr]
apply List.getLast_mem
apply Int.reprΔ_ne_nil a
| inr h₅ =>
have hlen := List.isInfix_length h₅
simp only at hlen
. simp only
. simp only [ne_eq, List.map_eq_nil, hempty, not_false_iff]
. apply List.isInfix_append_right_of_isInfix
apply List.isInfix_append_left_of_isInfix
exact contr | elf : List ℤ
⊢ ¬[Char.ofNat 10, Char.ofNat 10] <:+: elfToString elf | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
⊢ ¬[Char.ofNat 10, Char.ofNat 10] <:+: elfToString elf
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | intro contr | elf : List ℤ
hempty : elf = []
⊢ ¬[Char.ofNat 10, Char.ofNat 10] <:+: elfToString elf | elf : List ℤ
hempty : elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: elfToString elf
⊢ False | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
hempty : elf = []
⊢ ¬[Char.ofNat 10, Char.ofNat 10] <:+: elfToString elf
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | have contr := List.isInfix_length contr | elf : List ℤ
hempty : elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: elfToString elf
⊢ False | elf : List ℤ
hempty : elf = []
contr✝ : [Char.ofNat 10, Char.ofNat 10] <:+: elfToString elf
contr : List.length [Char.ofNat 10, Char.ofNat 10] ≤ List.length (elfToString elf)
⊢ False | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
hempty : elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: elfToString elf
⊢ False
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | simp only [List.length_cons, List.length_singleton, elfToString, hempty,
List.map] at contr | elf : List ℤ
hempty : elf = []
contr✝ : [Char.ofNat 10, Char.ofNat 10] <:+: elfToString elf
contr : List.length [Char.ofNat 10, Char.ofNat 10] ≤ List.length (elfToString elf)
⊢ False | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
hempty : elf = []
contr✝ : [Char.ofNat 10, Char.ofNat 10] <:+: elfToString elf
contr : List.length [Char.ofNat 10, Char.ofNat 10] ≤ List.length (elfToString elf)
⊢ False
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | unfold elfToString | elf : List ℤ
hempty : ¬elf = []
⊢ ¬[Char.ofNat 10, Char.ofNat 10] <:+: elfToString elf | elf : List ℤ
hempty : ¬elf = []
⊢ ¬[Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
hempty : ¬elf = []
⊢ ¬[Char.ofNat 10, Char.ofNat 10] <:+: elfToString elf
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | intro contr | elf : List ℤ
hempty : ¬elf = []
⊢ ¬[Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) | elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ False | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
hempty : ¬elf = []
⊢ ¬[Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | apply List.not_isInfix_intercalate_by_element ['\n', '\n'] ['\n'] (List.map Int.reprΔ elf) | elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ False | case h
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ ∀ (e : List Char),
e ∈ List.map Int.reprΔ elf → ¬[Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ e ++ [Char.ofNat 10]
case hlen
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ List.length [Char.ofNat 10, Char.ofNat 10] ≤ 1 + List.length [Char.ofNat 10]
case hne_nil
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ List.map Int.reprΔ elf ≠ []
case a
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ [Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) ++ [Char.ofNat 10] | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ False
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | . simp only [List.mem_map', forall_exists_index, and_imp, forall_apply_eq_imp_iff₂]
intro a _ contr₂
cases List.isInfix_append_split_right contr₂ with
| inl h₁ =>
cases List.isInfix_append_split_left h₁ with
| inl h₂ =>
have h₃ := List.isInfix_drop_of_isInfix_append h₂
simp only [List.drop, List.singleton_isInfix_iff_mem] at h₃
apply Int.not_newline_mem_reprΔ h₃
| inr h₄ =>
simp only [List.length_cons, List.length_singleton, ge_iff_le, Nat.succ_sub_succ_eq_sub, tsub_zero,
List.singleton_append, List.lastN_one_eq_getLast, List.take, List.length,List.getLast?_cons] at h₄
rw [Option.to_list_some] at h₄
have newline_in_repr := List.isInfix_take_of_isInfix_append h₄
simp only [List.take, List.singleton_isInfix_iff_mem, List.mem_singleton] at newline_in_repr
rw [List.getLastD_ne_nil] at newline_in_repr
apply Int.not_newline_mem_reprΔ (n:=a)
rw [newline_in_repr]
apply List.getLast_mem
apply Int.reprΔ_ne_nil a
| inr h₅ =>
have hlen := List.isInfix_length h₅
simp only at hlen | case h
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ ∀ (e : List Char),
e ∈ List.map Int.reprΔ elf → ¬[Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ e ++ [Char.ofNat 10]
case hlen
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ List.length [Char.ofNat 10, Char.ofNat 10] ≤ 1 + List.length [Char.ofNat 10]
case hne_nil
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ List.map Int.reprΔ elf ≠ []
case a
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ [Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) ++ [Char.ofNat 10] | case hlen
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ List.length [Char.ofNat 10, Char.ofNat 10] ≤ 1 + List.length [Char.ofNat 10]
case hne_nil
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ List.map Int.reprΔ elf ≠ []
case a
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ [Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) ++ [Char.ofNat 10] | Please generate a tactic in lean4 to solve the state.
STATE:
case h
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ ∀ (e : List Char),
e ∈ List.map Int.reprΔ elf → ¬[Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ e ++ [Char.ofNat 10]
case hlen
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ List.length [Char.ofNat 10, Char.ofNat 10] ≤ 1 + List.length [Char.ofNat 10]
case hne_nil
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ List.map Int.reprΔ elf ≠ []
case a
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ [Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) ++ [Char.ofNat 10]
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | . simp only | case hlen
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ List.length [Char.ofNat 10, Char.ofNat 10] ≤ 1 + List.length [Char.ofNat 10]
case hne_nil
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ List.map Int.reprΔ elf ≠ []
case a
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ [Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) ++ [Char.ofNat 10] | case hne_nil
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ List.map Int.reprΔ elf ≠ []
case a
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ [Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) ++ [Char.ofNat 10] | Please generate a tactic in lean4 to solve the state.
STATE:
case hlen
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ List.length [Char.ofNat 10, Char.ofNat 10] ≤ 1 + List.length [Char.ofNat 10]
case hne_nil
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ List.map Int.reprΔ elf ≠ []
case a
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ [Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) ++ [Char.ofNat 10]
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | . simp only [ne_eq, List.map_eq_nil, hempty, not_false_iff] | case hne_nil
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ List.map Int.reprΔ elf ≠ []
case a
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ [Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) ++ [Char.ofNat 10] | case a
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ [Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) ++ [Char.ofNat 10] | Please generate a tactic in lean4 to solve the state.
STATE:
case hne_nil
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ List.map Int.reprΔ elf ≠ []
case a
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ [Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) ++ [Char.ofNat 10]
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | . apply List.isInfix_append_right_of_isInfix
apply List.isInfix_append_left_of_isInfix
exact contr | case a
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ [Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) ++ [Char.ofNat 10] | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case a
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
⊢ [Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) ++ [Char.ofNat 10]
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | cases List.isInfix_append_split_left h₁ with
| inl h₂ =>
have h₃ := List.isInfix_drop_of_isInfix_append h₂
simp only [List.drop, List.singleton_isInfix_iff_mem] at h₃
apply Int.not_newline_mem_reprΔ h₃
| inr h₄ =>
simp only [List.length_cons, List.length_singleton, ge_iff_le, Nat.succ_sub_succ_eq_sub, tsub_zero,
List.singleton_append, List.lastN_one_eq_getLast, List.take, List.length,List.getLast?_cons] at h₄
rw [Option.to_list_some] at h₄
have newline_in_repr := List.isInfix_take_of_isInfix_append h₄
simp only [List.take, List.singleton_isInfix_iff_mem, List.mem_singleton] at newline_in_repr
rw [List.getLastD_ne_nil] at newline_in_repr
apply Int.not_newline_mem_reprΔ (n:=a)
rw [newline_in_repr]
apply List.getLast_mem
apply Int.reprΔ_ne_nil a | case h.inl
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
⊢ False | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case h.inl
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
⊢ False
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | have h₃ := List.isInfix_drop_of_isInfix_append h₂ | case h.inl.inl
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a
⊢ False | case h.inl.inl
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a
h₃ : List.drop (List.length [Char.ofNat 10]) [Char.ofNat 10, Char.ofNat 10] <:+: Int.reprΔ a
⊢ False | Please generate a tactic in lean4 to solve the state.
STATE:
case h.inl.inl
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a
⊢ False
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | simp only [List.drop, List.singleton_isInfix_iff_mem] at h₃ | case h.inl.inl
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a
h₃ : List.drop (List.length [Char.ofNat 10]) [Char.ofNat 10, Char.ofNat 10] <:+: Int.reprΔ a
⊢ False | case h.inl.inl
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a
h₃ : Char.ofNat 10 ∈ Int.reprΔ a
⊢ False | Please generate a tactic in lean4 to solve the state.
STATE:
case h.inl.inl
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a
h₃ : List.drop (List.length [Char.ofNat 10]) [Char.ofNat 10, Char.ofNat 10] <:+: Int.reprΔ a
⊢ False
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | apply Int.not_newline_mem_reprΔ h₃ | case h.inl.inl
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a
h₃ : Char.ofNat 10 ∈ Int.reprΔ a
⊢ False | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case h.inl.inl
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a
h₃ : Char.ofNat 10 ∈ Int.reprΔ a
⊢ False
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | simp only [List.length_cons, List.length_singleton, ge_iff_le, Nat.succ_sub_succ_eq_sub, tsub_zero,
List.singleton_append, List.lastN_one_eq_getLast, List.take, List.length,List.getLast?_cons] at h₄ | case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ :
[Char.ofNat 10, Char.ofNat 10] <:+:
List.lastN (List.length [Char.ofNat 10, Char.ofNat 10] - 1) ([Char.ofNat 10] ++ Int.reprΔ a) ++
List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
⊢ False | case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ :
[Char.ofNat 10, Char.ofNat 10] <:+:
Option.toList (some (List.getLastD (Int.reprΔ a) (Char.ofNat 10))) ++ [Char.ofNat 10]
⊢ False | Please generate a tactic in lean4 to solve the state.
STATE:
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ :
[Char.ofNat 10, Char.ofNat 10] <:+:
List.lastN (List.length [Char.ofNat 10, Char.ofNat 10] - 1) ([Char.ofNat 10] ++ Int.reprΔ a) ++
List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
⊢ False
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | rw [Option.to_list_some] at h₄ | case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ :
[Char.ofNat 10, Char.ofNat 10] <:+:
Option.toList (some (List.getLastD (Int.reprΔ a) (Char.ofNat 10))) ++ [Char.ofNat 10]
⊢ False | case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
⊢ False | Please generate a tactic in lean4 to solve the state.
STATE:
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ :
[Char.ofNat 10, Char.ofNat 10] <:+:
Option.toList (some (List.getLastD (Int.reprΔ a) (Char.ofNat 10))) ++ [Char.ofNat 10]
⊢ False
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | have newline_in_repr := List.isInfix_take_of_isInfix_append h₄ | case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
⊢ False | case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr :
List.take (List.length [Char.ofNat 10, Char.ofNat 10] - List.length [Char.ofNat 10])
[Char.ofNat 10, Char.ofNat 10] <:+:
[List.getLastD (Int.reprΔ a) (Char.ofNat 10)]
⊢ False | Please generate a tactic in lean4 to solve the state.
STATE:
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
⊢ False
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | simp only [List.take, List.singleton_isInfix_iff_mem, List.mem_singleton] at newline_in_repr | case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr :
List.take (List.length [Char.ofNat 10, Char.ofNat 10] - List.length [Char.ofNat 10])
[Char.ofNat 10, Char.ofNat 10] <:+:
[List.getLastD (Int.reprΔ a) (Char.ofNat 10)]
⊢ False | case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ False | Please generate a tactic in lean4 to solve the state.
STATE:
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr :
List.take (List.length [Char.ofNat 10, Char.ofNat 10] - List.length [Char.ofNat 10])
[Char.ofNat 10, Char.ofNat 10] <:+:
[List.getLastD (Int.reprΔ a) (Char.ofNat 10)]
⊢ False
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | rw [List.getLastD_ne_nil] at newline_in_repr | case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ False | case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr✝ : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
newline_in_repr : Char.ofNat 10 = List.getLast (Int.reprΔ a) ?h.inl.inr
⊢ False
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ Int.reprΔ a ≠ [] | Please generate a tactic in lean4 to solve the state.
STATE:
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ False
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | apply Int.not_newline_mem_reprΔ (n:=a) | case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr✝ : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
newline_in_repr : Char.ofNat 10 = List.getLast (Int.reprΔ a) ?h.inl.inr
⊢ False
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ Int.reprΔ a ≠ [] | case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr✝ : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
newline_in_repr : Char.ofNat 10 = List.getLast (Int.reprΔ a) ?h.inl.inr
⊢ Char.ofNat 10 ∈ Int.reprΔ a
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ Int.reprΔ a ≠ [] | Please generate a tactic in lean4 to solve the state.
STATE:
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr✝ : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
newline_in_repr : Char.ofNat 10 = List.getLast (Int.reprΔ a) ?h.inl.inr
⊢ False
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ Int.reprΔ a ≠ []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | rw [newline_in_repr] | case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr✝ : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
newline_in_repr : Char.ofNat 10 = List.getLast (Int.reprΔ a) ?h.inl.inr
⊢ Char.ofNat 10 ∈ Int.reprΔ a
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ Int.reprΔ a ≠ [] | case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr✝ : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
newline_in_repr : Char.ofNat 10 = List.getLast (Int.reprΔ a) ?h.inl.inr
⊢ List.getLast (Int.reprΔ a) ?h.inl.inr ∈ Int.reprΔ a
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ Int.reprΔ a ≠ []
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ Int.reprΔ a ≠ [] | Please generate a tactic in lean4 to solve the state.
STATE:
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr✝ : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
newline_in_repr : Char.ofNat 10 = List.getLast (Int.reprΔ a) ?h.inl.inr
⊢ Char.ofNat 10 ∈ Int.reprΔ a
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ Int.reprΔ a ≠ []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | apply List.getLast_mem | case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr✝ : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
newline_in_repr : Char.ofNat 10 = List.getLast (Int.reprΔ a) ?h.inl.inr
⊢ List.getLast (Int.reprΔ a) ?h.inl.inr ∈ Int.reprΔ a
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ Int.reprΔ a ≠ []
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ Int.reprΔ a ≠ [] | case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ Int.reprΔ a ≠ []
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ Int.reprΔ a ≠ [] | Please generate a tactic in lean4 to solve the state.
STATE:
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr✝ : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
newline_in_repr : Char.ofNat 10 = List.getLast (Int.reprΔ a) ?h.inl.inr
⊢ List.getLast (Int.reprΔ a) ?h.inl.inr ∈ Int.reprΔ a
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ Int.reprΔ a ≠ []
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ Int.reprΔ a ≠ []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | apply Int.reprΔ_ne_nil a | case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ Int.reprΔ a ≠ []
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ Int.reprΔ a ≠ [] | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ Int.reprΔ a ≠ []
case h.inl.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₁ :
[Char.ofNat 10, Char.ofNat 10] <:+:
[Char.ofNat 10] ++ Int.reprΔ a ++ List.take (List.length [Char.ofNat 10, Char.ofNat 10] - 1) [Char.ofNat 10]
h₄ : [Char.ofNat 10, Char.ofNat 10] <:+: [List.getLastD (Int.reprΔ a) (Char.ofNat 10)] ++ [Char.ofNat 10]
newline_in_repr : Char.ofNat 10 = List.getLastD (Int.reprΔ a) (Char.ofNat 10)
⊢ Int.reprΔ a ≠ []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | have hlen := List.isInfix_length h₅ | case h.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₅ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10]
⊢ False | case h.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₅ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10]
hlen : List.length [Char.ofNat 10, Char.ofNat 10] ≤ List.length [Char.ofNat 10]
⊢ False | Please generate a tactic in lean4 to solve the state.
STATE:
case h.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₅ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10]
⊢ False
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | double_newline_not_isInfix_stringToElf | [2282, 1] | [2319, 18] | simp only at hlen | case h.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₅ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10]
hlen : List.length [Char.ofNat 10, Char.ofNat 10] ≤ List.length [Char.ofNat 10]
⊢ False | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case h.inr
elf : List ℤ
hempty : ¬elf = []
contr : [Char.ofNat 10, Char.ofNat 10] <:+: List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)
a : ℤ
a✝ : a ∈ elf
contr₂ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10] ++ Int.reprΔ a ++ [Char.ofNat 10]
h₅ : [Char.ofNat 10, Char.ofNat 10] <:+: [Char.ofNat 10]
hlen : List.length [Char.ofNat 10, Char.ofNat 10] ≤ List.length [Char.ofNat 10]
⊢ False
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | newline_not_last_elfToString | [2322, 1] | [2344, 17] | if hnil: elf = [] then
simp only [hnil, ne_eq]
else
unfold elfToString
intro contr
have h₂ := List.getLast?_some contr
rw [List.getLast_intercalate] at h₂
. simp only [List.getLast_map _ hnil] at h₂
revert h₂
generalize_proofs hnil'
intro h₂
have mem := List.getLast_mem hnil'
rw [h₂] at mem
apply Int.not_newline_mem_reprΔ
apply mem
. intro contr
have gl := List.getLast?_some contr
rw [List.getLast_map] at gl
apply Int.reprΔ_ne_nil
apply gl
apply hnil
. exact '\n' | elf : List ℤ
⊢ List.getLast? (elfToString elf) ≠ some (Char.ofNat 10) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
⊢ List.getLast? (elfToString elf) ≠ some (Char.ofNat 10)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | newline_not_last_elfToString | [2322, 1] | [2344, 17] | simp only [hnil, ne_eq] | elf : List ℤ
hnil : elf = []
⊢ List.getLast? (elfToString elf) ≠ some (Char.ofNat 10) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
hnil : elf = []
⊢ List.getLast? (elfToString elf) ≠ some (Char.ofNat 10)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | newline_not_last_elfToString | [2322, 1] | [2344, 17] | unfold elfToString | elf : List ℤ
hnil : ¬elf = []
⊢ List.getLast? (elfToString elf) ≠ some (Char.ofNat 10) | elf : List ℤ
hnil : ¬elf = []
⊢ List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) ≠ some (Char.ofNat 10) | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
hnil : ¬elf = []
⊢ List.getLast? (elfToString elf) ≠ some (Char.ofNat 10)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | newline_not_last_elfToString | [2322, 1] | [2344, 17] | intro contr | elf : List ℤ
hnil : ¬elf = []
⊢ List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) ≠ some (Char.ofNat 10) | elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
⊢ False | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
hnil : ¬elf = []
⊢ List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) ≠ some (Char.ofNat 10)
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | newline_not_last_elfToString | [2322, 1] | [2344, 17] | have h₂ := List.getLast?_some contr | elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
⊢ False | elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
⊢ False | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
⊢ False
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | newline_not_last_elfToString | [2322, 1] | [2344, 17] | rw [List.getLast_intercalate] at h₂ | elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
⊢ False | elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂✝ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
h₂ :
List.getLast (List.getLast (List.map Int.reprΔ elf) (_ : List.map Int.reprΔ elf = [] → False))
(_ : List.getLast (List.map Int.reprΔ elf) (_ : List.map Int.reprΔ elf = [] → False) = [] → False) =
Char.ofNat 10
⊢ False
case not_nil
elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
⊢ List.getLast? (List.map Int.reprΔ elf) ≠ some []
elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
⊢ Char | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
⊢ False
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | newline_not_last_elfToString | [2322, 1] | [2344, 17] | . simp only [List.getLast_map _ hnil] at h₂
revert h₂
generalize_proofs hnil'
intro h₂
have mem := List.getLast_mem hnil'
rw [h₂] at mem
apply Int.not_newline_mem_reprΔ
apply mem | elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂✝ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
h₂ :
List.getLast (List.getLast (List.map Int.reprΔ elf) (_ : List.map Int.reprΔ elf = [] → False))
(_ : List.getLast (List.map Int.reprΔ elf) (_ : List.map Int.reprΔ elf = [] → False) = [] → False) =
Char.ofNat 10
⊢ False
case not_nil
elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
⊢ List.getLast? (List.map Int.reprΔ elf) ≠ some []
elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
⊢ Char | case not_nil
elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
⊢ List.getLast? (List.map Int.reprΔ elf) ≠ some []
elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
⊢ Char | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂✝ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
h₂ :
List.getLast (List.getLast (List.map Int.reprΔ elf) (_ : List.map Int.reprΔ elf = [] → False))
(_ : List.getLast (List.map Int.reprΔ elf) (_ : List.map Int.reprΔ elf = [] → False) = [] → False) =
Char.ofNat 10
⊢ False
case not_nil
elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
⊢ List.getLast? (List.map Int.reprΔ elf) ≠ some []
elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
⊢ Char
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | newline_not_last_elfToString | [2322, 1] | [2344, 17] | . intro contr
have gl := List.getLast?_some contr
rw [List.getLast_map] at gl
apply Int.reprΔ_ne_nil
apply gl
apply hnil | case not_nil
elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
⊢ List.getLast? (List.map Int.reprΔ elf) ≠ some []
elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
⊢ Char | elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
⊢ Char | Please generate a tactic in lean4 to solve the state.
STATE:
case not_nil
elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
⊢ List.getLast? (List.map Int.reprΔ elf) ≠ some []
elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
⊢ Char
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | newline_not_last_elfToString | [2322, 1] | [2344, 17] | . exact '\n' | elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
⊢ Char | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
hnil : ¬elf = []
contr : List.getLast? (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)) = some (Char.ofNat 10)
h₂ :
List.getLast (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf))
(_ : ¬List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf) = []) =
Char.ofNat 10
⊢ Char
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | stringToElf_ignoresTrailing | [2348, 1] | [2351, 63] | simp only [stringToElf, ne_eq, decide_not, List.find?, List.not_mem_nil, beq_iff_eq, IsEmpty.forall_iff,
forall_const, List.splitOn_last, List.filter_append, decide_True, Bool.not_true, not_false_iff,
List.filter_cons_of_neg, List.filter_nil, List.append_nil] | s : List Char
⊢ stringToElf (s ++ [Char.ofNat 10]) = stringToElf s | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
s : List Char
⊢ stringToElf (s ++ [Char.ofNat 10]) = stringToElf s
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | List.intercalate_singleton | [2353, 1] | [2355, 100] | rw [List.intercalate, List.intersperse_singleton, List.join_cons, List.join_nil, List.append_nil] | α : Type u_1
sep elem : List α
⊢ intercalate sep [elem] = elem | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
α : Type u_1
sep elem : List α
⊢ intercalate sep [elem] = elem
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | elfToString_roundtrip | [2357, 1] | [2370, 59] | if h:elf = [] then
simp only [h]
else
unfold stringToElf elfToString
rw [List.splitOn_intercalate, List.filter_eq_self.2, List.map_map]
. unfold Function.comp
simp only [String.toIntΔ_inv_IntreprΔ, List.map_id'']
. simp only [List.mem_map', ne_eq, decide_not, Bool.not_eq_true', decide_eq_false_iff_not, forall_exists_index,
and_imp, forall_apply_eq_imp_iff₂, Int.reprΔ_ne_nil, not_false_iff, implies_true, forall_const]
. simp only [List.mem_map', forall_exists_index, and_imp, forall_apply_eq_imp_iff₂]
intro a _
apply Int.not_newline_mem_reprΔ
. simp only [ne_eq, List.map_eq_nil, h, not_false_iff] | elf : List ℤ
⊢ stringToElf (elfToString elf) = elf | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
⊢ stringToElf (elfToString elf) = elf
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | elfToString_roundtrip | [2357, 1] | [2370, 59] | simp only [h] | elf : List ℤ
h : elf = []
⊢ stringToElf (elfToString elf) = elf | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
h : elf = []
⊢ stringToElf (elfToString elf) = elf
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | elfToString_roundtrip | [2357, 1] | [2370, 59] | unfold stringToElf elfToString | elf : List ℤ
h : ¬elf = []
⊢ stringToElf (elfToString elf) = elf | elf : List ℤ
h : ¬elf = []
⊢ List.map String.toIntΔ
(List.filter (fun x => decide (x ≠ []))
(List.splitOn (Char.ofNat 10) (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)))) =
elf | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
h : ¬elf = []
⊢ stringToElf (elfToString elf) = elf
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | elfToString_roundtrip | [2357, 1] | [2370, 59] | rw [List.splitOn_intercalate, List.filter_eq_self.2, List.map_map] | elf : List ℤ
h : ¬elf = []
⊢ List.map String.toIntΔ
(List.filter (fun x => decide (x ≠ []))
(List.splitOn (Char.ofNat 10) (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)))) =
elf | elf : List ℤ
h : ¬elf = []
⊢ List.map (String.toIntΔ ∘ Int.reprΔ) elf = elf
elf : List ℤ
h : ¬elf = []
⊢ ∀ (a : List Char), a ∈ List.map Int.reprΔ elf → decide (a ≠ []) = true
case hx
elf : List ℤ
h : ¬elf = []
⊢ ∀ (l : List Char), l ∈ List.map Int.reprΔ elf → ¬Char.ofNat 10 ∈ l
case hls
elf : List ℤ
h : ¬elf = []
⊢ List.map Int.reprΔ elf ≠ [] | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
h : ¬elf = []
⊢ List.map String.toIntΔ
(List.filter (fun x => decide (x ≠ []))
(List.splitOn (Char.ofNat 10) (List.intercalate [Char.ofNat 10] (List.map Int.reprΔ elf)))) =
elf
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | elfToString_roundtrip | [2357, 1] | [2370, 59] | . unfold Function.comp
simp only [String.toIntΔ_inv_IntreprΔ, List.map_id''] | elf : List ℤ
h : ¬elf = []
⊢ List.map (String.toIntΔ ∘ Int.reprΔ) elf = elf
elf : List ℤ
h : ¬elf = []
⊢ ∀ (a : List Char), a ∈ List.map Int.reprΔ elf → decide (a ≠ []) = true
case hx
elf : List ℤ
h : ¬elf = []
⊢ ∀ (l : List Char), l ∈ List.map Int.reprΔ elf → ¬Char.ofNat 10 ∈ l
case hls
elf : List ℤ
h : ¬elf = []
⊢ List.map Int.reprΔ elf ≠ [] | elf : List ℤ
h : ¬elf = []
⊢ ∀ (a : List Char), a ∈ List.map Int.reprΔ elf → decide (a ≠ []) = true
case hx
elf : List ℤ
h : ¬elf = []
⊢ ∀ (l : List Char), l ∈ List.map Int.reprΔ elf → ¬Char.ofNat 10 ∈ l
case hls
elf : List ℤ
h : ¬elf = []
⊢ List.map Int.reprΔ elf ≠ [] | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
h : ¬elf = []
⊢ List.map (String.toIntΔ ∘ Int.reprΔ) elf = elf
elf : List ℤ
h : ¬elf = []
⊢ ∀ (a : List Char), a ∈ List.map Int.reprΔ elf → decide (a ≠ []) = true
case hx
elf : List ℤ
h : ¬elf = []
⊢ ∀ (l : List Char), l ∈ List.map Int.reprΔ elf → ¬Char.ofNat 10 ∈ l
case hls
elf : List ℤ
h : ¬elf = []
⊢ List.map Int.reprΔ elf ≠ []
TACTIC:
|
https://github.com/jeremysalwen/advent_of_lean_2022.git | 96035d07c4f9f133fe79fe02cdf5792b597881c0 | One.lean | elfToString_roundtrip | [2357, 1] | [2370, 59] | . simp only [List.mem_map', ne_eq, decide_not, Bool.not_eq_true', decide_eq_false_iff_not, forall_exists_index,
and_imp, forall_apply_eq_imp_iff₂, Int.reprΔ_ne_nil, not_false_iff, implies_true, forall_const] | elf : List ℤ
h : ¬elf = []
⊢ ∀ (a : List Char), a ∈ List.map Int.reprΔ elf → decide (a ≠ []) = true
case hx
elf : List ℤ
h : ¬elf = []
⊢ ∀ (l : List Char), l ∈ List.map Int.reprΔ elf → ¬Char.ofNat 10 ∈ l
case hls
elf : List ℤ
h : ¬elf = []
⊢ List.map Int.reprΔ elf ≠ [] | case hx
elf : List ℤ
h : ¬elf = []
⊢ ∀ (l : List Char), l ∈ List.map Int.reprΔ elf → ¬Char.ofNat 10 ∈ l
case hls
elf : List ℤ
h : ¬elf = []
⊢ List.map Int.reprΔ elf ≠ [] | Please generate a tactic in lean4 to solve the state.
STATE:
elf : List ℤ
h : ¬elf = []
⊢ ∀ (a : List Char), a ∈ List.map Int.reprΔ elf → decide (a ≠ []) = true
case hx
elf : List ℤ
h : ¬elf = []
⊢ ∀ (l : List Char), l ∈ List.map Int.reprΔ elf → ¬Char.ofNat 10 ∈ l
case hls
elf : List ℤ
h : ¬elf = []
⊢ List.map Int.reprΔ elf ≠ []
TACTIC:
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.