Accepted proof96 lines of Lean 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96 import FormalConjectures.OEIS.«181082»
namespace Submission
open PowerSeries OeisA181082
noncomputable def F : ℕ → ℕ → ℤ := fun n k => if k ≤ n then (n.choose k : ℤ) ^ (n + k) else 0
noncomputable def L : ℚ⟦X⟧ := hannaLog F
theorem ch0_0 : Nat.choose 0 0 = 1 := by decide
theorem ch1_0 : Nat.choose 1 0 = 1 := by decide
theorem ch1_1 : Nat.choose 1 1 = 1 := by decide
theorem ch2_0 : Nat.choose 2 0 = 1 := by decide
theorem ch2_1 : Nat.choose 2 1 = 2 := by decide
theorem ch2_2 : Nat.choose 2 2 = 1 := by decide
theorem ch3_0 : Nat.choose 3 0 = 1 := by decide
theorem ch3_1 : Nat.choose 3 1 = 3 := by decide
theorem ch3_2 : Nat.choose 3 2 = 3 := by decide
theorem ch3_3 : Nat.choose 3 3 = 1 := by decide
theorem ch4_0 : Nat.choose 4 0 = 1 := by decide
theorem ch4_1 : Nat.choose 4 1 = 4 := by decide
theorem ch4_2 : Nat.choose 4 2 = 6 := by decide
theorem ch4_3 : Nat.choose 4 3 = 4 := by decide
theorem ch4_4 : Nat.choose 4 4 = 1 := by decide
theorem c0 : coeff 0 L = 0 := by
simp [L, hannaLog, coeff_mk]
theorem c1 : coeff 1 L = 1 := by
simp only [L, hannaLog, coeff_mk]
rw [show Finset.Icc 1 1 = {1} by decide]
norm_num [F, ch0_0, ch1_0, ch1_1, ch2_0, ch2_1, ch2_2, ch3_0, ch3_1, ch3_2, ch3_3, ch4_0, ch4_1, ch4_2, ch4_3, ch4_4]
theorem c2 : coeff 2 L = 3 / 2 := by
simp only [L, hannaLog, coeff_mk]
rw [show Finset.Icc 1 2 = {1, 2} by decide]
norm_num [F, ch0_0, ch1_0, ch1_1, ch2_0, ch2_1, ch2_2, ch3_0, ch3_1, ch3_2, ch3_3, ch4_0, ch4_1, ch4_2, ch4_3, ch4_4]
theorem c3 : coeff 3 L = 13 / 3 := by
simp only [L, hannaLog, coeff_mk]
rw [show Finset.Icc 1 3 = {1, 2, 3} by decide]
norm_num [F, ch0_0, ch1_0, ch1_1, ch2_0, ch2_1, ch2_2, ch3_0, ch3_1, ch3_2, ch3_3, ch4_0, ch4_1, ch4_2, ch4_3, ch4_4]
theorem c4 : coeff 4 L = 111 / 4 := by
simp only [L, hannaLog, coeff_mk]
rw [show Finset.Icc 1 4 = {1, 2, 3, 4} by decide]
norm_num [F, ch0_0, ch1_0, ch1_1, ch2_0, ch2_1, ch2_2, ch3_0, ch3_1, ch3_2, ch3_3, ch4_0, ch4_1, ch4_2, ch4_3, ch4_4]
theorem ad0 : Finset.HasAntidiagonal.antidiagonal (0 : ℕ) = {(0, 0)} := by decide
theorem ad1 : Finset.HasAntidiagonal.antidiagonal (1 : ℕ) = {(0, 1), (1, 0)} := by decide
theorem ad2 : Finset.HasAntidiagonal.antidiagonal (2 : ℕ) = {(0, 2), (1, 1), (2, 0)} := by decide
theorem ad3 : Finset.HasAntidiagonal.antidiagonal (3 : ℕ) = {(0, 3), (1, 2), (2, 1), (3, 0)} := by decide
theorem ad4 : Finset.HasAntidiagonal.antidiagonal (4 : ℕ) = {(0, 4), (1, 3), (2, 2), (3, 1), (4, 0)} := by decide
theorem q0 : coeff 0 (L ^ 2) = 0 := by
rw [pow_two, coeff_mul, ad0]; norm_num [c0]
theorem q1 : coeff 1 (L ^ 2) = 0 := by
rw [pow_two, coeff_mul, ad1]; norm_num [c0, c1]
theorem q2 : coeff 2 (L ^ 2) = 1 := by
rw [pow_two, coeff_mul, ad2]; norm_num [c0, c1, c2]
theorem q3 : coeff 3 (L ^ 2) = 3 := by
rw [pow_two, coeff_mul, ad3]; norm_num [c0, c1, c2, c3]
theorem q4 : coeff 4 (L ^ 2) = 131 / 12 := by
rw [pow_two, coeff_mul, ad4]; norm_num [c0, c1, c2, c3, c4]
theorem r0 : coeff 0 (L ^ 3) = 0 := by
rw [pow_succ, coeff_mul, ad0]; norm_num [c0, q0]
theorem r1 : coeff 1 (L ^ 3) = 0 := by
rw [pow_succ, coeff_mul, ad1]; norm_num [c0, c1, q0, q1]
theorem r2 : coeff 2 (L ^ 3) = 0 := by
rw [pow_succ, coeff_mul, ad2]; norm_num [c0, c1, c2, q0, q1, q2]
theorem r3 : coeff 3 (L ^ 3) = 1 := by
rw [pow_succ, coeff_mul, ad3]; norm_num [c0, c1, c2, c3, q0, q1, q2, q3]
theorem r4 : coeff 4 (L ^ 3) = 9 / 2 := by
rw [pow_succ, coeff_mul, ad4]; norm_num [c0, c1, c2, c3, c4, q0, q1, q2, q3, q4]
theorem s4 : coeff 4 (L ^ 4) = 1 := by
rw [pow_succ, coeff_mul, ad4]; norm_num [c0, c1, c2, c3, c4, r0, r1, r2, r3, r4]
theorem hL0 : constantCoeff L = 0 := by
rw [← coeff_zero_eq_constantCoeff_apply]; exact c0
theorem vanish (m d : ℕ) (hd : m < d) : coeff m (L ^ d) = 0 := by
obtain ⟨g, hg⟩ := X_dvd_iff.mpr hL0
rw [hg, mul_pow, coeff_X_pow_mul', if_neg (by omega)]
theorem solution : type_of% @OeisA181082.a_4 := by
show coeff 4 (subst L (exp ℚ)) = 34
have hs : HasSubst L := HasSubst.of_constantCoeff_zero' hL0
rw [coeff_subst' hs, finsum_eq_sum_of_support_subset (s := Finset.range 5)]
· simp only [Finset.sum_range_succ, Finset.sum_range_zero, pow_zero, pow_one, coeff_one,
c4, q4, r4, s4, coeff_exp, smul_eq_mul]
norm_num [Nat.factorial]
· intro d hd
rw [Function.mem_support] at hd
simp only [Finset.coe_range, Set.mem_Iio]
by_contra h
exact hd (by rw [vanish 4 d (by omega), smul_zero])
end Submission
Check it yourself
Project formal-conjectures
Commit f606af160664c5a10952e9a957b100a1cd45bbeb
Lean leanprover/lean4:v4.33.1
Mathlib 0df444a360eaa60ab8c11dca51a86af692955474 With Git and Elan installed, put the download in a fresh working directory and run this there. Use a disposable environment. Lean prints the axioms at the end. The checker allows propext, Classical.choice, and Quot.sound.
(
set -eu
proof="$PWD/1eb68069-125f-4f08-8dc6-f4d463694d95.lean"
git clone https://github.com/google-deepmind/formal-conjectures.git formal-conjectures
git -C formal-conjectures checkout --detach f606af160664c5a10952e9a957b100a1cd45bbeb
cd formal-conjectures
elan toolchain install leanprover/lean4:v4.33.1
lake +leanprover/lean4:v4.33.1 exe cache get
lake +leanprover/lean4:v4.33.1 build '+FormalConjectures.OEIS.«181082»'
check_dir="$(mktemp -d)"
trap 'rm -f "$check_dir/Check.lean"; rmdir "$check_dir"' EXIT
printf "%s\n" "import Lean" > "$check_dir/Check.lean"
cat "$proof" >> "$check_dir/Check.lean"
cat >> "$check_dir/Check.lean" <<'SOLVE_CHECK'
example : type_of% @_root_.OeisA181082.a_4 := @_root_.Submission.solution
#print axioms Submission.solution
SOLVE_CHECK
lake +leanprover/lean4:v4.33.1 env lean "$check_dir/Check.lean"
)Copy command Download the receipt verifier and public key . Run python3 verify-proof.py certificate.json 1eb68069-125f-4f08-8dc6-f4d463694d95.lean proof-key.pem with OpenSSL 3.