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/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2021/N2/N2.lean | IMOSL.IMO2021N2.good_cond2_k_witness | [64, 1] | [89, 51] | exact Nat.add_le_add h (Nat.le_add_left 1 k) | case intro.intro.inr.refine_2
k : β
h1 : 2 * k ^ 2 + 4 * k + 2 = 2 * (k + 1) ^ 2
h : 8 β€ k + 1
β’ 8 + 1 β€ k + 1 + (k + 1) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case intro.intro.inr.refine_2
k : β
h1 : 2 * k ^ 2 + 4 * k + 2 = 2 * (k + 1) ^ 2
h : 8 β€ k + 1
β’ 8 + 1 β€ k + 1 + (k + 1)
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2021/N2/N2.lean | IMOSL.IMO2021N2.good_cond2_k_witness | [64, 1] | [89, 51] | rw [add_sq, Nat.mul_add, Nat.mul_add, Nat.mul_one, β Nat.mul_assoc] | k : β
h : 99 β€ 2 * k ^ 2 + 4 * k
h1 : k ^ 2 + 6 * k + 8 β€ 2 * k ^ 2 + 4 * k
β’ 2 * k ^ 2 + 4 * k + 2 = 2 * (k + 1) ^ 2 | k : β
h : 99 β€ 2 * k ^ 2 + 4 * k
h1 : k ^ 2 + 6 * k + 8 β€ 2 * k ^ 2 + 4 * k
β’ 2 * k ^ 2 + 4 * k + 2 = 2 * k ^ 2 + 2 * 2 * k + 2 * 1 ^ 2 | Please generate a tactic in lean4 to solve the state.
STATE:
k : β
h : 99 β€ 2 * k ^ 2 + 4 * k
h1 : k ^ 2 + 6 * k + 8 β€ 2 * k ^ 2 + 4 * k
β’ 2 * k ^ 2 + 4 * k + 2 = 2 * (k + 1) ^ 2
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2021/N2/N2.lean | IMOSL.IMO2021N2.good_cond2_k_witness | [64, 1] | [89, 51] | rfl | k : β
h : 99 β€ 2 * k ^ 2 + 4 * k
h1 : k ^ 2 + 6 * k + 8 β€ 2 * k ^ 2 + 4 * k
β’ 2 * k ^ 2 + 4 * k + 2 = 2 * k ^ 2 + 2 * 2 * k + 2 * 1 ^ 2 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
k : β
h : 99 β€ 2 * k ^ 2 + 4 * k
h1 : k ^ 2 + 6 * k + 8 β€ 2 * k ^ 2 + 4 * k
β’ 2 * k ^ 2 + 4 * k + 2 = 2 * k ^ 2 + 2 * 2 * k + 2 * 1 ^ 2
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.x_mul4 | [48, 1] | [50, 80] | change x (2 * 2 * k) = xor k.bodd (x k) | k : β
β’ x (4 * k) = xor k.bodd (x k) | k : β
β’ x (2 * 2 * k) = xor k.bodd (x k) | Please generate a tactic in lean4 to solve the state.
STATE:
k : β
β’ x (4 * k) = xor k.bodd (x k)
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.x_mul4 | [48, 1] | [50, 80] | rw [mul_assoc, x_mul2, x_mul2, β Nat.bit0_val, Nat.bodd_bit0, Bool.false_xor] | k : β
β’ x (2 * 2 * k) = xor k.bodd (x k) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
k : β
β’ x (2 * 2 * k) = xor k.bodd (x k)
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.x_mul4_add1 | [52, 1] | [55, 51] | change x (2 * 2 * k + 1) = !x (2 * 2 * k) | k : β
β’ x (4 * k + 1) = !x (4 * k) | k : β
β’ x (2 * 2 * k + 1) = !x (2 * 2 * k) | Please generate a tactic in lean4 to solve the state.
STATE:
k : β
β’ x (4 * k + 1) = !x (4 * k)
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.x_mul4_add1 | [52, 1] | [55, 51] | rw [mul_assoc, x_mul2, x_mul2_add1,
β Nat.bit0_val, Nat.bodd_bit0, Bool.false_xor] | k : β
β’ x (2 * 2 * k + 1) = !x (2 * 2 * k) | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
k : β
β’ x (2 * 2 * k + 1) = !x (2 * 2 * k)
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.x_mul4_add2 | [57, 1] | [60, 64] | change x (2 * 2 * k + 2) = x k | k : β
β’ x (4 * k + 2) = x k | k : β
β’ x (2 * 2 * k + 2) = x k | Please generate a tactic in lean4 to solve the state.
STATE:
k : β
β’ x (4 * k + 2) = x k
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.x_mul4_add2 | [57, 1] | [60, 64] | rw [mul_assoc, β mul_add_one, x_mul2, x_mul2_add1,
β Nat.bit1_val, Nat.bodd_bit1, Bool.true_xor, Bool.not_not] | k : β
β’ x (2 * 2 * k + 2) = x k | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
k : β
β’ x (2 * 2 * k + 2) = x k
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.x_mul4_add3 | [62, 1] | [64, 72] | change x (2 * 2 * k + 2 + 1) = x k | k : β
β’ x (4 * k + 3) = x k | k : β
β’ x (2 * 2 * k + 2 + 1) = x k | Please generate a tactic in lean4 to solve the state.
STATE:
k : β
β’ x (4 * k + 3) = x k
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.x_mul4_add3 | [62, 1] | [64, 72] | rw [mul_assoc, β mul_add_one, x_mul2_add1, x_mul2_add1, Bool.not_not] | k : β
β’ x (2 * 2 * k + 2 + 1) = x k | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
k : β
β’ x (2 * 2 * k + 2 + 1) = x k
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_mul4_add2 | [79, 1] | [81, 34] | rw [S_succ, S_succ, add_assoc, add_right_eq_self, x_mul4_add1] | k : β
β’ S (4 * k + 2) = S (4 * k) | k : β
β’ ((bif x (4 * k) then -1 else 1) + bif !x (4 * k) then -1 else 1) = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
k : β
β’ S (4 * k + 2) = S (4 * k)
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_mul4_add2 | [79, 1] | [81, 34] | exact (x (4 * k)).recOn rfl rfl | k : β
β’ ((bif x (4 * k) then -1 else 1) + bif !x (4 * k) then -1 else 1) = 0 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
k : β
β’ ((bif x (4 * k) then -1 else 1) + bif !x (4 * k) then -1 else 1) = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_mul4 | [83, 1] | [87, 52] | change S (4 * k + 4) = 2 * S k.succ | k : β
h : S (4 * k) = 2 * S k
β’ S (4 * k.succ) = 2 * S k.succ | k : β
h : S (4 * k) = 2 * S k
β’ S (4 * k + 4) = 2 * S k.succ | Please generate a tactic in lean4 to solve the state.
STATE:
k : β
h : S (4 * k) = 2 * S k
β’ S (4 * k.succ) = 2 * S k.succ
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_mul4 | [83, 1] | [87, 52] | rw [S_succ, x_mul4_add3, S_succ, x_mul4_add2, S_mul4_add2,
h, add_assoc, β two_mul, β mul_add, β S_succ] | k : β
h : S (4 * k) = 2 * S k
β’ S (4 * k + 4) = 2 * S k.succ | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
k : β
h : S (4 * k) = 2 * S k
β’ S (4 * k + 4) = 2 * S k.succ
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_parity | [89, 1] | [92, 28] | rw [Nat.bodd_succ, S_succ, Int.bodd_add, h, β Bool.xor_true] | k : β
h : (S k).bodd = k.bodd
β’ (S k.succ).bodd = k.succ.bodd | k : β
h : (S k).bodd = k.bodd
β’ xor k.bodd (bif x k then -1 else 1).bodd = xor k.bodd true | Please generate a tactic in lean4 to solve the state.
STATE:
k : β
h : (S k).bodd = k.bodd
β’ (S k.succ).bodd = k.succ.bodd
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_parity | [89, 1] | [92, 28] | exact (x k).rec rfl rfl | k : β
h : (S k).bodd = k.bodd
β’ xor k.bodd (bif x k then -1 else 1).bodd = xor k.bodd true | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
k : β
h : (S k).bodd = k.bodd
β’ xor k.bodd (bif x k then -1 else 1).bodd = xor k.bodd true
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | refine β¨fun h0 β¦ (and_iff_right_of_imp ?_).mpr ?_, fun h0 β¦ ?_β© | q r : β
h : r < 4
β’ S (4 * q + r) = 0 β S q = 0 β§ (r = 0 β¨ r = 2) | case refine_1
q r : β
h : r < 4
h0 : S (4 * q + r) = 0
β’ r = 0 β¨ r = 2 β S q = 0
case refine_2
q r : β
h : r < 4
h0 : S (4 * q + r) = 0
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
q r : β
h : r < 4
β’ S (4 * q + r) = 0 β S q = 0 β§ (r = 0 β¨ r = 2)
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | replace h : (2 : β€) β 0 := two_ne_zero | case refine_1
q r : β
h : r < 4
h0 : S (4 * q + r) = 0
β’ r = 0 β¨ r = 2 β S q = 0
case refine_2
q r : β
h : r < 4
h0 : S (4 * q + r) = 0
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | case refine_1
q r : β
h0 : S (4 * q + r) = 0
h : 2 β 0
β’ r = 0 β¨ r = 2 β S q = 0
case refine_2
q r : β
h : r < 4
h0 : S (4 * q + r) = 0
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
case refine_1
q r : β
h : r < 4
h0 : S (4 * q + r) = 0
β’ r = 0 β¨ r = 2 β S q = 0
case refine_2
q r : β
h : r < 4
h0 : S (4 * q + r) = 0
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | rintro (rfl | rfl) | case refine_1
q r : β
h0 : S (4 * q + r) = 0
h : 2 β 0
β’ r = 0 β¨ r = 2 β S q = 0
case refine_2
q r : β
h : r < 4
h0 : S (4 * q + r) = 0
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | case refine_1.inl
q : β
h : 2 β 0
h0 : S (4 * q + 0) = 0
β’ S q = 0
case refine_1.inr
q : β
h : 2 β 0
h0 : S (4 * q + 2) = 0
β’ S q = 0
case refine_2
q r : β
h : r < 4
h0 : S (4 * q + r) = 0
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
case refine_1
q r : β
h0 : S (4 * q + r) = 0
h : 2 β 0
β’ r = 0 β¨ r = 2 β S q = 0
case refine_2
q r : β
h : r < 4
h0 : S (4 * q + r) = 0
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | apply_fun Int.bodd at h0 | case refine_2
q r : β
h : r < 4
h0 : S (4 * q + r) = 0
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | case refine_2
q r : β
h : r < 4
h0 : (S (4 * q + r)).bodd = Int.bodd 0
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
case refine_2
q r : β
h : r < 4
h0 : S (4 * q + r) = 0
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | rw [Int.bodd_zero, S_parity, Nat.bodd_add, Nat.bodd_mul] at h0 | case refine_2
q r : β
h : r < 4
h0 : (S (4 * q + r)).bodd = Int.bodd 0
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | case refine_2
q r : β
h : r < 4
h0 : xor (Nat.bodd 4 && q.bodd) r.bodd = false
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
case refine_2
q r : β
h : r < 4
h0 : (S (4 * q + r)).bodd = Int.bodd 0
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | change xor (false && q.bodd) r.bodd = false at h0 | case refine_2
q r : β
h : r < 4
h0 : xor (Nat.bodd 4 && q.bodd) r.bodd = false
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | case refine_2
q r : β
h : r < 4
h0 : xor (false && q.bodd) r.bodd = false
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
case refine_2
q r : β
h : r < 4
h0 : xor (Nat.bodd 4 && q.bodd) r.bodd = false
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | iterate 3 rw [Nat.lt_succ_iff_lt_or_eq] at h | case refine_2
q r : β
h : r < 4
h0 : xor (false && q.bodd) r.bodd = false
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | case refine_2
q r : β
h : ((r < 1 β¨ r = 1) β¨ r = 2) β¨ r = 3
h0 : xor (false && q.bodd) r.bodd = false
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
case refine_2
q r : β
h : r < 4
h0 : xor (false && q.bodd) r.bodd = false
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | rw [Nat.lt_one_iff, or_assoc, or_or_or_comm] at h | case refine_2
q r : β
h : ((r < 1 β¨ r = 1) β¨ r = 2) β¨ r = 3
h0 : xor (false && q.bodd) r.bodd = false
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | case refine_2
q r : β
h : (r = 0 β¨ r = 2) β¨ r = 1 β¨ r = 3
h0 : xor (false && q.bodd) r.bodd = false
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
case refine_2
q r : β
h : ((r < 1 β¨ r = 1) β¨ r = 2) β¨ r = 3
h0 : xor (false && q.bodd) r.bodd = false
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | revert h | case refine_2
q r : β
h : (r = 0 β¨ r = 2) β¨ r = 1 β¨ r = 3
h0 : xor (false && q.bodd) r.bodd = false
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | case refine_2
q r : β
h0 : xor (false && q.bodd) r.bodd = false
β’ (r = 0 β¨ r = 2) β¨ r = 1 β¨ r = 3 β r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
case refine_2
q r : β
h : (r = 0 β¨ r = 2) β¨ r = 1 β¨ r = 3
h0 : xor (false && q.bodd) r.bodd = false
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | refine' (or_iff_left _).mp | case refine_2
q r : β
h0 : xor (false && q.bodd) r.bodd = false
β’ (r = 0 β¨ r = 2) β¨ r = 1 β¨ r = 3 β r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | case refine_2
q r : β
h0 : xor (false && q.bodd) r.bodd = false
β’ Β¬(r = 1 β¨ r = 3)
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
case refine_2
q r : β
h0 : xor (false && q.bodd) r.bodd = false
β’ (r = 0 β¨ r = 2) β¨ r = 1 β¨ r = 3 β r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | rintro (rfl | rfl) <;> exact Bool.true_eq_false_eq_False h0 | case refine_2
q r : β
h0 : xor (false && q.bodd) r.bodd = false
β’ Β¬(r = 1 β¨ r = 3)
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
case refine_2
q r : β
h0 : xor (false && q.bodd) r.bodd = false
β’ Β¬(r = 1 β¨ r = 3)
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | rcases h0 with β¨h0, rfl | rflβ© | case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | case refine_3.intro.inl
q : β
h0 : S q = 0
h : 0 < 4
β’ S (4 * q + 0) = 0
case refine_3.intro.inr
q : β
h0 : S q = 0
h : 2 < 4
β’ S (4 * q + 2) = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | rwa [add_zero, S_mul4, mul_eq_zero, or_iff_right h] at h0 | case refine_1.inl
q : β
h : 2 β 0
h0 : S (4 * q + 0) = 0
β’ S q = 0 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case refine_1.inl
q : β
h : 2 β 0
h0 : S (4 * q + 0) = 0
β’ S q = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | rwa [S_mul4_add2, S_mul4, mul_eq_zero, or_iff_right h] at h0 | case refine_1.inr
q : β
h : 2 β 0
h0 : S (4 * q + 2) = 0
β’ S q = 0 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case refine_1.inr
q : β
h : 2 β 0
h0 : S (4 * q + 2) = 0
β’ S q = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | rw [Nat.lt_succ_iff_lt_or_eq] at h | case refine_2
q r : β
h : (r < 2 β¨ r = 2) β¨ r = 3
h0 : xor (false && q.bodd) r.bodd = false
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | case refine_2
q r : β
h : ((r < 1 β¨ r = 1) β¨ r = 2) β¨ r = 3
h0 : xor (false && q.bodd) r.bodd = false
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
case refine_2
q r : β
h : (r < 2 β¨ r = 2) β¨ r = 3
h0 : xor (false && q.bodd) r.bodd = false
β’ r = 0 β¨ r = 2
case refine_3
q r : β
h : r < 4
h0 : S q = 0 β§ (r = 0 β¨ r = 2)
β’ S (4 * q + r) = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | rw [add_zero, S_mul4, h0] | case refine_3.intro.inl
q : β
h0 : S q = 0
h : 0 < 4
β’ S (4 * q + 0) = 0 | case refine_3.intro.inl
q : β
h0 : S q = 0
h : 0 < 4
β’ 2 * 0 = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
case refine_3.intro.inl
q : β
h0 : S q = 0
h : 0 < 4
β’ S (4 * q + 0) = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | rfl | case refine_3.intro.inl
q : β
h0 : S q = 0
h : 0 < 4
β’ 2 * 0 = 0 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case refine_3.intro.inl
q : β
h0 : S q = 0
h : 0 < 4
β’ 2 * 0 = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | rw [S_mul4_add2, S_mul4, h0] | case refine_3.intro.inr
q : β
h0 : S q = 0
h : 2 < 4
β’ S (4 * q + 2) = 0 | case refine_3.intro.inr
q : β
h0 : S q = 0
h : 2 < 4
β’ 2 * 0 = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
case refine_3.intro.inr
q : β
h0 : S q = 0
h : 2 < 4
β’ S (4 * q + 2) = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.S_four_mul_add_eq_zero_iff | [94, 1] | [113, 38] | rfl | case refine_3.intro.inr
q : β
h0 : S q = 0
h : 2 < 4
β’ 2 * 0 = 0 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case refine_3.intro.inr
q : β
h0 : S q = 0
h : 2 < 4
β’ 2 * 0 = 0
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | intro k h | β’ β (k : β), S k = 0 β x k = false | k : β
h : S k = 0
β’ x k = false | Please generate a tactic in lean4 to solve the state.
STATE:
β’ β (k : β), S k = 0 β x k = false
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | induction' k using Nat.strong_induction_on with k k_ih | k : β
h : S k = 0
β’ x k = false | case h
k : β
k_ih : β m < k, S m = 0 β x m = false
h : S k = 0
β’ x k = false | Please generate a tactic in lean4 to solve the state.
STATE:
k : β
h : S k = 0
β’ x k = false
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | obtain β¨q, r, h0, rflβ© : β q r : β, r < 4 β§ 4 * q + r = k :=
β¨k / 4, k % 4, Nat.mod_lt k four_pos, Nat.div_add_mod k 4β© | case h
k : β
k_ih : β m < k, S m = 0 β x m = false
h : S k = 0
β’ x k = false | case h.intro.intro.intro
q r : β
h0 : r < 4
k_ih : β m < 4 * q + r, S m = 0 β x m = false
h : S (4 * q + r) = 0
β’ x (4 * q + r) = false | Please generate a tactic in lean4 to solve the state.
STATE:
case h
k : β
k_ih : β m < k, S m = 0 β x m = false
h : S k = 0
β’ x k = false
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | rw [S_four_mul_add_eq_zero_iff q h0, or_comm] at h | case h.intro.intro.intro
q r : β
h0 : r < 4
k_ih : β m < 4 * q + r, S m = 0 β x m = false
h : S (4 * q + r) = 0
β’ x (4 * q + r) = false | case h.intro.intro.intro
q r : β
h0 : r < 4
k_ih : β m < 4 * q + r, S m = 0 β x m = false
h : S q = 0 β§ (r = 2 β¨ r = 0)
β’ x (4 * q + r) = false | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro
q r : β
h0 : r < 4
k_ih : β m < 4 * q + r, S m = 0 β x m = false
h : S (4 * q + r) = 0
β’ x (4 * q + r) = false
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | clear h0 | case h.intro.intro.intro
q r : β
h0 : r < 4
k_ih : β m < 4 * q + r, S m = 0 β x m = false
h : S q = 0 β§ (r = 2 β¨ r = 0)
β’ x (4 * q + r) = false | case h.intro.intro.intro
q r : β
k_ih : β m < 4 * q + r, S m = 0 β x m = false
h : S q = 0 β§ (r = 2 β¨ r = 0)
β’ x (4 * q + r) = false | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro
q r : β
h0 : r < 4
k_ih : β m < 4 * q + r, S m = 0 β x m = false
h : S q = 0 β§ (r = 2 β¨ r = 0)
β’ x (4 * q + r) = false
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | rcases h with β¨h, rfl | rflβ© | case h.intro.intro.intro
q r : β
k_ih : β m < 4 * q + r, S m = 0 β x m = false
h : S q = 0 β§ (r = 2 β¨ r = 0)
β’ x (4 * q + r) = false | case h.intro.intro.intro.intro.inl
q : β
h : S q = 0
k_ih : β m < 4 * q + 2, S m = 0 β x m = false
β’ x (4 * q + 2) = false
case h.intro.intro.intro.intro.inr
q : β
h : S q = 0
k_ih : β m < 4 * q + 0, S m = 0 β x m = false
β’ x (4 * q + 0) = false | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro
q r : β
k_ih : β m < 4 * q + r, S m = 0 β x m = false
h : S q = 0 β§ (r = 2 β¨ r = 0)
β’ x (4 * q + r) = false
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | rcases q.eq_zero_or_pos with (rfl | h0) | case h.intro.intro.intro.intro.inr
q : β
h : S q = 0
k_ih : β m < 4 * q + 0, S m = 0 β x m = false
β’ x (4 * q + 0) = false | case h.intro.intro.intro.intro.inr.inl
h : S 0 = 0
k_ih : β m < 4 * 0 + 0, S m = 0 β x m = false
β’ x (4 * 0 + 0) = false
case h.intro.intro.intro.intro.inr.inr
q : β
h : S q = 0
k_ih : β m < 4 * q + 0, S m = 0 β x m = false
h0 : q > 0
β’ x (4 * q + 0) = false | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.intro.inr
q : β
h : S q = 0
k_ih : β m < 4 * q + 0, S m = 0 β x m = false
β’ x (4 * q + 0) = false
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | rw [add_zero, MulZeroClass.mul_zero, x_zero] | case h.intro.intro.intro.intro.inr.inl
h : S 0 = 0
k_ih : β m < 4 * 0 + 0, S m = 0 β x m = false
β’ x (4 * 0 + 0) = false
case h.intro.intro.intro.intro.inr.inr
q : β
h : S q = 0
k_ih : β m < 4 * q + 0, S m = 0 β x m = false
h0 : q > 0
β’ x (4 * q + 0) = false | case h.intro.intro.intro.intro.inr.inr
q : β
h : S q = 0
k_ih : β m < 4 * q + 0, S m = 0 β x m = false
h0 : q > 0
β’ x (4 * q + 0) = false | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.intro.inr.inl
h : S 0 = 0
k_ih : β m < 4 * 0 + 0, S m = 0 β x m = false
β’ x (4 * 0 + 0) = false
case h.intro.intro.intro.intro.inr.inr
q : β
h : S q = 0
k_ih : β m < 4 * q + 0, S m = 0 β x m = false
h0 : q > 0
β’ x (4 * q + 0) = false
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | replace k_ih := k_ih q (lt_mul_left h0 <| Nat.succ_lt_succ <| Nat.succ_pos 2) h | case h.intro.intro.intro.intro.inr.inr
q : β
h : S q = 0
k_ih : β m < 4 * q + 0, S m = 0 β x m = false
h0 : q > 0
β’ x (4 * q + 0) = false | case h.intro.intro.intro.intro.inr.inr
q : β
h : S q = 0
h0 : q > 0
k_ih : x q = false
β’ x (4 * q + 0) = false | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.intro.inr.inr
q : β
h : S q = 0
k_ih : β m < 4 * q + 0, S m = 0 β x m = false
h0 : q > 0
β’ x (4 * q + 0) = false
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | apply_fun Int.bodd at h | case h.intro.intro.intro.intro.inr.inr
q : β
h : S q = 0
h0 : q > 0
k_ih : x q = false
β’ x (4 * q + 0) = false | case h.intro.intro.intro.intro.inr.inr
q : β
h0 : q > 0
k_ih : x q = false
h : (S q).bodd = Int.bodd 0
β’ x (4 * q + 0) = false | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.intro.inr.inr
q : β
h : S q = 0
h0 : q > 0
k_ih : x q = false
β’ x (4 * q + 0) = false
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | rw [Int.bodd_zero, S_parity] at h | case h.intro.intro.intro.intro.inr.inr
q : β
h0 : q > 0
k_ih : x q = false
h : (S q).bodd = Int.bodd 0
β’ x (4 * q + 0) = false | case h.intro.intro.intro.intro.inr.inr
q : β
h0 : q > 0
k_ih : x q = false
h : q.bodd = false
β’ x (4 * q + 0) = false | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.intro.inr.inr
q : β
h0 : q > 0
k_ih : x q = false
h : (S q).bodd = Int.bodd 0
β’ x (4 * q + 0) = false
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | rw [add_zero, x_mul4, h, k_ih] | case h.intro.intro.intro.intro.inr.inr
q : β
h0 : q > 0
k_ih : x q = false
h : q.bodd = false
β’ x (4 * q + 0) = false | case h.intro.intro.intro.intro.inr.inr
q : β
h0 : q > 0
k_ih : x q = false
h : q.bodd = false
β’ xor false false = false | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.intro.inr.inr
q : β
h0 : q > 0
k_ih : x q = false
h : q.bodd = false
β’ x (4 * q + 0) = false
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | rfl | case h.intro.intro.intro.intro.inr.inr
q : β
h0 : q > 0
k_ih : x q = false
h : q.bodd = false
β’ xor false false = false | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.intro.inr.inr
q : β
h0 : q > 0
k_ih : x q = false
h : q.bodd = false
β’ xor false false = false
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | refine Nat.rec (Int.le_refl 0) (Ξ» k h β¦ ?_) | this : β (k : β), S k = 0 β x k = false
β’ β (k : β), 0 β€ S k | this : β (k : β), S k = 0 β x k = false
k : β
h : 0 β€ S k
β’ 0 β€ S k.succ | Please generate a tactic in lean4 to solve the state.
STATE:
this : β (k : β), S k = 0 β x k = false
β’ β (k : β), 0 β€ S k
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | rw [le_iff_lt_or_eq, Int.lt_iff_add_one_le, zero_add, or_comm] at h | this : β (k : β), S k = 0 β x k = false
k : β
h : 0 β€ S k
β’ 0 β€ S k.succ | this : β (k : β), S k = 0 β x k = false
k : β
h : 0 = S k β¨ 1 β€ S k
β’ 0 β€ S k.succ | Please generate a tactic in lean4 to solve the state.
STATE:
this : β (k : β), S k = 0 β x k = false
k : β
h : 0 β€ S k
β’ 0 β€ S k.succ
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | rw [S_succ] | this : β (k : β), S k = 0 β x k = false
k : β
h : 0 = S k β¨ 1 β€ S k
β’ 0 β€ S k.succ | this : β (k : β), S k = 0 β x k = false
k : β
h : 0 = S k β¨ 1 β€ S k
β’ 0 β€ S k + bif x k then -1 else 1 | Please generate a tactic in lean4 to solve the state.
STATE:
this : β (k : β), S k = 0 β x k = false
k : β
h : 0 = S k β¨ 1 β€ S k
β’ 0 β€ S k.succ
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | rcases h with h | h | this : β (k : β), S k = 0 β x k = false
k : β
h : 0 = S k β¨ 1 β€ S k
β’ 0 β€ S k + bif x k then -1 else 1 | case inl
this : β (k : β), S k = 0 β x k = false
k : β
h : 0 = S k
β’ 0 β€ S k + bif x k then -1 else 1
case inr
this : β (k : β), S k = 0 β x k = false
k : β
h : 1 β€ S k
β’ 0 β€ S k + bif x k then -1 else 1 | Please generate a tactic in lean4 to solve the state.
STATE:
this : β (k : β), S k = 0 β x k = false
k : β
h : 0 = S k β¨ 1 β€ S k
β’ 0 β€ S k + bif x k then -1 else 1
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | rw [β h, zero_add, this k h.symm] | case inl
this : β (k : β), S k = 0 β x k = false
k : β
h : 0 = S k
β’ 0 β€ S k + bif x k then -1 else 1 | case inl
this : β (k : β), S k = 0 β x k = false
k : β
h : 0 = S k
β’ 0 β€ bif false then -1 else 1 | Please generate a tactic in lean4 to solve the state.
STATE:
case inl
this : β (k : β), S k = 0 β x k = false
k : β
h : 0 = S k
β’ 0 β€ S k + bif x k then -1 else 1
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | exact Int.zero_lt_one.le | case inl
this : β (k : β), S k = 0 β x k = false
k : β
h : 0 = S k
β’ 0 β€ bif false then -1 else 1 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case inl
this : β (k : β), S k = 0 β x k = false
k : β
h : 0 = S k
β’ 0 β€ bif false then -1 else 1
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | rw [β add_neg_self (1 : β€)] | case inr
this : β (k : β), S k = 0 β x k = false
k : β
h : 1 β€ S k
β’ 0 β€ S k + bif x k then -1 else 1 | case inr
this : β (k : β), S k = 0 β x k = false
k : β
h : 1 β€ S k
β’ 1 + -1 β€ S k + bif x k then -1 else 1 | Please generate a tactic in lean4 to solve the state.
STATE:
case inr
this : β (k : β), S k = 0 β x k = false
k : β
h : 1 β€ S k
β’ 0 β€ S k + bif x k then -1 else 1
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | exact add_le_add h ((x k).rec (neg_le_self zero_le_one) (-1).le_refl) | case inr
this : β (k : β), S k = 0 β x k = false
k : β
h : 1 β€ S k
β’ 1 + -1 β€ S k + bif x k then -1 else 1 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case inr
this : β (k : β), S k = 0 β x k = false
k : β
h : 1 β€ S k
β’ 1 + -1 β€ S k + bif x k then -1 else 1
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | rw [x_mul4_add2] | case h.intro.intro.intro.intro.inl
q : β
h : S q = 0
k_ih : β m < 4 * q + 2, S m = 0 β x m = false
β’ x (4 * q + 2) = false | case h.intro.intro.intro.intro.inl
q : β
h : S q = 0
k_ih : β m < 4 * q + 2, S m = 0 β x m = false
β’ x q = false | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.intro.inl
q : β
h : S q = 0
k_ih : β m < 4 * q + 2, S m = 0 β x m = false
β’ x (4 * q + 2) = false
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution | [122, 1] | [145, 38] | exact k_ih q (lt_add_of_le_of_pos (Nat.le_mul_of_pos_left _ four_pos) two_pos) h | case h.intro.intro.intro.intro.inl
q : β
h : S q = 0
k_ih : β m < 4 * q + 2, S m = 0 β x m = false
β’ x q = false | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.intro.inl
q : β
h : S q = 0
k_ih : β m < 4 * q + 2, S m = 0 β x m = false
β’ x q = false
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution_extra | [148, 1] | [168, 59] | induction' k using Nat.strong_induction_on with k k_ih | k : β
β’ S k = 0 β β c β Nat.digits 4 k, c = 0 β¨ c = 2 | case h
k : β
k_ih : β m < k, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ S k = 0 β β c β Nat.digits 4 k, c = 0 β¨ c = 2 | Please generate a tactic in lean4 to solve the state.
STATE:
k : β
β’ S k = 0 β β c β Nat.digits 4 k, c = 0 β¨ c = 2
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution_extra | [148, 1] | [168, 59] | obtain β¨q, r, h, rflβ© : β q r : β, r < 4 β§ 4 * q + r = k :=
β¨k / 4, k % 4, Nat.mod_lt k four_pos, Nat.div_add_mod k 4β© | case h
k : β
k_ih : β m < k, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ S k = 0 β β c β Nat.digits 4 k, c = 0 β¨ c = 2 | case h.intro.intro.intro
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ S (4 * q + r) = 0 β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | Please generate a tactic in lean4 to solve the state.
STATE:
case h
k : β
k_ih : β m < k, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ S k = 0 β β c β Nat.digits 4 k, c = 0 β¨ c = 2
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution_extra | [148, 1] | [168, 59] | rw [S_four_mul_add_eq_zero_iff q h] | case h.intro.intro.intro
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ S (4 * q + r) = 0 β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | case h.intro.intro.intro
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ S (4 * q + r) = 0 β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution_extra | [148, 1] | [168, 59] | rcases q.eq_zero_or_pos with (rfl | h0) | case h.intro.intro.intro
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | case h.intro.intro.intro.inl
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ S 0 = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * 0 + r), c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution_extra | [148, 1] | [168, 59] | rw [S_zero, eq_self_iff_true, true_and_iff, MulZeroClass.mul_zero, zero_add] | case h.intro.intro.intro.inl
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ S 0 = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * 0 + r), c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | case h.intro.intro.intro.inl
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ r = 0 β¨ r = 2 β β c β Nat.digits 4 r, c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.inl
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ S 0 = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * 0 + r), c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution_extra | [148, 1] | [168, 59] | rcases r.eq_zero_or_pos with (rfl | h0) | case h.intro.intro.intro.inl
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ r = 0 β¨ r = 2 β β c β Nat.digits 4 r, c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | case h.intro.intro.intro.inl.inl
h : 0 < 4
k_ih : β m < 4 * 0 + 0, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ 0 = 0 β¨ 0 = 2 β β c β Nat.digits 4 0, c = 0 β¨ c = 2
case h.intro.intro.intro.inl.inr
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : r > 0
β’ r = 0 β¨ r = 2 β β c β Nat.digits 4 r, c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.inl
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ r = 0 β¨ r = 2 β β c β Nat.digits 4 r, c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution_extra | [148, 1] | [168, 59] | rw [eq_self_iff_true, true_or_iff, true_iff_iff, Nat.digits_zero] | case h.intro.intro.intro.inl.inl
h : 0 < 4
k_ih : β m < 4 * 0 + 0, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ 0 = 0 β¨ 0 = 2 β β c β Nat.digits 4 0, c = 0 β¨ c = 2
case h.intro.intro.intro.inl.inr
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : r > 0
β’ r = 0 β¨ r = 2 β β c β Nat.digits 4 r, c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | case h.intro.intro.intro.inl.inl
h : 0 < 4
k_ih : β m < 4 * 0 + 0, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ β c β [], c = 0 β¨ c = 2
case h.intro.intro.intro.inl.inr
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : r > 0
β’ r = 0 β¨ r = 2 β β c β Nat.digits 4 r, c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.inl.inl
h : 0 < 4
k_ih : β m < 4 * 0 + 0, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ 0 = 0 β¨ 0 = 2 β β c β Nat.digits 4 0, c = 0 β¨ c = 2
case h.intro.intro.intro.inl.inr
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : r > 0
β’ r = 0 β¨ r = 2 β β c β Nat.digits 4 r, c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution_extra | [148, 1] | [168, 59] | intro c h0 | case h.intro.intro.intro.inl.inl
h : 0 < 4
k_ih : β m < 4 * 0 + 0, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ β c β [], c = 0 β¨ c = 2
case h.intro.intro.intro.inl.inr
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : r > 0
β’ r = 0 β¨ r = 2 β β c β Nat.digits 4 r, c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | case h.intro.intro.intro.inl.inl
h : 0 < 4
k_ih : β m < 4 * 0 + 0, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
c : β
h0 : c β []
β’ c = 0 β¨ c = 2
case h.intro.intro.intro.inl.inr
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : r > 0
β’ r = 0 β¨ r = 2 β β c β Nat.digits 4 r, c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.inl.inl
h : 0 < 4
k_ih : β m < 4 * 0 + 0, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
β’ β c β [], c = 0 β¨ c = 2
case h.intro.intro.intro.inl.inr
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : r > 0
β’ r = 0 β¨ r = 2 β β c β Nat.digits 4 r, c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution_extra | [148, 1] | [168, 59] | exact absurd h0 (by exact List.not_mem_nil c) | case h.intro.intro.intro.inl.inl
h : 0 < 4
k_ih : β m < 4 * 0 + 0, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
c : β
h0 : c β []
β’ c = 0 β¨ c = 2
case h.intro.intro.intro.inl.inr
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : r > 0
β’ r = 0 β¨ r = 2 β β c β Nat.digits 4 r, c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | case h.intro.intro.intro.inl.inr
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : r > 0
β’ r = 0 β¨ r = 2 β β c β Nat.digits 4 r, c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.inl.inl
h : 0 < 4
k_ih : β m < 4 * 0 + 0, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
c : β
h0 : c β []
β’ c = 0 β¨ c = 2
case h.intro.intro.intro.inl.inr
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : r > 0
β’ r = 0 β¨ r = 2 β β c β Nat.digits 4 r, c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution_extra | [148, 1] | [168, 59] | rw [Nat.digits_def' (Nat.succ_lt_succ <| Nat.succ_pos 2) h0,
Nat.mod_eq_of_lt h, Nat.div_eq_of_lt h, Nat.digits_zero] | case h.intro.intro.intro.inl.inr
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : r > 0
β’ r = 0 β¨ r = 2 β β c β Nat.digits 4 r, c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | case h.intro.intro.intro.inl.inr
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : r > 0
β’ r = 0 β¨ r = 2 β β c β [r], c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.inl.inr
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : r > 0
β’ r = 0 β¨ r = 2 β β c β Nat.digits 4 r, c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution_extra | [148, 1] | [168, 59] | simp_rw [List.mem_singleton] | case h.intro.intro.intro.inl.inr
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : r > 0
β’ r = 0 β¨ r = 2 β β c β [r], c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | case h.intro.intro.intro.inl.inr
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : r > 0
β’ r = 0 β¨ r = 2 β β (c : β), c = r β c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.inl.inr
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : r > 0
β’ r = 0 β¨ r = 2 β β c β [r], c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution_extra | [148, 1] | [168, 59] | rw [forall_eq] | case h.intro.intro.intro.inl.inr
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : r > 0
β’ r = 0 β¨ r = 2 β β (c : β), c = r β c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.inl.inr
r : β
h : r < 4
k_ih : β m < 4 * 0 + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : r > 0
β’ r = 0 β¨ r = 2 β β (c : β), c = r β c = 0 β¨ c = 2
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution_extra | [148, 1] | [168, 59] | replace k_ih :=
k_ih q (Nat.lt_add_right _ <| lt_mul_left h0 <| Nat.succ_lt_succ <| Nat.succ_pos 2) | case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | case h.intro.intro.intro.inr
q r : β
h : r < 4
h0 : q > 0
k_ih : S q = 0 β β c β Nat.digits 4 q, c = 0 β¨ c = 2
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.inr
q r : β
h : r < 4
k_ih : β m < 4 * q + r, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
h0 : q > 0
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution_extra | [148, 1] | [168, 59] | rw [k_ih, add_comm,
Nat.digits_add 4 (Nat.succ_lt_succ <| Nat.succ_pos 2) r q h <| Or.inr h0.ne.symm] | case h.intro.intro.intro.inr
q r : β
h : r < 4
h0 : q > 0
k_ih : S q = 0 β β c β Nat.digits 4 q, c = 0 β¨ c = 2
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2 | case h.intro.intro.intro.inr
q r : β
h : r < 4
h0 : q > 0
k_ih : S q = 0 β β c β Nat.digits 4 q, c = 0 β¨ c = 2
β’ (β c β Nat.digits 4 q, c = 0 β¨ c = 2) β§ (r = 0 β¨ r = 2) β β c β r :: Nat.digits 4 q, c = 0 β¨ c = 2 | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.inr
q r : β
h : r < 4
h0 : q > 0
k_ih : S q = 0 β β c β Nat.digits 4 q, c = 0 β¨ c = 2
β’ S q = 0 β§ (r = 0 β¨ r = 2) β β c β Nat.digits 4 (4 * q + r), c = 0 β¨ c = 2
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution_extra | [148, 1] | [168, 59] | simp_rw [List.mem_cons] | case h.intro.intro.intro.inr
q r : β
h : r < 4
h0 : q > 0
k_ih : S q = 0 β β c β Nat.digits 4 q, c = 0 β¨ c = 2
β’ (β c β Nat.digits 4 q, c = 0 β¨ c = 2) β§ (r = 0 β¨ r = 2) β β c β r :: Nat.digits 4 q, c = 0 β¨ c = 2 | case h.intro.intro.intro.inr
q r : β
h : r < 4
h0 : q > 0
k_ih : S q = 0 β β c β Nat.digits 4 q, c = 0 β¨ c = 2
β’ (β c β Nat.digits 4 q, c = 0 β¨ c = 2) β§ (r = 0 β¨ r = 2) β β (c : β), c = r β¨ c β Nat.digits 4 q β c = 0 β¨ c = 2 | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.inr
q r : β
h : r < 4
h0 : q > 0
k_ih : S q = 0 β β c β Nat.digits 4 q, c = 0 β¨ c = 2
β’ (β c β Nat.digits 4 q, c = 0 β¨ c = 2) β§ (r = 0 β¨ r = 2) β β c β r :: Nat.digits 4 q, c = 0 β¨ c = 2
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution_extra | [148, 1] | [168, 59] | rw [forall_eq_or_imp, and_comm] | case h.intro.intro.intro.inr
q r : β
h : r < 4
h0 : q > 0
k_ih : S q = 0 β β c β Nat.digits 4 q, c = 0 β¨ c = 2
β’ (β c β Nat.digits 4 q, c = 0 β¨ c = 2) β§ (r = 0 β¨ r = 2) β β (c : β), c = r β¨ c β Nat.digits 4 q β c = 0 β¨ c = 2 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case h.intro.intro.intro.inr
q r : β
h : r < 4
h0 : q > 0
k_ih : S q = 0 β β c β Nat.digits 4 q, c = 0 β¨ c = 2
β’ (β c β Nat.digits 4 q, c = 0 β¨ c = 2) β§ (r = 0 β¨ r = 2) β β (c : β), c = r β¨ c β Nat.digits 4 q β c = 0 β¨ c = 2
TACTIC:
|
https://github.com/mortarsanjaya/IMOSLLean4.git | be127d301e366822fbeeeda49d9fd5b998fb4eb5 | IMOSLLean4/IMO2010/A4/A4.lean | IMOSL.IMO2010A4.final_solution_extra | [148, 1] | [168, 59] | exact List.not_mem_nil c | h : 0 < 4
k_ih : β m < 4 * 0 + 0, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
c : β
h0 : c β []
β’ c β [] | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
h : 0 < 4
k_ih : β m < 4 * 0 + 0, S m = 0 β β c β Nat.digits 4 m, c = 0 β¨ c = 2
c : β
h0 : c β []
β’ c β []
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.one_le_succ | [21, 1] | [22, 38] | exact tsub_add_cancel_iff_le.mp rfl | x : β
β’ 1 β€ succ x | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
x : β
β’ 1 β€ succ x
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.modCore_one | [24, 1] | [25, 53] | induction x <;> (try unfold Nat.modCore; simp [*]) | x : β
β’ Nat.modCore x 1 = 0 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
x : β
β’ Nat.modCore x 1 = 0
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.modCore_one | [24, 1] | [25, 53] | try unfold Nat.modCore; simp [*] | case succ
nβ : β
n_ihβ : Nat.modCore nβ 1 = 0
β’ Nat.modCore (succ nβ) 1 = 0 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case succ
nβ : β
n_ihβ : Nat.modCore nβ 1 = 0
β’ Nat.modCore (succ nβ) 1 = 0
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.modCore_one | [24, 1] | [25, 53] | unfold Nat.modCore | case succ
nβ : β
n_ihβ : Nat.modCore nβ 1 = 0
β’ Nat.modCore (succ nβ) 1 = 0 | case succ
nβ : β
n_ihβ : Nat.modCore nβ 1 = 0
β’ (if 0 < 1 β§ 1 β€ succ nβ then Nat.modCore (succ nβ - 1) 1 else succ nβ) = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
case succ
nβ : β
n_ihβ : Nat.modCore nβ 1 = 0
β’ Nat.modCore (succ nβ) 1 = 0
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.modCore_one | [24, 1] | [25, 53] | simp [*] | case succ
nβ : β
n_ihβ : Nat.modCore nβ 1 = 0
β’ (if 0 < 1 β§ 1 β€ succ nβ then Nat.modCore (succ nβ - 1) 1 else succ nβ) = 0 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case succ
nβ : β
n_ihβ : Nat.modCore nβ 1 = 0
β’ (if 0 < 1 β§ 1 β€ succ nβ then Nat.modCore (succ nβ - 1) 1 else succ nβ) = 0
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.modCore_zero | [27, 1] | [31, 19] | unfold Nat.modCore | x : β
β’ Nat.modCore 0 x = 0 | x : β
β’ (if 0 < x β§ x β€ 0 then Nat.modCore (0 - x) x else 0) = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
x : β
β’ Nat.modCore 0 x = 0
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.modCore_zero | [27, 1] | [31, 19] | simp only [nonpos_iff_eq_zero, ge_iff_le, _root_.zero_le, tsub_eq_zero_of_le, ite_eq_right_iff,
and_imp] | x : β
β’ (if 0 < x β§ x β€ 0 then Nat.modCore (0 - x) x else 0) = 0 | x : β
β’ 0 < x β x = 0 β Nat.modCore 0 x = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
x : β
β’ (if 0 < x β§ x β€ 0 then Nat.modCore (0 - x) x else 0) = 0
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.modCore_zero | [27, 1] | [31, 19] | rintro _ β¨β© | x : β
β’ 0 < x β x = 0 β Nat.modCore 0 x = 0 | case refl
aβ : 0 < 0
β’ Nat.modCore 0 0 = 0 | Please generate a tactic in lean4 to solve the state.
STATE:
x : β
β’ 0 < x β x = 0 β Nat.modCore 0 x = 0
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.modCore_zero | [27, 1] | [31, 19] | rfl | case refl
aβ : 0 < 0
β’ Nat.modCore 0 0 = 0 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case refl
aβ : 0 < 0
β’ Nat.modCore 0 0 = 0
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.ge_mod | [34, 1] | [58, 28] | cases x | n x : β
β’ (match x, n + 1 with
| 0, x => 0
| x@h:(succ n), y => Nat.modCore x y) <
n + 1 | case zero
n : β
β’ (match zero, n + 1 with
| 0, x => 0
| x@h:(succ n), y => Nat.modCore x y) <
n + 1
case succ
n nβ : β
β’ (match succ nβ, n + 1 with
| 0, x => 0
| x@h:(succ n), y => Nat.modCore x y) <
n + 1 | Please generate a tactic in lean4 to solve the state.
STATE:
n x : β
β’ (match x, n + 1 with
| 0, x => 0
| x@h:(succ n), y => Nat.modCore x y) <
n + 1
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.ge_mod | [34, 1] | [58, 28] | next => simp | case zero
n : β
β’ (match zero, n + 1 with
| 0, x => 0
| x@h:(succ n), y => Nat.modCore x y) <
n + 1
case succ
n nβ : β
β’ (match succ nβ, n + 1 with
| 0, x => 0
| x@h:(succ n), y => Nat.modCore x y) <
n + 1 | case succ
n nβ : β
β’ (match succ nβ, n + 1 with
| 0, x => 0
| x@h:(succ n), y => Nat.modCore x y) <
n + 1 | Please generate a tactic in lean4 to solve the state.
STATE:
case zero
n : β
β’ (match zero, n + 1 with
| 0, x => 0
| x@h:(succ n), y => Nat.modCore x y) <
n + 1
case succ
n nβ : β
β’ (match succ nβ, n + 1 with
| 0, x => 0
| x@h:(succ n), y => Nat.modCore x y) <
n + 1
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.ge_mod | [34, 1] | [58, 28] | simp | n : β
β’ (match zero, n + 1 with
| 0, x => 0
| x@h:(succ n), y => Nat.modCore x y) <
n + 1 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
n : β
β’ (match zero, n + 1 with
| 0, x => 0
| x@h:(succ n), y => Nat.modCore x y) <
n + 1
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.ge_mod | [34, 1] | [58, 28] | simp | n x : β
β’ (match succ x, n + 1 with
| 0, x => 0
| x@h:(succ n), y => Nat.modCore x y) <
n + 1 | n x : β
β’ Nat.modCore (succ x) (n + 1) < n + 1 | Please generate a tactic in lean4 to solve the state.
STATE:
n x : β
β’ (match succ x, n + 1 with
| 0, x => 0
| x@h:(succ n), y => Nat.modCore x y) <
n + 1
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.ge_mod | [34, 1] | [58, 28] | induction x using Nat.strongInductionOn | n x : β
β’ Nat.modCore (succ x) (n + 1) < n + 1 | case ind
n nβ : β
aβ : β m < nβ, Nat.modCore (succ m) (n + 1) < n + 1
β’ Nat.modCore (succ nβ) (n + 1) < n + 1 | Please generate a tactic in lean4 to solve the state.
STATE:
n x : β
β’ Nat.modCore (succ x) (n + 1) < n + 1
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.ge_mod | [34, 1] | [58, 28] | unfold Nat.modCore | n x : β
ih : β m < x, Nat.modCore (succ m) (n + 1) < n + 1
β’ Nat.modCore (succ x) (n + 1) < n + 1 | n x : β
ih : β m < x, Nat.modCore (succ m) (n + 1) < n + 1
β’ (if 0 < n + 1 β§ n + 1 β€ succ x then Nat.modCore (succ x - (n + 1)) (n + 1) else succ x) < n + 1 | Please generate a tactic in lean4 to solve the state.
STATE:
n x : β
ih : β m < x, Nat.modCore (succ m) (n + 1) < n + 1
β’ Nat.modCore (succ x) (n + 1) < n + 1
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.ge_mod | [34, 1] | [58, 28] | cases x <;> simp [Nat.succ_le_succ_iff] | n x : β
ih : β m < x, Nat.modCore (succ m) (n + 1) < n + 1
β’ (if 0 < n + 1 β§ n + 1 β€ succ x then Nat.modCore (succ x - (n + 1)) (n + 1) else succ x) < n + 1 | case zero
n : β
ih : β m < zero, Nat.modCore (succ m) (n + 1) < n + 1
β’ (if n = 0 then 0 else succ 0) < n + 1
case succ
n nβ : β
ih : β m < succ nβ, Nat.modCore (succ m) (n + 1) < n + 1
β’ (if n β€ nβ + 1 then Nat.modCore (nβ + 1 - n) (n + 1) else succ (succ nβ)) < n + 1 | Please generate a tactic in lean4 to solve the state.
STATE:
n x : β
ih : β m < x, Nat.modCore (succ m) (n + 1) < n + 1
β’ (if 0 < n + 1 β§ n + 1 β€ succ x then Nat.modCore (succ x - (n + 1)) (n + 1) else succ x) < n + 1
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.ge_mod | [34, 1] | [58, 28] | next =>
cases n <;> simp | case zero
n : β
ih : β m < zero, Nat.modCore (succ m) (n + 1) < n + 1
β’ (if n = 0 then 0 else succ 0) < n + 1
case succ
n nβ : β
ih : β m < succ nβ, Nat.modCore (succ m) (n + 1) < n + 1
β’ (if n β€ nβ + 1 then Nat.modCore (nβ + 1 - n) (n + 1) else succ (succ nβ)) < n + 1 | case succ
n nβ : β
ih : β m < succ nβ, Nat.modCore (succ m) (n + 1) < n + 1
β’ (if n β€ nβ + 1 then Nat.modCore (nβ + 1 - n) (n + 1) else succ (succ nβ)) < n + 1 | Please generate a tactic in lean4 to solve the state.
STATE:
case zero
n : β
ih : β m < zero, Nat.modCore (succ m) (n + 1) < n + 1
β’ (if n = 0 then 0 else succ 0) < n + 1
case succ
n nβ : β
ih : β m < succ nβ, Nat.modCore (succ m) (n + 1) < n + 1
β’ (if n β€ nβ + 1 then Nat.modCore (nβ + 1 - n) (n + 1) else succ (succ nβ)) < n + 1
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.ge_mod | [34, 1] | [58, 28] | cases n <;> simp | n : β
ih : β m < zero, Nat.modCore (succ m) (n + 1) < n + 1
β’ (if n = 0 then 0 else succ 0) < n + 1 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
n : β
ih : β m < zero, Nat.modCore (succ m) (n + 1) < n + 1
β’ (if n = 0 then 0 else succ 0) < n + 1
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.ge_mod | [34, 1] | [58, 28] | cases' n with n <;> simp | n x : β
ih : β m < succ x, Nat.modCore (succ m) (n + 1) < n + 1
β’ (if n β€ x + 1 then Nat.modCore (x + 1 - n) (n + 1) else succ (succ x)) < n + 1 | case succ
x n : β
ih : β m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1
β’ (if succ n β€ x + 1 then Nat.modCore (x - n) (succ n + 1) else succ (succ x)) < succ n + 1 | Please generate a tactic in lean4 to solve the state.
STATE:
n x : β
ih : β m < succ x, Nat.modCore (succ m) (n + 1) < n + 1
β’ (if n β€ x + 1 then Nat.modCore (x + 1 - n) (n + 1) else succ (succ x)) < n + 1
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.ge_mod | [34, 1] | [58, 28] | split_ifs with h | case succ
x n : β
ih : β m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1
β’ (if succ n β€ x + 1 then Nat.modCore (x - n) (succ n + 1) else succ (succ x)) < succ n + 1 | case pos
x n : β
ih : β m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1
h : succ n β€ x + 1
β’ Nat.modCore (x - n) (succ n + 1) < succ n + 1
case neg
x n : β
ih : β m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1
h : Β¬succ n β€ x + 1
β’ succ (succ x) < succ n + 1 | Please generate a tactic in lean4 to solve the state.
STATE:
case succ
x n : β
ih : β m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1
β’ (if succ n β€ x + 1 then Nat.modCore (x - n) (succ n + 1) else succ (succ x)) < succ n + 1
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.ge_mod | [34, 1] | [58, 28] | cases hm : x - n | case pos
x n : β
ih : β m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1
h : succ n β€ x + 1
β’ Nat.modCore (x - n) (succ n + 1) < succ n + 1 | case pos.zero
x n : β
ih : β m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1
h : succ n β€ x + 1
hm : x - n = zero
β’ Nat.modCore zero (succ n + 1) < succ n + 1
case pos.succ
x n : β
ih : β m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1
h : succ n β€ x + 1
nβ : β
hm : x - n = succ nβ
β’ Nat.modCore (succ nβ) (succ n + 1) < succ n + 1 | Please generate a tactic in lean4 to solve the state.
STATE:
case pos
x n : β
ih : β m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1
h : succ n β€ x + 1
β’ Nat.modCore (x - n) (succ n + 1) < succ n + 1
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.ge_mod | [34, 1] | [58, 28] | next => simp | case pos.zero
x n : β
ih : β m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1
h : succ n β€ x + 1
hm : x - n = zero
β’ Nat.modCore zero (succ n + 1) < succ n + 1
case pos.succ
x n : β
ih : β m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1
h : succ n β€ x + 1
nβ : β
hm : x - n = succ nβ
β’ Nat.modCore (succ nβ) (succ n + 1) < succ n + 1 | case pos.succ
x n : β
ih : β m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1
h : succ n β€ x + 1
nβ : β
hm : x - n = succ nβ
β’ Nat.modCore (succ nβ) (succ n + 1) < succ n + 1 | Please generate a tactic in lean4 to solve the state.
STATE:
case pos.zero
x n : β
ih : β m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1
h : succ n β€ x + 1
hm : x - n = zero
β’ Nat.modCore zero (succ n + 1) < succ n + 1
case pos.succ
x n : β
ih : β m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1
h : succ n β€ x + 1
nβ : β
hm : x - n = succ nβ
β’ Nat.modCore (succ nβ) (succ n + 1) < succ n + 1
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.ge_mod | [34, 1] | [58, 28] | next =>
apply ih
apply Nat.lt_of_succ_le
apply Nat.le_succ_of_le
rw [βhm]
apply sub_le | case pos.succ
x n : β
ih : β m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1
h : succ n β€ x + 1
nβ : β
hm : x - n = succ nβ
β’ Nat.modCore (succ nβ) (succ n + 1) < succ n + 1 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
case pos.succ
x n : β
ih : β m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1
h : succ n β€ x + 1
nβ : β
hm : x - n = succ nβ
β’ Nat.modCore (succ nβ) (succ n + 1) < succ n + 1
TACTIC:
|
https://github.com/alexkeizer/LeanMeetup.git | 98bea524b3beaa38c37d61d1fa7592c24fa36c52 | LeanMeetup/Exercise02Solutions.lean | Nat.ge_mod | [34, 1] | [58, 28] | simp | x n : β
ih : β m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1
h : succ n β€ x + 1
hm : x - n = zero
β’ Nat.modCore zero (succ n + 1) < succ n + 1 | no goals | Please generate a tactic in lean4 to solve the state.
STATE:
x n : β
ih : β m < succ x, Nat.modCore (succ m) (succ n + 1) < succ n + 1
h : succ n β€ x + 1
hm : x - n = zero
β’ Nat.modCore zero (succ n + 1) < succ n + 1
TACTIC:
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.