Long horizon. The conjecture proposes an upper bound growing like n to the three halves on the longest such increasing sequence of tuples. Knowledge itself.
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123import FormalConjectures.Arxiv.«1609.08688».sIncreasingrTuples
namespace Submission
open Arxiv.«1609.08688»
/-- Boolean form of `lt₂` on triples of naturals: at least two coordinates strictly increase. -/def lt2b (a b : ℕ × ℕ × ℕ) : Bool :=
(decide (a.1 < b.1) && decide (a.2.1 < b.2.1)) ||
(decide (a.1 < b.1) && decide (a.2.2 < b.2.2)) ||
(decide (a.2.1 < b.2.1) && decide (a.2.2 < b.2.2))
/-- `hasChain k C` searches for a chain of length `k` (each element `lt2b`-below all later ones)
inside `C`, pruning when `C` is too short. -/
def hasChain : ℕ → List (ℕ × ℕ × ℕ) → Bool
| 0, _ => true
| k+1, C => decide (k+1 ≤ C.length) && C.any fun p => hasChain k (C.filter fun q => lt2b p q)
/-- All triples with coordinates in `{1, 2, 3, 4}`. -/def box : List (ℕ × ℕ × ℕ) :=
(List.range' 1 4).flatMap fun a => (List.range' 1 4).flatMap fun b =>
(List.range' 1 4).map fun c => (a, b, c)
theorem hasChain_nine : hasChain 9 box = false := by decide +kernel
theorem lt2b_irrefl (a : ℕ × ℕ × ℕ) : lt2b a a = false := by
simp [lt2b]
theorem lt₂_iff_lt2b (a b : Fin 3 → ℕ) :
lt₂ a b ↔ lt2b (a 0, a 1, a 2) (b 0, b 1, b 2) = true := by
unfold lt₂
constructor
· rintro ⟨i, j, hij, hi, hj⟩
fin_cases i <;> fin_cases j <;> simp_all [lt2b]
· intro h
simp only [lt2b, Bool.or_eq_true, Bool.and_eq_true, decide_eq_true_eq] at h
rcases h with (⟨h1, h2⟩ | ⟨h1, h2⟩) | ⟨h1, h2⟩
· exact ⟨0, 1, by decide, h1, h2⟩
· exact ⟨0, 2, by decide, h1, h2⟩
· exact ⟨1, 2, by decide, h1, h2⟩
theorem isInc_iff_lt2b (s : List (Fin 3 → ℕ)) :
IsIncreasing₂ s ↔ (s.map fun a => (a 0, a 1, a 2)).Pairwise (fun a b => lt2b a b = true) := by
unfold IsIncreasing₂
rw [List.pairwise_map]
exact ⟨fun h => h.imp fun hab => (lt₂_iff_lt2b _ _).1 hab,
fun h => h.imp fun hab => (lt₂_iff_lt2b _ _).2 hab⟩
/-- Soundness of the search: a chain of length `k` inside `C` makes `hasChain k C` true. -/theorem hasChain_of (k : ℕ) : ∀ (C l : List (ℕ × ℕ × ℕ)), l.length = k →
l.Pairwise (fun a b => lt2b a b = true) → (∀ x ∈ l, x ∈ C) → hasChain k C = true := by
induction k with
| zero => intros; rfl
| succ k ih =>
intro C l hlen hpair hsub
cases l with
| nil => simp at hlen
| cons p l' =>
have hl' : l'.length = k := by simpa using hlen
have hnd : (p :: l').Nodup :=
List.Pairwise.imp (fun {a b} (h : lt2b a b = true) (e : a = b) => by
subst e; simp [lt2b_irrefl] at h) hpair
have hlen' : k + 1 ≤ C.length := by
have := (hnd.subperm hsub).length_le
simp only [List.length_cons] at this
omega
rw [List.pairwise_cons] at hpair
obtain ⟨hp, hpair'⟩ := hpair
have hany : C.any (fun q => hasChain k (C.filter fun r => lt2b q r)) = true := by
rw [List.any_eq_true]
refine ⟨p, hsub p List.mem_cons_self, ih _ l' hl' hpair' ?_⟩
intro x hx
exact List.mem_filter.2 ⟨hsub x (List.mem_cons_of_mem _ hx), hp x hx⟩
simp [hasChain, hlen', hany]
theorem mem_box (a b c : ℕ) (ha : 1 ≤ a) (ha' : a ≤ 4) (hb : 1 ≤ b) (hb' : b ≤ 4)
(hc : 1 ≤ c) (hc' : c ≤ 4) : (a, b, c) ∈ box := by
interval_cases a <;> interval_cases b <;> interval_cases c <;> decide
/-- Any 2-increasing list of triples in `{1,…,4}` has length at most `8`. -/theorem chain_le_eight (s : List (Fin 3 → ℕ)) (hr : ∀ a ∈ s, Set.range a ⊆ Set.Icc 1 4)
(hi : IsIncreasing₂ s) : s.length ≤ 8 := by
by_contra hcon
have hM := (isInc_iff_lt2b s).1 hi
have hbox : ∀ x ∈ (s.map fun a => (a 0, a 1, a 2)).take 9, x ∈ box := by
intro x hx
obtain ⟨a, ha, rfl⟩ := List.mem_map.1 (List.mem_of_mem_take hx)
have h0 := Set.mem_Icc.1 (hr a ha ⟨0, rfl⟩)
have h1 := Set.mem_Icc.1 (hr a ha ⟨1, rfl⟩)
have h2 := Set.mem_Icc.1 (hr a ha ⟨2, rfl⟩)
exact mem_box _ _ _ h0.1 h0.2 h1.1 h1.2 h2.1 h2.2
have hlen : ((s.map fun a => (a 0, a 1, a 2)).take 9).length = 9 := by
simp only [List.length_take, List.length_map]
omega
have hpair : ((s.map fun a => (a 0, a 1, a 2)).take 9).Pairwise
(fun a b => lt2b a b = true) :=
hM.sublist (List.take_sublist _ _)
have h := hasChain_of 9 box _ hlen hpair hbox
rw [hasChain_nine] at h
exact Bool.false_ne_true h
/-- A 2-increasing list of length 8 in `{1,…,4}^3`. -/def l8 : List (Fin 3 → ℕ) :=
[![1, 1, 1], ![1, 2, 2], ![2, 1, 3], ![2, 2, 4], ![3, 3, 1], ![3, 4, 2], ![4, 3, 3], ![4, 4, 4]]
theorem l8_range : ∀ a ∈ l8, ∀ i : Fin 3, 1 ≤ a i ∧ a i ≤ 4 := by
decide
theorem l8_inc : IsIncreasing₂ l8 := by
rw [isInc_iff_lt2b]
decide
theorem solution : type_of% @Arxiv.«1609.08688».maximalLength_four := by
unfold maximalLength
apply IsGreatest.csSup_eq
refine ⟨⟨l8, fun a ha => ?_, l8_inc, rfl⟩, ?_⟩
· intro x hx
obtain ⟨i, rfl⟩ := hx
exact Set.mem_Icc.2 (l8_range a ha i)
· rintro m ⟨s, hr, hi, rfl⟩
exact chain_le_eight s hr hi
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/ad6b03d1-0a71-4a80-8e1c-1f753e12cab9.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.Arxiv.«1609.08688».sIncreasingrTuples'
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_.Arxiv.«1609.08688».maximalLength_four := @_root_.Submission.solution
#print axioms Submission.solution
SOLVE_CHECK
lake +leanprover/lean4:v4.33.1 env lean "$check_dir/Check.lean"
)
Download the receipt verifier and public key. Run python3 verify-proof.py certificate.json ad6b03d1-0a71-4a80-8e1c-1f753e12cab9.lean proof-key.pem with OpenSSL 3.