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
Int.reprΞ”_ne_nil
[98, 1]
[102, 73]
simp only [List.singleton_append, ne_eq, not_false_iff]
case negSucc m : β„• ⊒ (match -[m+1] with | ofNat m => Nat.toDigits 10 m | -[m+1] => [Char.ofNat 45] ++ Nat.toDigits 10 (Nat.succ m)) β‰  []
no goals
Please generate a tactic in lean4 to solve the state. STATE: case negSucc m : β„• ⊒ (match -[m+1] with | ofNat m => Nat.toDigits 10 m | -[m+1] => [Char.ofNat 45] ++ Nat.toDigits 10 (Nat.succ m)) β‰  [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.digitChar_is_digit
[105, 1]
[108, 9]
revert n
n : β„• P : n < 10 ⊒ Char.isDigit (digitChar n) = true
⊒ βˆ€ (n : β„•), n < 10 β†’ Char.isDigit (digitChar n) = true
Please generate a tactic in lean4 to solve the state. STATE: n : β„• P : n < 10 ⊒ Char.isDigit (digitChar n) = true TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.digitChar_is_digit
[105, 1]
[108, 9]
decide
⊒ βˆ€ (n : β„•), n < 10 β†’ Char.isDigit (digitChar n) = true
no goals
Please generate a tactic in lean4 to solve the state. STATE: ⊒ βˆ€ (n : β„•), n < 10 β†’ Char.isDigit (digitChar n) = true TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
induction n using Nat.strong_induction_on generalizing f a with | _ n h => have _: b>0 := by calc b > 1 := Q _ > 0 := by simp have nmodb_le10: n % b < 10 := by calc n % b < b := by apply Nat.mod_lt; simp [*] _ ≀ 10 := by exact P unfold Nat.toDigitsCore split next => intro hβ‚‚ simp [hβ‚‚] next _ _ _ fuel=> simp intro hβ‚‚ cases h₃: n / b == 0 with | true => have hβ‚„:n/b = 0 := by apply LawfulBEq.eq_of_beq; assumption simp [hβ‚„] at hβ‚‚ cases hβ‚‚ with | inr hβ‚… => simp [hβ‚…] | inl hβ‚… => left rw [hβ‚…] simp [nmodb_le10, Nat.digitChar_is_digit] | false => have hβ‚„: n/b β‰  0 := by apply ne_of_beq_false; assumption simp [hβ‚„] at hβ‚‚ have hβ‚…: Char.isDigit c = true ∨ c ∈ Nat.digitChar (n % b) :: a := by apply h (n/b) (f:= fuel) (a:=(Nat.digitChar (n % b) :: a)) next => have hβ‚…: n β‰  0 := by intro x unfold Ne at hβ‚„ have h₆:= Nat.zero_div b conv at h₆ => left rw [← x] contradiction apply Nat.div_lt_self . simp [hβ‚…, Nat.pos_of_ne_zero] . simp [Q] next _ => exact hβ‚‚ simp at hβ‚… cases hβ‚… with | inl h₆ => simp [h₆] | inr h₆ => cases h₆ with | inl h₇ => rw [h₇]; left; simp [nmodb_le10, Nat.digitChar_is_digit] | inr h₇ => simp [h₇]
c : Char f : β„• a : List Char b n : β„• P : b ≀ 10 Q : b > 1 ⊒ c ∈ toDigitsCore b f n a β†’ Char.isDigit c = true ∨ c ∈ a
no goals
Please generate a tactic in lean4 to solve the state. STATE: c : Char f : β„• a : List Char b n : β„• P : b ≀ 10 Q : b > 1 ⊒ c ∈ toDigitsCore b f n a β†’ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
have _: b>0 := by calc b > 1 := Q _ > 0 := by simp
case h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char ⊒ c ∈ toDigitsCore b f n a β†’ Char.isDigit c = true ∨ c ∈ a
case h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char x✝ : b > 0 ⊒ c ∈ toDigitsCore b f n a β†’ Char.isDigit c = true ∨ c ∈ a
Please generate a tactic in lean4 to solve the state. STATE: case h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char ⊒ c ∈ toDigitsCore b f n a β†’ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
have nmodb_le10: n % b < 10 := by calc n % b < b := by apply Nat.mod_lt; simp [*] _ ≀ 10 := by exact P
case h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char x✝ : b > 0 ⊒ c ∈ toDigitsCore b f n a β†’ Char.isDigit c = true ∨ c ∈ a
case h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char x✝ : b > 0 nmodb_le10 : n % b < 10 ⊒ c ∈ toDigitsCore b f n a β†’ Char.isDigit c = true ∨ c ∈ a
Please generate a tactic in lean4 to solve the state. STATE: case h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char x✝ : b > 0 ⊒ c ∈ toDigitsCore b f n a β†’ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
unfold Nat.toDigitsCore
case h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char x✝ : b > 0 nmodb_le10 : n % b < 10 ⊒ c ∈ toDigitsCore b f n a β†’ Char.isDigit c = true ∨ c ∈ a
case h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char x✝ : b > 0 nmodb_le10 : n % b < 10 ⊒ (c ∈ match f, n, a with | 0, x, ds => ds | succ fuel, n, ds => let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: ds else toDigitsCore b fuel n' (d :: ds)) β†’ Char.isDigit c = true ∨ c ∈ a
Please generate a tactic in lean4 to solve the state. STATE: case h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char x✝ : b > 0 nmodb_le10 : n % b < 10 ⊒ c ∈ toDigitsCore b f n a β†’ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
split
case h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char x✝ : b > 0 nmodb_le10 : n % b < 10 ⊒ (c ∈ match f, n, a with | 0, x, ds => ds | succ fuel, n, ds => let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: ds else toDigitsCore b fuel n' (d :: ds)) β†’ Char.isDigit c = true ∨ c ∈ a
case h.h_1 c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char ⊒ c ∈ a β†’ Char.isDigit c = true ∨ c ∈ a case h.h_2 c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel✝ : β„• ⊒ (c ∈ let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: a else toDigitsCore b fuel✝ n' (d :: a)) β†’ Char.isDigit c = true ∨ c ∈ a
Please generate a tactic in lean4 to solve the state. STATE: case h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char x✝ : b > 0 nmodb_le10 : n % b < 10 ⊒ (c ∈ match f, n, a with | 0, x, ds => ds | succ fuel, n, ds => let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: ds else toDigitsCore b fuel n' (d :: ds)) β†’ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
next => intro hβ‚‚ simp [hβ‚‚]
case h.h_1 c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char ⊒ c ∈ a β†’ Char.isDigit c = true ∨ c ∈ a case h.h_2 c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel✝ : β„• ⊒ (c ∈ let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: a else toDigitsCore b fuel✝ n' (d :: a)) β†’ Char.isDigit c = true ∨ c ∈ a
case h.h_2 c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel✝ : β„• ⊒ (c ∈ let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: a else toDigitsCore b fuel✝ n' (d :: a)) β†’ Char.isDigit c = true ∨ c ∈ a
Please generate a tactic in lean4 to solve the state. STATE: case h.h_1 c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char ⊒ c ∈ a β†’ Char.isDigit c = true ∨ c ∈ a case h.h_2 c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel✝ : β„• ⊒ (c ∈ let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: a else toDigitsCore b fuel✝ n' (d :: a)) β†’ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
next _ _ _ fuel=> simp intro hβ‚‚ cases h₃: n / b == 0 with | true => have hβ‚„:n/b = 0 := by apply LawfulBEq.eq_of_beq; assumption simp [hβ‚„] at hβ‚‚ cases hβ‚‚ with | inr hβ‚… => simp [hβ‚…] | inl hβ‚… => left rw [hβ‚…] simp [nmodb_le10, Nat.digitChar_is_digit] | false => have hβ‚„: n/b β‰  0 := by apply ne_of_beq_false; assumption simp [hβ‚„] at hβ‚‚ have hβ‚…: Char.isDigit c = true ∨ c ∈ Nat.digitChar (n % b) :: a := by apply h (n/b) (f:= fuel) (a:=(Nat.digitChar (n % b) :: a)) next => have hβ‚…: n β‰  0 := by intro x unfold Ne at hβ‚„ have h₆:= Nat.zero_div b conv at h₆ => left rw [← x] contradiction apply Nat.div_lt_self . simp [hβ‚…, Nat.pos_of_ne_zero] . simp [Q] next _ => exact hβ‚‚ simp at hβ‚… cases hβ‚… with | inl h₆ => simp [h₆] | inr h₆ => cases h₆ with | inl h₇ => rw [h₇]; left; simp [nmodb_le10, Nat.digitChar_is_digit] | inr h₇ => simp [h₇]
case h.h_2 c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel✝ : β„• ⊒ (c ∈ let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: a else toDigitsCore b fuel✝ n' (d :: a)) β†’ Char.isDigit c = true ∨ c ∈ a
no goals
Please generate a tactic in lean4 to solve the state. STATE: case h.h_2 c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel✝ : β„• ⊒ (c ∈ let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: a else toDigitsCore b fuel✝ n' (d :: a)) β†’ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
calc b > 1 := Q _ > 0 := by simp
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char ⊒ b > 0
no goals
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char ⊒ b > 0 TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
simp
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char ⊒ 1 > 0
no goals
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char ⊒ 1 > 0 TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
calc n % b < b := by apply Nat.mod_lt; simp [*] _ ≀ 10 := by exact P
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char x✝ : b > 0 ⊒ n % b < 10
no goals
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char x✝ : b > 0 ⊒ n % b < 10 TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
apply Nat.mod_lt
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char x✝ : b > 0 ⊒ n % b < b
case a c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char x✝ : b > 0 ⊒ b > 0
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char x✝ : b > 0 ⊒ n % b < b TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
simp [*]
case a c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char x✝ : b > 0 ⊒ b > 0
no goals
Please generate a tactic in lean4 to solve the state. STATE: case a c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char x✝ : b > 0 ⊒ b > 0 TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
exact P
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char x✝ : b > 0 ⊒ b ≀ 10
no goals
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a f : β„• a : List Char x✝ : b > 0 ⊒ b ≀ 10 TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
intro hβ‚‚
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char ⊒ c ∈ a β†’ Char.isDigit c = true ∨ c ∈ a
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char hβ‚‚ : c ∈ a ⊒ Char.isDigit c = true ∨ c ∈ a
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char ⊒ c ∈ a β†’ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
simp [hβ‚‚]
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char hβ‚‚ : c ∈ a ⊒ Char.isDigit c = true ∨ c ∈ a
no goals
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char hβ‚‚ : c ∈ a ⊒ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
simp
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• ⊒ (c ∈ let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: a else toDigitsCore b fuel n' (d :: a)) β†’ Char.isDigit c = true ∨ c ∈ a
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• ⊒ (c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a)) β†’ Char.isDigit c = true ∨ c ∈ a
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• ⊒ (c ∈ let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: a else toDigitsCore b fuel n' (d :: a)) β†’ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
intro hβ‚‚
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• ⊒ (c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a)) β†’ Char.isDigit c = true ∨ c ∈ a
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ Char.isDigit c = true ∨ c ∈ a
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• ⊒ (c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a)) β†’ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
cases h₃: n / b == 0 with | true => have hβ‚„:n/b = 0 := by apply LawfulBEq.eq_of_beq; assumption simp [hβ‚„] at hβ‚‚ cases hβ‚‚ with | inr hβ‚… => simp [hβ‚…] | inl hβ‚… => left rw [hβ‚…] simp [nmodb_le10, Nat.digitChar_is_digit] | false => have hβ‚„: n/b β‰  0 := by apply ne_of_beq_false; assumption simp [hβ‚„] at hβ‚‚ have hβ‚…: Char.isDigit c = true ∨ c ∈ Nat.digitChar (n % b) :: a := by apply h (n/b) (f:= fuel) (a:=(Nat.digitChar (n % b) :: a)) next => have hβ‚…: n β‰  0 := by intro x unfold Ne at hβ‚„ have h₆:= Nat.zero_div b conv at h₆ => left rw [← x] contradiction apply Nat.div_lt_self . simp [hβ‚…, Nat.pos_of_ne_zero] . simp [Q] next _ => exact hβ‚‚ simp at hβ‚… cases hβ‚… with | inl h₆ => simp [h₆] | inr h₆ => cases h₆ with | inl h₇ => rw [h₇]; left; simp [nmodb_le10, Nat.digitChar_is_digit] | inr h₇ => simp [h₇]
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ Char.isDigit c = true ∨ c ∈ a
no goals
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
have hβ‚„:n/b = 0 := by apply LawfulBEq.eq_of_beq; assumption
case true c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = true ⊒ Char.isDigit c = true ∨ c ∈ a
case true c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = true hβ‚„ : n / b = 0 ⊒ Char.isDigit c = true ∨ c ∈ a
Please generate a tactic in lean4 to solve the state. STATE: case true c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = true ⊒ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
simp [hβ‚„] at hβ‚‚
case true c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = true hβ‚„ : n / b = 0 ⊒ Char.isDigit c = true ∨ c ∈ a
case true c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = true hβ‚„ : n / b = 0 hβ‚‚ : c = digitChar (n % b) ∨ c ∈ a ⊒ Char.isDigit c = true ∨ c ∈ a
Please generate a tactic in lean4 to solve the state. STATE: case true c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = true hβ‚„ : n / b = 0 ⊒ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
cases hβ‚‚ with | inr hβ‚… => simp [hβ‚…] | inl hβ‚… => left rw [hβ‚…] simp [nmodb_le10, Nat.digitChar_is_digit]
case true c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = true hβ‚„ : n / b = 0 hβ‚‚ : c = digitChar (n % b) ∨ c ∈ a ⊒ Char.isDigit c = true ∨ c ∈ a
no goals
Please generate a tactic in lean4 to solve the state. STATE: case true c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = true hβ‚„ : n / b = 0 hβ‚‚ : c = digitChar (n % b) ∨ c ∈ a ⊒ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
apply LawfulBEq.eq_of_beq
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = true ⊒ n / b = 0
case a c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = true ⊒ (n / b == 0) = true
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = true ⊒ n / b = 0 TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
assumption
case a c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = true ⊒ (n / b == 0) = true
no goals
Please generate a tactic in lean4 to solve the state. STATE: case a c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = true ⊒ (n / b == 0) = true TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
simp [hβ‚…]
case true.inr c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = true hβ‚„ : n / b = 0 hβ‚… : c ∈ a ⊒ Char.isDigit c = true ∨ c ∈ a
no goals
Please generate a tactic in lean4 to solve the state. STATE: case true.inr c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = true hβ‚„ : n / b = 0 hβ‚… : c ∈ a ⊒ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
left
case true.inl c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = true hβ‚„ : n / b = 0 hβ‚… : c = digitChar (n % b) ⊒ Char.isDigit c = true ∨ c ∈ a
case true.inl.h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = true hβ‚„ : n / b = 0 hβ‚… : c = digitChar (n % b) ⊒ Char.isDigit c = true
Please generate a tactic in lean4 to solve the state. STATE: case true.inl c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = true hβ‚„ : n / b = 0 hβ‚… : c = digitChar (n % b) ⊒ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
rw [hβ‚…]
case true.inl.h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = true hβ‚„ : n / b = 0 hβ‚… : c = digitChar (n % b) ⊒ Char.isDigit c = true
case true.inl.h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = true hβ‚„ : n / b = 0 hβ‚… : c = digitChar (n % b) ⊒ Char.isDigit (digitChar (n % b)) = true
Please generate a tactic in lean4 to solve the state. STATE: case true.inl.h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = true hβ‚„ : n / b = 0 hβ‚… : c = digitChar (n % b) ⊒ Char.isDigit c = true TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
simp [nmodb_le10, Nat.digitChar_is_digit]
case true.inl.h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = true hβ‚„ : n / b = 0 hβ‚… : c = digitChar (n % b) ⊒ Char.isDigit (digitChar (n % b)) = true
no goals
Please generate a tactic in lean4 to solve the state. STATE: case true.inl.h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = true hβ‚„ : n / b = 0 hβ‚… : c = digitChar (n % b) ⊒ Char.isDigit (digitChar (n % b)) = true TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
have hβ‚„: n/b β‰  0 := by apply ne_of_beq_false; assumption
case false c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = false ⊒ Char.isDigit c = true ∨ c ∈ a
case false c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 ⊒ Char.isDigit c = true ∨ c ∈ a
Please generate a tactic in lean4 to solve the state. STATE: case false c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = false ⊒ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
simp [hβ‚„] at hβ‚‚
case false c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 ⊒ Char.isDigit c = true ∨ c ∈ a
case false c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ Char.isDigit c = true ∨ c ∈ a
Please generate a tactic in lean4 to solve the state. STATE: case false c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 ⊒ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
have hβ‚…: Char.isDigit c = true ∨ c ∈ Nat.digitChar (n % b) :: a := by apply h (n/b) (f:= fuel) (a:=(Nat.digitChar (n % b) :: a)) next => have hβ‚…: n β‰  0 := by intro x unfold Ne at hβ‚„ have h₆:= Nat.zero_div b conv at h₆ => left rw [← x] contradiction apply Nat.div_lt_self . simp [hβ‚…, Nat.pos_of_ne_zero] . simp [Q] next _ => exact hβ‚‚
case false c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ Char.isDigit c = true ∨ c ∈ a
case false c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) hβ‚… : Char.isDigit c = true ∨ c ∈ digitChar (n % b) :: a ⊒ Char.isDigit c = true ∨ c ∈ a
Please generate a tactic in lean4 to solve the state. STATE: case false c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
simp at hβ‚…
case false c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) hβ‚… : Char.isDigit c = true ∨ c ∈ digitChar (n % b) :: a ⊒ Char.isDigit c = true ∨ c ∈ a
case false c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) hβ‚… : Char.isDigit c = true ∨ c = digitChar (n % b) ∨ c ∈ a ⊒ Char.isDigit c = true ∨ c ∈ a
Please generate a tactic in lean4 to solve the state. STATE: case false c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) hβ‚… : Char.isDigit c = true ∨ c ∈ digitChar (n % b) :: a ⊒ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
cases hβ‚… with | inl h₆ => simp [h₆] | inr h₆ => cases h₆ with | inl h₇ => rw [h₇]; left; simp [nmodb_le10, Nat.digitChar_is_digit] | inr h₇ => simp [h₇]
case false c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) hβ‚… : Char.isDigit c = true ∨ c = digitChar (n % b) ∨ c ∈ a ⊒ Char.isDigit c = true ∨ c ∈ a
no goals
Please generate a tactic in lean4 to solve the state. STATE: case false c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) hβ‚… : Char.isDigit c = true ∨ c = digitChar (n % b) ∨ c ∈ a ⊒ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
apply ne_of_beq_false
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = false ⊒ n / b β‰  0
case h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = false ⊒ (n / b == 0) = false
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = false ⊒ n / b β‰  0 TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
assumption
case h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = false ⊒ (n / b == 0) = false
no goals
Please generate a tactic in lean4 to solve the state. STATE: case h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• hβ‚‚ : c ∈ if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₃ : (n / b == 0) = false ⊒ (n / b == 0) = false TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
apply h (n/b) (f:= fuel) (a:=(Nat.digitChar (n % b) :: a))
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ Char.isDigit c = true ∨ c ∈ digitChar (n % b) :: a
case a c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ n / b < n case a c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a)
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ Char.isDigit c = true ∨ c ∈ digitChar (n % b) :: a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
next => have hβ‚…: n β‰  0 := by intro x unfold Ne at hβ‚„ have h₆:= Nat.zero_div b conv at h₆ => left rw [← x] contradiction apply Nat.div_lt_self . simp [hβ‚…, Nat.pos_of_ne_zero] . simp [Q]
case a c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ n / b < n case a c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a)
case a c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a)
Please generate a tactic in lean4 to solve the state. STATE: case a c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ n / b < n case a c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
next _ => exact hβ‚‚
case a c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a)
no goals
Please generate a tactic in lean4 to solve the state. STATE: case a c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
have hβ‚…: n β‰  0 := by intro x unfold Ne at hβ‚„ have h₆:= Nat.zero_div b conv at h₆ => left rw [← x] contradiction
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ n / b < n
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) hβ‚… : n β‰  0 ⊒ n / b < n
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ n / b < n TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
apply Nat.div_lt_self
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) hβ‚… : n β‰  0 ⊒ n / b < n
case hLtN c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) hβ‚… : n β‰  0 ⊒ 0 < n case hLtK c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) hβ‚… : n β‰  0 ⊒ 1 < b
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) hβ‚… : n β‰  0 ⊒ n / b < n TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
. simp [hβ‚…, Nat.pos_of_ne_zero]
case hLtN c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) hβ‚… : n β‰  0 ⊒ 0 < n case hLtK c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) hβ‚… : n β‰  0 ⊒ 1 < b
case hLtK c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) hβ‚… : n β‰  0 ⊒ 1 < b
Please generate a tactic in lean4 to solve the state. STATE: case hLtN c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) hβ‚… : n β‰  0 ⊒ 0 < n case hLtK c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) hβ‚… : n β‰  0 ⊒ 1 < b TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
. simp [Q]
case hLtK c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) hβ‚… : n β‰  0 ⊒ 1 < b
no goals
Please generate a tactic in lean4 to solve the state. STATE: case hLtK c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) hβ‚… : n β‰  0 ⊒ 1 < b TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
intro x
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ n β‰  0
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) x : n = 0 ⊒ False
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ n β‰  0 TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
unfold Ne at hβ‚„
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) x : n = 0 ⊒ False
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : Β¬n / b = 0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) x : n = 0 ⊒ False
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) x : n = 0 ⊒ False TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
have h₆:= Nat.zero_div b
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : Β¬n / b = 0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) x : n = 0 ⊒ False
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : Β¬n / b = 0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) x : n = 0 h₆ : 0 / b = 0 ⊒ False
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : Β¬n / b = 0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) x : n = 0 ⊒ False TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
conv at h₆ => left rw [← x]
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : Β¬n / b = 0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) x : n = 0 h₆ : 0 / b = 0 ⊒ False
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : Β¬n / b = 0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) x : n = 0 h₆ : n / b = 0 ⊒ False
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : Β¬n / b = 0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) x : n = 0 h₆ : 0 / b = 0 ⊒ False TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
contradiction
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : Β¬n / b = 0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) x : n = 0 h₆ : n / b = 0 ⊒ False
no goals
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : Β¬n / b = 0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) x : n = 0 h₆ : n / b = 0 ⊒ False TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
exact hβ‚‚
c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a)
no goals
Please generate a tactic in lean4 to solve the state. STATE: c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) ⊒ c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
simp [h₆]
case false.inl c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₆ : Char.isDigit c = true ⊒ Char.isDigit c = true ∨ c ∈ a
no goals
Please generate a tactic in lean4 to solve the state. STATE: case false.inl c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₆ : Char.isDigit c = true ⊒ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
cases h₆ with | inl h₇ => rw [h₇]; left; simp [nmodb_le10, Nat.digitChar_is_digit] | inr h₇ => simp [h₇]
case false.inr c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₆ : c = digitChar (n % b) ∨ c ∈ a ⊒ Char.isDigit c = true ∨ c ∈ a
no goals
Please generate a tactic in lean4 to solve the state. STATE: case false.inr c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₆ : c = digitChar (n % b) ∨ c ∈ a ⊒ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
rw [h₇]
case false.inr.inl c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₇ : c = digitChar (n % b) ⊒ Char.isDigit c = true ∨ c ∈ a
case false.inr.inl c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₇ : c = digitChar (n % b) ⊒ Char.isDigit (digitChar (n % b)) = true ∨ digitChar (n % b) ∈ a
Please generate a tactic in lean4 to solve the state. STATE: case false.inr.inl c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₇ : c = digitChar (n % b) ⊒ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
left
case false.inr.inl c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₇ : c = digitChar (n % b) ⊒ Char.isDigit (digitChar (n % b)) = true ∨ digitChar (n % b) ∈ a
case false.inr.inl.h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₇ : c = digitChar (n % b) ⊒ Char.isDigit (digitChar (n % b)) = true
Please generate a tactic in lean4 to solve the state. STATE: case false.inr.inl c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₇ : c = digitChar (n % b) ⊒ Char.isDigit (digitChar (n % b)) = true ∨ digitChar (n % b) ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
simp [nmodb_le10, Nat.digitChar_is_digit]
case false.inr.inl.h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₇ : c = digitChar (n % b) ⊒ Char.isDigit (digitChar (n % b)) = true
no goals
Please generate a tactic in lean4 to solve the state. STATE: case false.inr.inl.h c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₇ : c = digitChar (n % b) ⊒ Char.isDigit (digitChar (n % b)) = true TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_digits
[110, 1]
[160, 32]
simp [h₇]
case false.inr.inr c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₇ : c ∈ a ⊒ Char.isDigit c = true ∨ c ∈ a
no goals
Please generate a tactic in lean4 to solve the state. STATE: case false.inr.inr c : Char b : β„• P : b ≀ 10 Q : b > 1 n : β„• h : βˆ€ (m : β„•), m < n β†’ βˆ€ {f : β„•} {a : List Char}, c ∈ toDigitsCore b f m a β†’ Char.isDigit c = true ∨ c ∈ a a : List Char x✝³ : b > 0 nmodb_le10 : n % b < 10 x✝² x✝¹ : β„• x✝ : List Char fuel : β„• h₃ : (n / b == 0) = false hβ‚„ : n / b β‰  0 hβ‚‚ : c ∈ toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) h₇ : c ∈ a ⊒ Char.isDigit c = true ∨ c ∈ a TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_accumulates
[163, 1]
[178, 35]
induction f using Nat.strong_induction_on generalizing start rest n with | h f ih => unfold toDigitsCore split . case h.h_1 => simp . case h.h_2 f _ _ _ q => simp split . case inl => simp . case inr => rewrite [← List.cons_append] rewrite [ih] . rfl . simp only [lt_succ_self]
b f n : β„• start rest : List Char ⊒ toDigitsCore b f n (start ++ rest) = toDigitsCore b f n start ++ rest
no goals
Please generate a tactic in lean4 to solve the state. STATE: b f n : β„• start rest : List Char ⊒ toDigitsCore b f n (start ++ rest) = toDigitsCore b f n start ++ rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_accumulates
[163, 1]
[178, 35]
unfold toDigitsCore
case h b f : β„• ih : βˆ€ (m : β„•), m < f β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest n : β„• start rest : List Char ⊒ toDigitsCore b f n (start ++ rest) = toDigitsCore b f n start ++ rest
case h b f : β„• ih : βˆ€ (m : β„•), m < f β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest n : β„• start rest : List Char ⊒ (match f, n, start ++ rest with | 0, x, ds => ds | succ fuel, n, ds => let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: ds else toDigitsCore b fuel n' (d :: ds)) = (match f, n, start with | 0, x, ds => ds | succ fuel, n, ds => let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: ds else toDigitsCore b fuel n' (d :: ds)) ++ rest
Please generate a tactic in lean4 to solve the state. STATE: case h b f : β„• ih : βˆ€ (m : β„•), m < f β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest n : β„• start rest : List Char ⊒ toDigitsCore b f n (start ++ rest) = toDigitsCore b f n start ++ rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_accumulates
[163, 1]
[178, 35]
split
case h b f : β„• ih : βˆ€ (m : β„•), m < f β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest n : β„• start rest : List Char ⊒ (match f, n, start ++ rest with | 0, x, ds => ds | succ fuel, n, ds => let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: ds else toDigitsCore b fuel n' (d :: ds)) = (match f, n, start with | 0, x, ds => ds | succ fuel, n, ds => let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: ds else toDigitsCore b fuel n' (d :: ds)) ++ rest
case h.h_1 b : β„• start rest : List Char x✝³ x✝² x✝¹ : β„• x✝ : List Char ih : βˆ€ (m : β„•), m < 0 β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest ⊒ start ++ rest = start ++ rest case h.h_2 b : β„• start rest : List Char x✝³ x✝² x✝¹ : β„• x✝ : List Char fuel✝ : β„• ih : βˆ€ (m : β„•), m < succ fuel✝ β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest ⊒ (let d := digitChar (x✝³ % b); let n' := x✝³ / b; if n' = 0 then d :: (start ++ rest) else toDigitsCore b fuel✝ n' (d :: (start ++ rest))) = (let d := digitChar (x✝³ % b); let n' := x✝³ / b; if n' = 0 then d :: start else toDigitsCore b fuel✝ n' (d :: start)) ++ rest
Please generate a tactic in lean4 to solve the state. STATE: case h b f : β„• ih : βˆ€ (m : β„•), m < f β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest n : β„• start rest : List Char ⊒ (match f, n, start ++ rest with | 0, x, ds => ds | succ fuel, n, ds => let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: ds else toDigitsCore b fuel n' (d :: ds)) = (match f, n, start with | 0, x, ds => ds | succ fuel, n, ds => let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: ds else toDigitsCore b fuel n' (d :: ds)) ++ rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_accumulates
[163, 1]
[178, 35]
. case h.h_1 => simp
case h.h_1 b : β„• start rest : List Char x✝³ x✝² x✝¹ : β„• x✝ : List Char ih : βˆ€ (m : β„•), m < 0 β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest ⊒ start ++ rest = start ++ rest case h.h_2 b : β„• start rest : List Char x✝³ x✝² x✝¹ : β„• x✝ : List Char fuel✝ : β„• ih : βˆ€ (m : β„•), m < succ fuel✝ β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest ⊒ (let d := digitChar (x✝³ % b); let n' := x✝³ / b; if n' = 0 then d :: (start ++ rest) else toDigitsCore b fuel✝ n' (d :: (start ++ rest))) = (let d := digitChar (x✝³ % b); let n' := x✝³ / b; if n' = 0 then d :: start else toDigitsCore b fuel✝ n' (d :: start)) ++ rest
case h.h_2 b : β„• start rest : List Char x✝³ x✝² x✝¹ : β„• x✝ : List Char fuel✝ : β„• ih : βˆ€ (m : β„•), m < succ fuel✝ β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest ⊒ (let d := digitChar (x✝³ % b); let n' := x✝³ / b; if n' = 0 then d :: (start ++ rest) else toDigitsCore b fuel✝ n' (d :: (start ++ rest))) = (let d := digitChar (x✝³ % b); let n' := x✝³ / b; if n' = 0 then d :: start else toDigitsCore b fuel✝ n' (d :: start)) ++ rest
Please generate a tactic in lean4 to solve the state. STATE: case h.h_1 b : β„• start rest : List Char x✝³ x✝² x✝¹ : β„• x✝ : List Char ih : βˆ€ (m : β„•), m < 0 β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest ⊒ start ++ rest = start ++ rest case h.h_2 b : β„• start rest : List Char x✝³ x✝² x✝¹ : β„• x✝ : List Char fuel✝ : β„• ih : βˆ€ (m : β„•), m < succ fuel✝ β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest ⊒ (let d := digitChar (x✝³ % b); let n' := x✝³ / b; if n' = 0 then d :: (start ++ rest) else toDigitsCore b fuel✝ n' (d :: (start ++ rest))) = (let d := digitChar (x✝³ % b); let n' := x✝³ / b; if n' = 0 then d :: start else toDigitsCore b fuel✝ n' (d :: start)) ++ rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_accumulates
[163, 1]
[178, 35]
. case h.h_2 f _ _ _ q => simp split . case inl => simp . case inr => rewrite [← List.cons_append] rewrite [ih] . rfl . simp only [lt_succ_self]
case h.h_2 b : β„• start rest : List Char x✝³ x✝² x✝¹ : β„• x✝ : List Char fuel✝ : β„• ih : βˆ€ (m : β„•), m < succ fuel✝ β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest ⊒ (let d := digitChar (x✝³ % b); let n' := x✝³ / b; if n' = 0 then d :: (start ++ rest) else toDigitsCore b fuel✝ n' (d :: (start ++ rest))) = (let d := digitChar (x✝³ % b); let n' := x✝³ / b; if n' = 0 then d :: start else toDigitsCore b fuel✝ n' (d :: start)) ++ rest
no goals
Please generate a tactic in lean4 to solve the state. STATE: case h.h_2 b : β„• start rest : List Char x✝³ x✝² x✝¹ : β„• x✝ : List Char fuel✝ : β„• ih : βˆ€ (m : β„•), m < succ fuel✝ β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest ⊒ (let d := digitChar (x✝³ % b); let n' := x✝³ / b; if n' = 0 then d :: (start ++ rest) else toDigitsCore b fuel✝ n' (d :: (start ++ rest))) = (let d := digitChar (x✝³ % b); let n' := x✝³ / b; if n' = 0 then d :: start else toDigitsCore b fuel✝ n' (d :: start)) ++ rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_accumulates
[163, 1]
[178, 35]
simp
b : β„• start rest : List Char x✝³ x✝² x✝¹ : β„• x✝ : List Char ih : βˆ€ (m : β„•), m < 0 β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest ⊒ start ++ rest = start ++ rest
no goals
Please generate a tactic in lean4 to solve the state. STATE: b : β„• start rest : List Char x✝³ x✝² x✝¹ : β„• x✝ : List Char ih : βˆ€ (m : β„•), m < 0 β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest ⊒ start ++ rest = start ++ rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_accumulates
[163, 1]
[178, 35]
simp
b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest ⊒ (let d := digitChar (f % b); let n' := f / b; if n' = 0 then d :: (start ++ rest) else toDigitsCore b q n' (d :: (start ++ rest))) = (let d := digitChar (f % b); let n' := f / b; if n' = 0 then d :: start else toDigitsCore b q n' (d :: start)) ++ rest
b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest ⊒ (if f / b = 0 then digitChar (f % b) :: (start ++ rest) else toDigitsCore b q (f / b) (digitChar (f % b) :: (start ++ rest))) = (if f / b = 0 then digitChar (f % b) :: start else toDigitsCore b q (f / b) (digitChar (f % b) :: start)) ++ rest
Please generate a tactic in lean4 to solve the state. STATE: b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest ⊒ (let d := digitChar (f % b); let n' := f / b; if n' = 0 then d :: (start ++ rest) else toDigitsCore b q n' (d :: (start ++ rest))) = (let d := digitChar (f % b); let n' := f / b; if n' = 0 then d :: start else toDigitsCore b q n' (d :: start)) ++ rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_accumulates
[163, 1]
[178, 35]
split
b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest ⊒ (if f / b = 0 then digitChar (f % b) :: (start ++ rest) else toDigitsCore b q (f / b) (digitChar (f % b) :: (start ++ rest))) = (if f / b = 0 then digitChar (f % b) :: start else toDigitsCore b q (f / b) (digitChar (f % b) :: start)) ++ rest
case inl b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : f / b = 0 ⊒ digitChar (f % b) :: (start ++ rest) = digitChar (f % b) :: start ++ rest case inr b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ toDigitsCore b q (f / b) (digitChar (f % b) :: (start ++ rest)) = toDigitsCore b q (f / b) (digitChar (f % b) :: start) ++ rest
Please generate a tactic in lean4 to solve the state. STATE: b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest ⊒ (if f / b = 0 then digitChar (f % b) :: (start ++ rest) else toDigitsCore b q (f / b) (digitChar (f % b) :: (start ++ rest))) = (if f / b = 0 then digitChar (f % b) :: start else toDigitsCore b q (f / b) (digitChar (f % b) :: start)) ++ rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_accumulates
[163, 1]
[178, 35]
. case inl => simp
case inl b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : f / b = 0 ⊒ digitChar (f % b) :: (start ++ rest) = digitChar (f % b) :: start ++ rest case inr b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ toDigitsCore b q (f / b) (digitChar (f % b) :: (start ++ rest)) = toDigitsCore b q (f / b) (digitChar (f % b) :: start) ++ rest
case inr b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ toDigitsCore b q (f / b) (digitChar (f % b) :: (start ++ rest)) = toDigitsCore b q (f / b) (digitChar (f % b) :: start) ++ rest
Please generate a tactic in lean4 to solve the state. STATE: case inl b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : f / b = 0 ⊒ digitChar (f % b) :: (start ++ rest) = digitChar (f % b) :: start ++ rest case inr b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ toDigitsCore b q (f / b) (digitChar (f % b) :: (start ++ rest)) = toDigitsCore b q (f / b) (digitChar (f % b) :: start) ++ rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_accumulates
[163, 1]
[178, 35]
. case inr => rewrite [← List.cons_append] rewrite [ih] . rfl . simp only [lt_succ_self]
case inr b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ toDigitsCore b q (f / b) (digitChar (f % b) :: (start ++ rest)) = toDigitsCore b q (f / b) (digitChar (f % b) :: start) ++ rest
no goals
Please generate a tactic in lean4 to solve the state. STATE: case inr b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ toDigitsCore b q (f / b) (digitChar (f % b) :: (start ++ rest)) = toDigitsCore b q (f / b) (digitChar (f % b) :: start) ++ rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_accumulates
[163, 1]
[178, 35]
simp
b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : f / b = 0 ⊒ digitChar (f % b) :: (start ++ rest) = digitChar (f % b) :: start ++ rest
no goals
Please generate a tactic in lean4 to solve the state. STATE: b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : f / b = 0 ⊒ digitChar (f % b) :: (start ++ rest) = digitChar (f % b) :: start ++ rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_accumulates
[163, 1]
[178, 35]
rewrite [← List.cons_append]
b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ toDigitsCore b q (f / b) (digitChar (f % b) :: (start ++ rest)) = toDigitsCore b q (f / b) (digitChar (f % b) :: start) ++ rest
b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ toDigitsCore b q (f / b) (digitChar (f % b) :: start ++ rest) = toDigitsCore b q (f / b) (digitChar (f % b) :: start) ++ rest
Please generate a tactic in lean4 to solve the state. STATE: b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ toDigitsCore b q (f / b) (digitChar (f % b) :: (start ++ rest)) = toDigitsCore b q (f / b) (digitChar (f % b) :: start) ++ rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_accumulates
[163, 1]
[178, 35]
rewrite [ih]
b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ toDigitsCore b q (f / b) (digitChar (f % b) :: start ++ rest) = toDigitsCore b q (f / b) (digitChar (f % b) :: start) ++ rest
b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ toDigitsCore b q (f / b) (digitChar (f % b) :: start) ++ rest = toDigitsCore b q (f / b) (digitChar (f % b) :: start) ++ rest case a b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ q < succ q
Please generate a tactic in lean4 to solve the state. STATE: b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ toDigitsCore b q (f / b) (digitChar (f % b) :: start ++ rest) = toDigitsCore b q (f / b) (digitChar (f % b) :: start) ++ rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_accumulates
[163, 1]
[178, 35]
. rfl
b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ toDigitsCore b q (f / b) (digitChar (f % b) :: start) ++ rest = toDigitsCore b q (f / b) (digitChar (f % b) :: start) ++ rest case a b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ q < succ q
case a b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ q < succ q
Please generate a tactic in lean4 to solve the state. STATE: b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ toDigitsCore b q (f / b) (digitChar (f % b) :: start) ++ rest = toDigitsCore b q (f / b) (digitChar (f % b) :: start) ++ rest case a b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ q < succ q TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_accumulates
[163, 1]
[178, 35]
. simp only [lt_succ_self]
case a b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ q < succ q
no goals
Please generate a tactic in lean4 to solve the state. STATE: case a b : β„• start rest : List Char f x✝² x✝¹ : β„• x✝ : List Char q : β„• ih : βˆ€ (m : β„•), m < succ q β†’ βˆ€ {n : β„•} {start rest : List Char}, toDigitsCore b m n (start ++ rest) = toDigitsCore b m n start ++ rest h✝ : Β¬f / b = 0 ⊒ q < succ q TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.todigitsCore_accumulates_suffix
[180, 1]
[183, 37]
have h: rest = [] ++ rest := by simp
b f n : β„• rest : List Char ⊒ toDigitsCore b f n rest = toDigitsCore b f n [] ++ rest
b f n : β„• rest : List Char h : rest = [] ++ rest ⊒ toDigitsCore b f n rest = toDigitsCore b f n [] ++ rest
Please generate a tactic in lean4 to solve the state. STATE: b f n : β„• rest : List Char ⊒ toDigitsCore b f n rest = toDigitsCore b f n [] ++ rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.todigitsCore_accumulates_suffix
[180, 1]
[183, 37]
conv=> left; rw [h]
b f n : β„• rest : List Char h : rest = [] ++ rest ⊒ toDigitsCore b f n rest = toDigitsCore b f n [] ++ rest
b f n : β„• rest : List Char h : rest = [] ++ rest ⊒ toDigitsCore b f n ([] ++ rest) = toDigitsCore b f n [] ++ rest
Please generate a tactic in lean4 to solve the state. STATE: b f n : β„• rest : List Char h : rest = [] ++ rest ⊒ toDigitsCore b f n rest = toDigitsCore b f n [] ++ rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.todigitsCore_accumulates_suffix
[180, 1]
[183, 37]
apply Nat.toDigitsCore_accumulates
b f n : β„• rest : List Char h : rest = [] ++ rest ⊒ toDigitsCore b f n ([] ++ rest) = toDigitsCore b f n [] ++ rest
no goals
Please generate a tactic in lean4 to solve the state. STATE: b f n : β„• rest : List Char h : rest = [] ++ rest ⊒ toDigitsCore b f n ([] ++ rest) = toDigitsCore b f n [] ++ rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.todigitsCore_accumulates_suffix
[180, 1]
[183, 37]
simp
b f n : β„• rest : List Char ⊒ rest = [] ++ rest
no goals
Please generate a tactic in lean4 to solve the state. STATE: b f n : β„• rest : List Char ⊒ rest = [] ++ rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
induction f using Nat.strong_induction_on generalizing rest n
f n b : β„• rest : List Char P : f β‰₯ n + 1 Q : b > 1 ⊒ toDigitsCore b f n rest = toDigitsCore b (n + 1) n rest
case h b : β„• Q : b > 1 n✝ : β„• a✝ : βˆ€ (m : β„•), m < n✝ β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest n : β„• rest : List Char P : n✝ β‰₯ n + 1 ⊒ toDigitsCore b n✝ n rest = toDigitsCore b (n + 1) n rest
Please generate a tactic in lean4 to solve the state. STATE: f n b : β„• rest : List Char P : f β‰₯ n + 1 Q : b > 1 ⊒ toDigitsCore b f n rest = toDigitsCore b (n + 1) n rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
case h f ih => unfold toDigitsCore simp split case h_1 => simp at P case h_2 n' => conv => left; rw [Nat.todigitsCore_accumulates_suffix] conv => right; rw [Nat.todigitsCore_accumulates_suffix] split case inl => rfl case inr => simp rw [ih] . cases h: n == (n / b) + 1 with | false => simp at h rw [← Nat.toDigits, ih, ← Nat.toDigits] . calc succ n' β‰₯ n + 1 := P _ > n := by simp only [gt_iff_lt, lt_add_iff_pos_right] . simp [h] have hβ‚‚: n β‰₯ n / b + 1 := by simp apply Nat.div_lt_self . apply Nat.pos_of_ne_zero; intro h; simp only [gt_iff_lt, h, Nat.zero_div, not_true] at * . exact Q simp [ge_iff_le] at hβ‚‚ have h₃:= Nat.eq_or_lt_of_le hβ‚‚ cases h₃ with | inl hβ‚„ => exfalso; apply h; simp only [hβ‚„] | inr hβ‚„ => exact hβ‚‚ | true => simp at h rw [← h] . simp . simp [Nat.succ_eq_add_one] at P calc n' β‰₯ n := P n β‰₯ n / b + 1 := by simp only [add_lt_add_iff_right]; apply Nat.div_lt_self; apply Nat.pos_of_ne_zero; intro h; simp only [gt_iff_lt, h, Nat.zero_div, not_true] at *; apply Q
b : β„• Q : b > 1 f : β„• ih : βˆ€ (m : β„•), m < f β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest n : β„• rest : List Char P : f β‰₯ n + 1 ⊒ toDigitsCore b f n rest = toDigitsCore b (n + 1) n rest
no goals
Please generate a tactic in lean4 to solve the state. STATE: b : β„• Q : b > 1 f : β„• ih : βˆ€ (m : β„•), m < f β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest n : β„• rest : List Char P : f β‰₯ n + 1 ⊒ toDigitsCore b f n rest = toDigitsCore b (n + 1) n rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
unfold toDigitsCore
b : β„• Q : b > 1 f : β„• ih : βˆ€ (m : β„•), m < f β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest n : β„• rest : List Char P : f β‰₯ n + 1 ⊒ toDigitsCore b f n rest = toDigitsCore b (n + 1) n rest
b : β„• Q : b > 1 f : β„• ih : βˆ€ (m : β„•), m < f β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest n : β„• rest : List Char P : f β‰₯ n + 1 ⊒ (match f, n, rest with | 0, x, ds => ds | succ fuel, n, ds => let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: ds else toDigitsCore b fuel n' (d :: ds)) = let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: rest else toDigitsCore b (Nat.add n 0) n' (d :: rest)
Please generate a tactic in lean4 to solve the state. STATE: b : β„• Q : b > 1 f : β„• ih : βˆ€ (m : β„•), m < f β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest n : β„• rest : List Char P : f β‰₯ n + 1 ⊒ toDigitsCore b f n rest = toDigitsCore b (n + 1) n rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
simp
b : β„• Q : b > 1 f : β„• ih : βˆ€ (m : β„•), m < f β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest n : β„• rest : List Char P : f β‰₯ n + 1 ⊒ (match f, n, rest with | 0, x, ds => ds | succ fuel, n, ds => let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: ds else toDigitsCore b fuel n' (d :: ds)) = let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: rest else toDigitsCore b (Nat.add n 0) n' (d :: rest)
b : β„• Q : b > 1 f : β„• ih : βˆ€ (m : β„•), m < f β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest n : β„• rest : List Char P : f β‰₯ n + 1 ⊒ (match f, n, rest with | 0, x, ds => ds | succ fuel, n, ds => if n / b = 0 then digitChar (n % b) :: ds else toDigitsCore b fuel (n / b) (digitChar (n % b) :: ds)) = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) (digitChar (n % b) :: rest)
Please generate a tactic in lean4 to solve the state. STATE: b : β„• Q : b > 1 f : β„• ih : βˆ€ (m : β„•), m < f β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest n : β„• rest : List Char P : f β‰₯ n + 1 ⊒ (match f, n, rest with | 0, x, ds => ds | succ fuel, n, ds => let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: ds else toDigitsCore b fuel n' (d :: ds)) = let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: rest else toDigitsCore b (Nat.add n 0) n' (d :: rest) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
split
b : β„• Q : b > 1 f : β„• ih : βˆ€ (m : β„•), m < f β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest n : β„• rest : List Char P : f β‰₯ n + 1 ⊒ (match f, n, rest with | 0, x, ds => ds | succ fuel, n, ds => if n / b = 0 then digitChar (n % b) :: ds else toDigitsCore b fuel (n / b) (digitChar (n % b) :: ds)) = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) (digitChar (n % b) :: rest)
case h_1 b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char ih : βˆ€ (m : β„•), m < 0 β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : 0 β‰₯ n + 1 ⊒ rest = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) (digitChar (n % b) :: rest) case h_2 b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char fuel✝ : β„• ih : βˆ€ (m : β„•), m < succ fuel✝ β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ fuel✝ β‰₯ n + 1 ⊒ (if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b fuel✝ (n / b) (digitChar (n % b) :: rest)) = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) (digitChar (n % b) :: rest)
Please generate a tactic in lean4 to solve the state. STATE: b : β„• Q : b > 1 f : β„• ih : βˆ€ (m : β„•), m < f β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest n : β„• rest : List Char P : f β‰₯ n + 1 ⊒ (match f, n, rest with | 0, x, ds => ds | succ fuel, n, ds => if n / b = 0 then digitChar (n % b) :: ds else toDigitsCore b fuel (n / b) (digitChar (n % b) :: ds)) = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) (digitChar (n % b) :: rest) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
case h_1 => simp at P
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char ih : βˆ€ (m : β„•), m < 0 β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : 0 β‰₯ n + 1 ⊒ rest = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) (digitChar (n % b) :: rest)
no goals
Please generate a tactic in lean4 to solve the state. STATE: b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char ih : βˆ€ (m : β„•), m < 0 β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : 0 β‰₯ n + 1 ⊒ rest = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) (digitChar (n % b) :: rest) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
case h_2 n' => conv => left; rw [Nat.todigitsCore_accumulates_suffix] conv => right; rw [Nat.todigitsCore_accumulates_suffix] split case inl => rfl case inr => simp rw [ih] . cases h: n == (n / b) + 1 with | false => simp at h rw [← Nat.toDigits, ih, ← Nat.toDigits] . calc succ n' β‰₯ n + 1 := P _ > n := by simp only [gt_iff_lt, lt_add_iff_pos_right] . simp [h] have hβ‚‚: n β‰₯ n / b + 1 := by simp apply Nat.div_lt_self . apply Nat.pos_of_ne_zero; intro h; simp only [gt_iff_lt, h, Nat.zero_div, not_true] at * . exact Q simp [ge_iff_le] at hβ‚‚ have h₃:= Nat.eq_or_lt_of_le hβ‚‚ cases h₃ with | inl hβ‚„ => exfalso; apply h; simp only [hβ‚„] | inr hβ‚„ => exact hβ‚‚ | true => simp at h rw [← h] . simp . simp [Nat.succ_eq_add_one] at P calc n' β‰₯ n := P n β‰₯ n / b + 1 := by simp only [add_lt_add_iff_right]; apply Nat.div_lt_self; apply Nat.pos_of_ne_zero; intro h; simp only [gt_iff_lt, h, Nat.zero_div, not_true] at *; apply Q
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 ⊒ (if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n' (n / b) (digitChar (n % b) :: rest)) = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) (digitChar (n % b) :: rest)
no goals
Please generate a tactic in lean4 to solve the state. STATE: b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 ⊒ (if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n' (n / b) (digitChar (n % b) :: rest)) = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) (digitChar (n % b) :: rest) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
simp at P
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char ih : βˆ€ (m : β„•), m < 0 β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : 0 β‰₯ n + 1 ⊒ rest = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) (digitChar (n % b) :: rest)
no goals
Please generate a tactic in lean4 to solve the state. STATE: b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char ih : βˆ€ (m : β„•), m < 0 β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : 0 β‰₯ n + 1 ⊒ rest = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) (digitChar (n % b) :: rest) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
conv => left; rw [Nat.todigitsCore_accumulates_suffix]
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 ⊒ (if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n' (n / b) (digitChar (n % b) :: rest)) = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) (digitChar (n % b) :: rest)
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 ⊒ (if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n' (n / b) [] ++ digitChar (n % b) :: rest) = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) (digitChar (n % b) :: rest)
Please generate a tactic in lean4 to solve the state. STATE: b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 ⊒ (if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n' (n / b) (digitChar (n % b) :: rest)) = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) (digitChar (n % b) :: rest) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
conv => right; rw [Nat.todigitsCore_accumulates_suffix]
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 ⊒ (if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n' (n / b) [] ++ digitChar (n % b) :: rest) = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) (digitChar (n % b) :: rest)
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 ⊒ (if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n' (n / b) [] ++ digitChar (n % b) :: rest) = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) [] ++ digitChar (n % b) :: rest
Please generate a tactic in lean4 to solve the state. STATE: b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 ⊒ (if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n' (n / b) [] ++ digitChar (n % b) :: rest) = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) (digitChar (n % b) :: rest) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
split
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 ⊒ (if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n' (n / b) [] ++ digitChar (n % b) :: rest) = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) [] ++ digitChar (n % b) :: rest
case inl b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : n / b = 0 ⊒ digitChar (n % b) :: rest = digitChar (n % b) :: rest case inr b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ toDigitsCore b n' (n / b) [] ++ digitChar (n % b) :: rest = toDigitsCore b n (n / b) [] ++ digitChar (n % b) :: rest
Please generate a tactic in lean4 to solve the state. STATE: b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 ⊒ (if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n' (n / b) [] ++ digitChar (n % b) :: rest) = if n / b = 0 then digitChar (n % b) :: rest else toDigitsCore b n (n / b) [] ++ digitChar (n % b) :: rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
case inl => rfl
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : n / b = 0 ⊒ digitChar (n % b) :: rest = digitChar (n % b) :: rest
no goals
Please generate a tactic in lean4 to solve the state. STATE: b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : n / b = 0 ⊒ digitChar (n % b) :: rest = digitChar (n % b) :: rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
case inr => simp rw [ih] . cases h: n == (n / b) + 1 with | false => simp at h rw [← Nat.toDigits, ih, ← Nat.toDigits] . calc succ n' β‰₯ n + 1 := P _ > n := by simp only [gt_iff_lt, lt_add_iff_pos_right] . simp [h] have hβ‚‚: n β‰₯ n / b + 1 := by simp apply Nat.div_lt_self . apply Nat.pos_of_ne_zero; intro h; simp only [gt_iff_lt, h, Nat.zero_div, not_true] at * . exact Q simp [ge_iff_le] at hβ‚‚ have h₃:= Nat.eq_or_lt_of_le hβ‚‚ cases h₃ with | inl hβ‚„ => exfalso; apply h; simp only [hβ‚„] | inr hβ‚„ => exact hβ‚‚ | true => simp at h rw [← h] . simp . simp [Nat.succ_eq_add_one] at P calc n' β‰₯ n := P n β‰₯ n / b + 1 := by simp only [add_lt_add_iff_right]; apply Nat.div_lt_self; apply Nat.pos_of_ne_zero; intro h; simp only [gt_iff_lt, h, Nat.zero_div, not_true] at *; apply Q
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ toDigitsCore b n' (n / b) [] ++ digitChar (n % b) :: rest = toDigitsCore b n (n / b) [] ++ digitChar (n % b) :: rest
no goals
Please generate a tactic in lean4 to solve the state. STATE: b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ toDigitsCore b n' (n / b) [] ++ digitChar (n % b) :: rest = toDigitsCore b n (n / b) [] ++ digitChar (n % b) :: rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
rfl
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : n / b = 0 ⊒ digitChar (n % b) :: rest = digitChar (n % b) :: rest
no goals
Please generate a tactic in lean4 to solve the state. STATE: b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : n / b = 0 ⊒ digitChar (n % b) :: rest = digitChar (n % b) :: rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
simp
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ toDigitsCore b n' (n / b) [] ++ digitChar (n % b) :: rest = toDigitsCore b n (n / b) [] ++ digitChar (n % b) :: rest
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ toDigitsCore b n' (n / b) [] = toDigitsCore b n (n / b) []
Please generate a tactic in lean4 to solve the state. STATE: b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ toDigitsCore b n' (n / b) [] ++ digitChar (n % b) :: rest = toDigitsCore b n (n / b) [] ++ digitChar (n % b) :: rest TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
rw [ih]
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ toDigitsCore b n' (n / b) [] = toDigitsCore b n (n / b) []
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ toDigitsCore b (n / b + 1) (n / b) [] = toDigitsCore b n (n / b) [] case a b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ n' < succ n' case P b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ n' β‰₯ n / b + 1
Please generate a tactic in lean4 to solve the state. STATE: b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ toDigitsCore b n' (n / b) [] = toDigitsCore b n (n / b) [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
. cases h: n == (n / b) + 1 with | false => simp at h rw [← Nat.toDigits, ih, ← Nat.toDigits] . calc succ n' β‰₯ n + 1 := P _ > n := by simp only [gt_iff_lt, lt_add_iff_pos_right] . simp [h] have hβ‚‚: n β‰₯ n / b + 1 := by simp apply Nat.div_lt_self . apply Nat.pos_of_ne_zero; intro h; simp only [gt_iff_lt, h, Nat.zero_div, not_true] at * . exact Q simp [ge_iff_le] at hβ‚‚ have h₃:= Nat.eq_or_lt_of_le hβ‚‚ cases h₃ with | inl hβ‚„ => exfalso; apply h; simp only [hβ‚„] | inr hβ‚„ => exact hβ‚‚ | true => simp at h rw [← h]
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ toDigitsCore b (n / b + 1) (n / b) [] = toDigitsCore b n (n / b) [] case a b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ n' < succ n' case P b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ n' β‰₯ n / b + 1
case a b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ n' < succ n' case P b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ n' β‰₯ n / b + 1
Please generate a tactic in lean4 to solve the state. STATE: b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ toDigitsCore b (n / b + 1) (n / b) [] = toDigitsCore b n (n / b) [] case a b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ n' < succ n' case P b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ n' β‰₯ n / b + 1 TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
. simp
case a b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ n' < succ n' case P b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ n' β‰₯ n / b + 1
case P b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ n' β‰₯ n / b + 1
Please generate a tactic in lean4 to solve the state. STATE: case a b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ n' < succ n' case P b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ n' β‰₯ n / b + 1 TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
. simp [Nat.succ_eq_add_one] at P calc n' β‰₯ n := P n β‰₯ n / b + 1 := by simp only [add_lt_add_iff_right]; apply Nat.div_lt_self; apply Nat.pos_of_ne_zero; intro h; simp only [gt_iff_lt, h, Nat.zero_div, not_true] at *; apply Q
case P b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ n' β‰₯ n / b + 1
no goals
Please generate a tactic in lean4 to solve the state. STATE: case P b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 ⊒ n' β‰₯ n / b + 1 TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
simp at h
case false b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : (n == n / b + 1) = false ⊒ toDigitsCore b (n / b + 1) (n / b) [] = toDigitsCore b n (n / b) []
case false b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : Β¬n = n / b + 1 ⊒ toDigitsCore b (n / b + 1) (n / b) [] = toDigitsCore b n (n / b) []
Please generate a tactic in lean4 to solve the state. STATE: case false b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : (n == n / b + 1) = false ⊒ toDigitsCore b (n / b + 1) (n / b) [] = toDigitsCore b n (n / b) [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
rw [← Nat.toDigits, ih, ← Nat.toDigits]
case false b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : Β¬n = n / b + 1 ⊒ toDigitsCore b (n / b + 1) (n / b) [] = toDigitsCore b n (n / b) []
case false.a b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : Β¬n = n / b + 1 ⊒ n < succ n' case false.P b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : Β¬n = n / b + 1 ⊒ n β‰₯ n / b + 1
Please generate a tactic in lean4 to solve the state. STATE: case false b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : Β¬n = n / b + 1 ⊒ toDigitsCore b (n / b + 1) (n / b) [] = toDigitsCore b n (n / b) [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
. calc succ n' β‰₯ n + 1 := P _ > n := by simp only [gt_iff_lt, lt_add_iff_pos_right]
case false.a b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : Β¬n = n / b + 1 ⊒ n < succ n' case false.P b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : Β¬n = n / b + 1 ⊒ n β‰₯ n / b + 1
case false.P b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : Β¬n = n / b + 1 ⊒ n β‰₯ n / b + 1
Please generate a tactic in lean4 to solve the state. STATE: case false.a b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : Β¬n = n / b + 1 ⊒ n < succ n' case false.P b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : Β¬n = n / b + 1 ⊒ n β‰₯ n / b + 1 TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
. simp [h] have hβ‚‚: n β‰₯ n / b + 1 := by simp apply Nat.div_lt_self . apply Nat.pos_of_ne_zero; intro h; simp only [gt_iff_lt, h, Nat.zero_div, not_true] at * . exact Q simp [ge_iff_le] at hβ‚‚ have h₃:= Nat.eq_or_lt_of_le hβ‚‚ cases h₃ with | inl hβ‚„ => exfalso; apply h; simp only [hβ‚„] | inr hβ‚„ => exact hβ‚‚
case false.P b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : Β¬n = n / b + 1 ⊒ n β‰₯ n / b + 1
no goals
Please generate a tactic in lean4 to solve the state. STATE: case false.P b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : Β¬n = n / b + 1 ⊒ n β‰₯ n / b + 1 TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
simp only [gt_iff_lt, lt_add_iff_pos_right]
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : Β¬n = n / b + 1 ⊒ n + 1 > n
no goals
Please generate a tactic in lean4 to solve the state. STATE: b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : Β¬n = n / b + 1 ⊒ n + 1 > n TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_fuel_irrelevant
[185, 1]
[229, 187]
simp
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : Β¬n = n / b + 1 ⊒ n β‰₯ n / b + 1
b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : Β¬n = n / b + 1 ⊒ n / b + 1 ≀ n
Please generate a tactic in lean4 to solve the state. STATE: b : β„• Q : b > 1 n : β„• rest : List Char x✝² x✝¹ : β„• x✝ : List Char n' : β„• ih : βˆ€ (m : β„•), m < succ n' β†’ βˆ€ {n : β„•} {rest : List Char}, m β‰₯ n + 1 β†’ toDigitsCore b m n rest = toDigitsCore b (n + 1) n rest P : succ n' β‰₯ n + 1 h✝ : Β¬n / b = 0 h : Β¬n = n / b + 1 ⊒ n β‰₯ n / b + 1 TACTIC: