import Mathlib /-! # Complete Resolution of the 3-Color Finiteness Conjecture for Strong and Weak Rado Numbers We study the $n$-color **strong** Rado numbers $R_k(n, c)$ and **weak** (distinct-variable) Rado numbers $\mathrm{WR}_k(n, c)$ for the non-homogeneous linear equation $$E_{k, c} : \quad x_1 + x_2 + \dots + x_k + c = x_{k+1} \qquad (k \ge 2,\ n \ge 1,\ c \ge 0).$$ ## Background & Main Results Adhikari, Boza, Eliahou, Marín, Revuelta, and Sanz (*Math. Comp.* **85** (2016), 2047–2064; *Discrete Math.* **340** (2017), 39–45; *Experimental Math.* **28** (2019), 334–344) proved that if $R_k(n, c) < \infty$, then every divisor $d \le n$ of $k - 1$ must also divide $c$, and conjectured that this divisibility condition is also **sufficient** for both $R_k(n, c)$ and $\mathrm{WR}_k(n, c)$ to be finite. Previously, sufficiency was known only for: - $(k - 1) \mid c$ (hence $n \ge k - 1$), - $n = 2$ for strong Rado numbers $R_k(2, c)$ (Jones–Schaal 2004; Adhikari et al. 2016), and - $k \le 7$ with explicit finite-range verifications. In this file, we formalize **five completely self-contained, fully verified theorem families**: 1. **Shift-to-$\mathbb{Z}$ Weak Rado Reduction (`isWeakRadoFinite_of_isZRadoFinite`)**: For **all** $k \ge 2$, $n \ge 1$, $c \ge 0$, if every $n$-coloring of a bounded integer interval $[-W, W] \cap \mathbb{Z}$ contains a monochromatic solution to $E_{k, c}$ (with repeats allowed), then $\mathrm{WR}_k(n, c) < \infty$ (there exists $N$ such that every $n$-coloring of $\{1, \dots, N\}$ contains a monochromatic **strictly increasing**—hence pairwise distinct—positive integer solution). Proved via an elementary multicolor Ramsey theorem and a telescoping $2^b - 2^a$ proof of Weak Generalized Schur's Theorem (`exists_mono_distinct_homog_sum`). 2. **Universal Divisibility Necessity (`dvd_of_isStrongRadoFinite`)** and **Universal $(k - 1) \mid c$ Sufficiency (`isWeakRadoFinite_of_dvd`)** for all $k \ge 2$, $n \ge 1$, $c \ge 0$. 3. **Complete $n = 1$ and $n = 2$ Equivalences** (`strongRado_finiteness_two_colors_iff`, `weakRado_finiteness_two_colors_iff`) for **all** $k \ge 2$ and $c \ge 0$. 4. **Complete $n = 3$ Finiteness Theorem — Main Breakthrough** (`strongRado_finiteness_three_colors_iff`, `weakRado_finiteness_three_colors_iff`, `strong_iff_weak_rado_three_colors`): For **every** $k \ge 2$ and **every** $c \ge 0$ (resolving all previously open $k \ge 8$): $$R_k(3, c) < \infty \iff \mathrm{WR}_k(3, c) < \infty \iff \forall d \in \{1, 2, 3\},\ d \mid (k - 1) \implies d \mid c.$$ -/ namespace WeakRadoFiniteness open Finset /-! ## Section 1: Core Definitions and Combinatorial Sum Helpers -/ /-- Monochromatic strong solution (repeats allowed) to `x₁ + ... + xₖ + c = z` in `{1, ..., N}`. -/ def HasStrongSol {n : ℕ} (k c N : ℕ) (χ : ℕ → Fin n) : Prop := ∃ (col : Fin n) (x : Fin k → ℕ) (z : ℕ), (∀ i, 1 ≤ x i ∧ x i ≤ N) ∧ (1 ≤ z ∧ z ≤ N) ∧ (∀ i, χ (x i) = col) ∧ χ z = col ∧ (∑ i : Fin k, x i) + c = z /-- Monochromatic weak solution (strictly increasing, hence pairwise distinct positive integers) to `x₁ + ... + xₖ + c = z` in `{1, ..., N}`. -/ def HasWeakSol {n : ℕ} (k c N : ℕ) (χ : ℕ → Fin n) : Prop := ∃ (col : Fin n) (x : Fin k → ℕ) (z : ℕ), StrictMono x ∧ (∀ i, 1 ≤ x i ∧ x i < z) ∧ (1 ≤ z ∧ z ≤ N) ∧ (∀ i, χ (x i) = col) ∧ χ z = col ∧ (∑ i : Fin k, x i) + c = z /-- `R_k(n, c) < ∞`: there exists `N` such that every `n`-coloring of `ℕ` admits a monochromatic strong solution in `{1, ..., N}`. -/ def IsStrongRadoFinite (k n c : ℕ) : Prop := ∃ N : ℕ, ∀ χ : ℕ → Fin n, HasStrongSol k c N χ /-- `WR_k(n, c) < ∞`: there exists `N` such that every `n`-coloring of `ℕ` admits a monochromatic weak (strictly increasing) solution in `{1, ..., N}`. -/ def IsWeakRadoFinite (k n c : ℕ) : Prop := ∃ N : ℕ, ∀ χ : ℕ → Fin n, HasWeakSol k c N χ /-- Monochromatic integer solution (repeats allowed) in `[-W, W] ∩ ℤ`. -/ def HasZSol {n : ℕ} (k c W : ℕ) (χ : ℤ → Fin n) : Prop := ∃ (col : Fin n) (x : Fin k → ℤ) (z : ℤ), (∀ i, |x i| ≤ (W : ℤ)) ∧ |z| ≤ (W : ℤ) ∧ (∀ i, χ (x i) = col) ∧ χ z = col ∧ (∑ i : Fin k, x i) + (c : ℤ) = z /-- Finite `ℤ`-forcing: there exists `W` such that every `n`-coloring of `ℤ` admits a monochromatic solution to `E_{k, c}` inside `[-W, W]`. -/ def IsZRadoFinite (k n c : ℕ) : Prop := ∃ W : ℕ, ∀ χ : ℤ → Fin n, HasZSol k c W χ theorem isStrongRadoFinite_of_isWeakRadoFinite {k n c : ℕ} (h : IsWeakRadoFinite k n c) : IsStrongRadoFinite k n c := by rcases h with ⟨N, hN⟩ refine ⟨N, fun χ => ?_⟩ rcases hN χ with ⟨col, x, z, _, hxz, ⟨hz1, hzN⟩, hxcol, hzcol, hsum⟩ exact ⟨col, x, z, fun i => ⟨(hxz i).1, le_trans (le_of_lt (hxz i).2) hzN⟩, ⟨hz1, hzN⟩, hxcol, hzcol, hsum⟩ /-- Counting lemma for `Fin k`: the number of indices `i : Fin k` with `a ≤ i.val < b` is `b - a` when `b ≤ k`. -/ private lemma card_fin_interval {k a b : ℕ} (hbk : b ≤ k) : (Finset.univ.filter (fun i : Fin k => a ≤ i.val ∧ i.val < b)).card = b - a := by have hbij : (Finset.univ.filter (fun i : Fin k => a ≤ i.val ∧ i.val < b)).card = (Finset.Ico a b).card := by refine Finset.card_bij (fun i _ => i.val) ?_ ?_ ?_ · intro i hi simp only [Finset.mem_filter, Finset.mem_univ, true_and, Finset.mem_Ico] at hi ⊢ exact hi · intro i _ j _ h; exact Fin.ext h · intro m hm rw [Finset.mem_Ico] at hm exact ⟨⟨m, lt_of_lt_of_le hm.2 hbk⟩, by simp [hm.1, hm.2], rfl⟩ rw [hbij, Nat.card_Ico] /-- 1-value combination builder for `HasZSol`. -/ private lemma hasZSol_combo1 {n k c W : ℕ} {χ : ℤ → Fin n} {col : Fin n} {v1 z : ℤ} (hv1 : χ v1 = col) (hz : χ z = col) (hb1 : |v1| ≤ (W : ℤ)) (hbz : |z| ≤ (W : ℤ)) (heq : (k : ℤ) * v1 + (c : ℤ) = z) : HasZSol k c W χ := by refine ⟨col, fun _ => v1, z, fun _ => hb1, hbz, fun _ => hv1, hz, ?_⟩ simpa [Finset.sum_const, Finset.card_univ, Fintype.card_fin] using heq /-- 2-value combination builder for `HasZSol`. -/ private lemma hasZSol_combo2 {n k c W : ℕ} {χ : ℤ → Fin n} {col : Fin n} {a b : ℕ} {v1 v2 z : ℤ} (hcnt : a + b = k) (hv1 : χ v1 = col) (hv2 : χ v2 = col) (hz : χ z = col) (hb1 : |v1| ≤ (W : ℤ)) (hb2 : |v2| ≤ (W : ℤ)) (hbz : |z| ≤ (W : ℤ)) (heq : (a : ℤ) * v1 + (b : ℤ) * v2 + (c : ℤ) = z) : HasZSol k c W χ := by let x : Fin k → ℤ := fun i => if i.val < a then v1 else v2 refine ⟨col, x, z, ?_, hbz, ?_, hz, ?_⟩ · intro i; dsimp only [x]; split_ifs <;> assumption · intro i; dsimp only [x]; split_ifs <;> assumption · have hsum : ∑ i : Fin k, x i = (a : ℤ) * v1 + (b : ℤ) * v2 := by dsimp only [x] rw [Finset.sum_ite, Finset.sum_const, Finset.sum_const] have h1 : (Finset.univ.filter (fun i : Fin k => i.val < a)).card = a := by simpa using card_fin_interval (k := k) (a := 0) (b := a) (by omega) have h2 : (Finset.univ.filter (fun i : Fin k => ¬ i.val < a)).card = b := by have : Finset.univ.filter (fun i : Fin k => ¬ i.val < a) = Finset.univ.filter (fun i : Fin k => a ≤ i.val ∧ i.val < k) := by ext i; simp only [Finset.mem_filter, Finset.mem_univ, true_and, i.isLt, and_true]; omega rw [this, card_fin_interval (k := k) (a := a) (b := k) le_rfl] omega rw [h1, h2]; simp rw [hsum]; exact heq /-- 3-value combination builder for `HasZSol`. -/ private lemma hasZSol_combo3 {n k c W : ℕ} {χ : ℤ → Fin n} {col : Fin n} {a b d : ℕ} {v1 v2 v3 z : ℤ} (hcnt : a + b + d = k) (hv1 : χ v1 = col) (hv2 : χ v2 = col) (hv3 : χ v3 = col) (hz : χ z = col) (hb1 : |v1| ≤ (W : ℤ)) (hb2 : |v2| ≤ (W : ℤ)) (hb3 : |v3| ≤ (W : ℤ)) (hbz : |z| ≤ (W : ℤ)) (heq : (a : ℤ) * v1 + (b : ℤ) * v2 + (d : ℤ) * v3 + (c : ℤ) = z) : HasZSol k c W χ := by let x : Fin k → ℤ := fun i => if i.val < a then v1 else if i.val < a + b then v2 else v3 refine ⟨col, x, z, ?_, hbz, ?_, hz, ?_⟩ · intro i; dsimp only [x]; split_ifs <;> assumption · intro i; dsimp only [x]; split_ifs <;> assumption · have hsum : ∑ i : Fin k, x i = (a : ℤ) * v1 + (b : ℤ) * v2 + (d : ℤ) * v3 := by let S1 := Finset.univ.filter (fun i : Fin k => 0 ≤ i.val ∧ i.val < a) let S2 := Finset.univ.filter (fun i : Fin k => a ≤ i.val ∧ i.val < a + b) let S3 := Finset.univ.filter (fun i : Fin k => a + b ≤ i.val ∧ i.val < k) have hdisj12 : Disjoint S1 S2 := by rw [Finset.disjoint_left]; intro i h1 h2 simp only [S1, S2, Finset.mem_filter] at h1 h2; omega have hdisj123 : Disjoint (S1 ∪ S2) S3 := by rw [Finset.disjoint_left]; intro i h1 h2 simp only [S1, S2, S3, Finset.mem_union, Finset.mem_filter] at h1 h2; omega have hunion : (S1 ∪ S2) ∪ S3 = Finset.univ := by ext i; simp only [S1, S2, S3, Finset.mem_union, Finset.mem_filter, Finset.mem_univ, true_and, iff_true, Nat.zero_le, i.isLt, and_true]; omega rw [← hunion, Finset.sum_union hdisj123, Finset.sum_union hdisj12] have hs1 : ∑ i ∈ S1, x i = (a : ℤ) * v1 := by have hcongr : ∑ i ∈ S1, x i = ∑ _i ∈ S1, v1 := Finset.sum_congr rfl (fun i hi => by simp only [S1, Finset.mem_filter] at hi; simp [x, hi.2.2]) rw [hcongr, Finset.sum_const, card_fin_interval (by omega)]; simp have hs2 : ∑ i ∈ S2, x i = (b : ℤ) * v2 := by have hcongr : ∑ i ∈ S2, x i = ∑ _i ∈ S2, v2 := Finset.sum_congr rfl (fun i hi => by simp only [S2, Finset.mem_filter] at hi have h1 : ¬ i.val < a := by omega simp [x, h1, hi.2.2]) rw [hcongr, Finset.sum_const, card_fin_interval (by omega)]; simp have hs3 : ∑ i ∈ S3, x i = (d : ℤ) * v3 := by have hcongr : ∑ i ∈ S3, x i = ∑ _i ∈ S3, v3 := Finset.sum_congr rfl (fun i hi => by simp only [S3, Finset.mem_filter] at hi have h1 : ¬ i.val < a := by omega have h2 : ¬ i.val < a + b := by omega simp [x, h1, h2]) rw [hcongr, Finset.sum_const, card_fin_interval le_rfl] have : k - (a + b) = d := by omega rw [this]; simp rw [hs1, hs2, hs3] rw [hsum]; exact heq /-- 4-value combination builder for `HasZSol`. -/ private lemma hasZSol_combo4 {n k c W : ℕ} {χ : ℤ → Fin n} {col : Fin n} {a b d e : ℕ} {v1 v2 v3 v4 z : ℤ} (hcnt : a + b + d + e = k) (hv1 : χ v1 = col) (hv2 : χ v2 = col) (hv3 : χ v3 = col) (hv4 : χ v4 = col) (hz : χ z = col) (hb1 : |v1| ≤ (W : ℤ)) (hb2 : |v2| ≤ (W : ℤ)) (hb3 : |v3| ≤ (W : ℤ)) (hb4 : |v4| ≤ (W : ℤ)) (hbz : |z| ≤ (W : ℤ)) (heq : (a : ℤ) * v1 + (b : ℤ) * v2 + (d : ℤ) * v3 + (e : ℤ) * v4 + (c : ℤ) = z) : HasZSol k c W χ := by let x : Fin k → ℤ := fun i => if i.val < a then v1 else if i.val < a + b then v2 else if i.val < a + b + d then v3 else v4 refine ⟨col, x, z, ?_, hbz, ?_, hz, ?_⟩ · intro i; dsimp only [x]; split_ifs <;> assumption · intro i; dsimp only [x]; split_ifs <;> assumption · have hsum : ∑ i : Fin k, x i = (a : ℤ) * v1 + (b : ℤ) * v2 + (d : ℤ) * v3 + (e : ℤ) * v4 := by let S1 := Finset.univ.filter (fun i : Fin k => 0 ≤ i.val ∧ i.val < a) let S2 := Finset.univ.filter (fun i : Fin k => a ≤ i.val ∧ i.val < a + b) let S3 := Finset.univ.filter (fun i : Fin k => a + b ≤ i.val ∧ i.val < a + b + d) let S4 := Finset.univ.filter (fun i : Fin k => a + b + d ≤ i.val ∧ i.val < k) have hdisj12 : Disjoint S1 S2 := by rw [Finset.disjoint_left]; intro i h1 h2 simp only [S1, S2, Finset.mem_filter] at h1 h2; omega have hdisj123 : Disjoint (S1 ∪ S2) S3 := by rw [Finset.disjoint_left]; intro i h1 h2 simp only [S1, S2, S3, Finset.mem_union, Finset.mem_filter] at h1 h2; omega have hdisj1234 : Disjoint ((S1 ∪ S2) ∪ S3) S4 := by rw [Finset.disjoint_left]; intro i h1 h2 simp only [S1, S2, S3, S4, Finset.mem_union, Finset.mem_filter] at h1 h2; omega have hunion : ((S1 ∪ S2) ∪ S3) ∪ S4 = Finset.univ := by ext i; simp only [S1, S2, S3, S4, Finset.mem_union, Finset.mem_filter, Finset.mem_univ, true_and, iff_true, Nat.zero_le, i.isLt, and_true]; omega rw [← hunion, Finset.sum_union hdisj1234, Finset.sum_union hdisj123, Finset.sum_union hdisj12] have hs1 : ∑ i ∈ S1, x i = (a : ℤ) * v1 := by have hc : ∑ i ∈ S1, x i = ∑ _i ∈ S1, v1 := Finset.sum_congr rfl (fun i hi => by simp only [S1, Finset.mem_filter] at hi; simp [x, hi.2.2]) rw [hc, Finset.sum_const, card_fin_interval (by omega)]; simp have hs2 : ∑ i ∈ S2, x i = (b : ℤ) * v2 := by have hc : ∑ i ∈ S2, x i = ∑ _i ∈ S2, v2 := Finset.sum_congr rfl (fun i hi => by simp only [S2, Finset.mem_filter] at hi have h1 : ¬ i.val < a := by omega simp [x, h1, hi.2.2]) rw [hc, Finset.sum_const, card_fin_interval (by omega)]; simp have hs3 : ∑ i ∈ S3, x i = (d : ℤ) * v3 := by have hc : ∑ i ∈ S3, x i = ∑ _i ∈ S3, v3 := Finset.sum_congr rfl (fun i hi => by simp only [S3, Finset.mem_filter] at hi have h1 : ¬ i.val < a := by omega have h2 : ¬ i.val < a + b := by omega simp [x, h1, h2, hi.2.2]) rw [hc, Finset.sum_const, card_fin_interval (by omega)]; simp have hs4 : ∑ i ∈ S4, x i = (e : ℤ) * v4 := by have hc : ∑ i ∈ S4, x i = ∑ _i ∈ S4, v4 := Finset.sum_congr rfl (fun i hi => by simp only [S4, Finset.mem_filter] at hi have h1 : ¬ i.val < a := by omega have h2 : ¬ i.val < a + b := by omega have h3 : ¬ i.val < a + b + d := by omega simp [x, h1, h2, h3]) rw [hc, Finset.sum_const, card_fin_interval le_rfl] have : k - (a + b + d) = e := by omega rw [this]; simp rw [hs1, hs2, hs3, hs4] rw [hsum]; exact heq /-! ## Section 2: Multicolor Ramsey's Theorem & Weak Generalized Schur's Theorem -/ /-- **Two-color Asymmetric Ramsey's Theorem** on finite sets of naturals (ordered pairs). -/ private lemma ramsey_two (p q : ℕ) : ∃ R : ℕ, ∀ (S : Finset ℕ), R ≤ S.card → ∀ (f : ℕ → ℕ → Bool), (∃ A ⊆ S, A.card = p ∧ ∀ x ∈ A, ∀ y ∈ A, x < y → f x y = false) ∨ (∃ B ⊆ S, B.card = q ∧ ∀ x ∈ B, ∀ y ∈ B, x < y → f x y = true) := by induction p generalizing q with | zero => refine ⟨0, fun S _ _ => Or.inl ⟨∅, Finset.empty_subset S, rfl, by simp⟩⟩ | succ p ihp => induction q with | zero => refine ⟨0, fun S _ _ => Or.inr ⟨∅, Finset.empty_subset S, rfl, by simp⟩⟩ | succ q ihq => obtain ⟨R1, hR1⟩ := ihp (q + 1) obtain ⟨R2, hR2⟩ := ihq refine ⟨R1 + R2 + 1, fun S hS f => ?_⟩ have hne : S.Nonempty := Finset.card_pos.mp (by omega) set m := S.min' hne have hmS : m ∈ S := Finset.min'_mem S hne set S' := S.erase m have hS'_card : R1 + R2 ≤ S'.card := by have hce : S'.card = S.card - 1 := Finset.card_erase_of_mem hmS omega let S0 := S'.filter (fun y => f m y = false) let S1 := S'.filter (fun y => f m y = true) have hpart : S0.card + S1.card = S'.card := by have hdisj : Disjoint S0 S1 := by rw [Finset.disjoint_left]; intro y h0 h1 simp only [S0, S1, Finset.mem_filter] at h0 h1; rw [h0.2] at h1; cases h1.2 have hunion : S0 ∪ S1 = S' := by ext y; simp only [S0, S1, Finset.mem_union, Finset.mem_filter] constructor · rintro (⟨h, _⟩ | ⟨h, _⟩) <;> exact h · intro h; cases hf : f m y <;> [exact Or.inl ⟨h, rfl⟩; exact Or.inr ⟨h, rfl⟩] rw [← Finset.card_union_of_disjoint hdisj, hunion] have hcases : R1 ≤ S0.card ∨ R2 ≤ S1.card := by omega rcases hcases with h0 | h1 · rcases hR1 S0 h0 f with ⟨A, hAS0, hAcard, hAmono⟩ | ⟨B, hBS0, hBcard, hBmono⟩ · left have hmNotA : m ∉ A := fun hmA => (Finset.mem_erase.mp (Finset.mem_filter.mp (hAS0 hmA)).1).1 rfl refine ⟨insert m A, Finset.insert_subset hmS (Finset.Subset.trans hAS0 (Finset.Subset.trans (Finset.filter_subset _ _) (Finset.erase_subset _ _))), by rw [Finset.card_insert_of_notMem hmNotA, hAcard], ?_⟩ intro x hx y hy hxy rcases Finset.mem_insert.mp hx with rfl | hxA <;> rcases Finset.mem_insert.mp hy with rfl | hyA · exact absurd hxy (lt_irrefl _) · exact (Finset.mem_filter.mp (hAS0 hyA)).2 · have hle : m ≤ x := Finset.min'_le S x (Finset.erase_subset m S (Finset.filter_subset _ S' (hAS0 hxA))) omega · exact hAmono x hxA y hyA hxy · right exact ⟨B, Finset.Subset.trans hBS0 (Finset.Subset.trans (Finset.filter_subset _ _) (Finset.erase_subset _ _)), hBcard, hBmono⟩ · rcases hR2 S1 h1 f with ⟨A, hAS1, hAcard, hAmono⟩ | ⟨B, hBS1, hBcard, hBmono⟩ · left exact ⟨A, Finset.Subset.trans hAS1 (Finset.Subset.trans (Finset.filter_subset _ _) (Finset.erase_subset _ _)), hAcard, hAmono⟩ · right have hmNotB : m ∉ B := fun hmB => (Finset.mem_erase.mp (Finset.mem_filter.mp (hBS1 hmB)).1).1 rfl refine ⟨insert m B, Finset.insert_subset hmS (Finset.Subset.trans hBS1 (Finset.Subset.trans (Finset.filter_subset _ _) (Finset.erase_subset _ _))), by rw [Finset.card_insert_of_notMem hmNotB, hBcard], ?_⟩ intro x hx y hy hxy rcases Finset.mem_insert.mp hx with rfl | hxB <;> rcases Finset.mem_insert.mp hy with rfl | hyB · exact absurd hxy (lt_irrefl _) · exact (Finset.mem_filter.mp (hBS1 hyB)).2 · have hle : m ≤ x := Finset.min'_le S x (Finset.erase_subset m S (Finset.filter_subset _ S' (hBS1 hxB))) omega · exact hBmono x hxB y hyB hxy /-- **Multicolor Ramsey's Theorem** for `C` colors and clique size `q` on `Finset ℕ`. -/ theorem multicolor_ramsey (C q : ℕ) (hC : 1 ≤ C) : ∃ R : ℕ, ∀ (S : Finset ℕ), R ≤ S.card → ∀ (f : ℕ → ℕ → Fin C), ∃ (col : Fin C) (A : Finset ℕ), A ⊆ S ∧ A.card = q ∧ ∀ x ∈ A, ∀ y ∈ A, x < y → f x y = col := by induction C with | zero => omega | succ C ih => cases C with | zero => refine ⟨q, fun S hS f => ?_⟩ obtain ⟨A, hAS, hAcard⟩ := Finset.exists_subset_card_eq hS refine ⟨⟨0, Nat.zero_lt_one⟩, A, hAS, hAcard, fun x _ y _ _ => ?_⟩ exact Fin.ext (by have := (f x y).isLt; omega) | succ C' => obtain ⟨R_prev, hR_prev⟩ := ih (Nat.succ_pos C') obtain ⟨R_two, hR_two⟩ := ramsey_two q R_prev refine ⟨R_two, fun S hS f => ?_⟩ let g : ℕ → ℕ → Bool := fun x y => decide ((f x y).val ≠ C' + 1) rcases hR_two S hS g with ⟨A, hAS, hAcard, hAmono⟩ | ⟨B, hBS, hBcard, hBmono⟩ · refine ⟨⟨C' + 1, Nat.lt_succ_self _⟩, A, hAS, hAcard, fun x hx y hy hxy => ?_⟩ have hg : decide ((f x y).val ≠ C' + 1) = false := hAmono x hx y hy hxy have heq : (f x y).val = C' + 1 := by simpa using hg exact Fin.ext heq · let f' : ℕ → ℕ → Fin (C' + 1) := fun x y => if hlt : (f x y).val < C' + 1 then ⟨(f x y).val, hlt⟩ else ⟨0, Nat.succ_pos C'⟩ rcases hR_prev B (by omega) f' with ⟨col, A, hAB, hAcard, hAmono⟩ refine ⟨⟨col.val, Nat.lt_succ_of_lt col.isLt⟩, A, Finset.Subset.trans hAB hBS, hAcard, ?_⟩ intro x hx y hy hxy have hne : (f x y).val ≠ C' + 1 := by have hg := hBmono x (hAB hx) y (hAB hy) hxy simpa [g] using hg have hlt : (f x y).val < C' + 1 := by have := (f x y).isLt; omega have hf' : f' x y = col := hAmono x hx y hy hxy have hval : (f x y).val = col.val := by have := congr_arg Fin.val hf' dsimp only [f'] at this rw [dif_pos hlt] at this exact this exact Fin.ext hval /-- **Weak Generalized Schur's Theorem (with Arbitrary Spacing `M ≥ 1`)**: Using the telescoping encoding `y_j = 2^{v_j} - 2^{v_{j-1}}`, any `C`-coloring of `ℕ` admits a monochromatic strictly increasing tuple `z_0 < ... < z_{k-1} < z_k ≤ N` with `z_0 ≥ M`, `z_{j+1} - z_j ≥ M`, and `∑_{j < k} z_j = z_k`. -/ theorem exists_mono_distinct_homog_sum (k C M : ℕ) (hk : 2 ≤ k) (hC : 1 ≤ C) : ∃ N : ℕ, ∀ Φ : ℕ → Fin C, ∃ (col : Fin C) (z : Fin k → ℕ) (z_top : ℕ), (∀ i : Fin k, M ≤ z i) ∧ (∀ i j : Fin k, i < j → z i + M ≤ z j) ∧ (∀ i : Fin k, z i + M ≤ z_top) ∧ z_top ≤ N ∧ (∀ i : Fin k, Φ (z i) = col) ∧ Φ z_top = col ∧ (∑ i : Fin k, z i) = z_top := by obtain ⟨R, hR⟩ := multicolor_ramsey C (k + 1) hC refine ⟨M * 2 ^ R, fun Φ => ?_⟩ let edgeCol : ℕ → ℕ → Fin C := fun u v => Φ (M * (2 ^ v - 2 ^ u)) obtain ⟨col, A, hAS, hAcard, hAmono⟩ := hR (Finset.range R) (by simp) edgeCol let v : Fin (k + 1) ↪o ℕ := A.orderEmbOfFin hAcard have hv_mem : ∀ j : Fin (k + 1), v j ∈ A := fun j => Finset.orderEmbOfFin_mem A hAcard j have hv_lt_R : ∀ j : Fin (k + 1), v j < R := fun j => Finset.mem_range.mp (hAS (hv_mem j)) have hv_strict : StrictMono v := v.strictMono let y : Fin k → ℕ := fun i => 2 ^ (v i.succ) - 2 ^ (v i.castSucc) let y_top : ℕ := 2 ^ (v (Fin.last k)) - 2 ^ (v 0) let z : Fin k → ℕ := fun i => M * y i let z_top : ℕ := M * y_top -- Key telescoping identity for `y`: have hy_sum : ∑ i : Fin k, y i = y_top := by have htele : ∀ m (hm : m ≤ k), ∑ i : Fin m, (2 ^ (v ⟨i.val + 1, by omega⟩) - 2 ^ (v ⟨i.val, by omega⟩)) = 2 ^ (v ⟨m, by omega⟩) - 2 ^ (v ⟨0, by omega⟩) := by intro m induction m with | zero => intro _; simp | succ m ihm => intro hm rw [Fin.sum_univ_castSucc] simp only [Fin.val_castSucc, Fin.val_last] rw [ihm (by omega)] have h1 : 2 ^ (v ⟨0, by omega⟩) ≤ 2 ^ (v ⟨m, by omega⟩) := Nat.pow_le_pow_right (by norm_num) (hv_strict.monotone (by simp)) have h2 : 2 ^ (v ⟨m, by omega⟩) ≤ 2 ^ (v ⟨m + 1, by omega⟩) := Nat.pow_le_pow_right (by norm_num) (hv_strict.monotone (by simp [Fin.le_def])) omega have hkeq := htele k le_rfl have hcongr : ∑ i : Fin k, y i = ∑ i : Fin k, (2 ^ (v ⟨i.val + 1, by omega⟩) - 2 ^ (v ⟨i.val, by omega⟩)) := Finset.sum_congr rfl (fun i _ => rfl) rw [hcongr, hkeq] rfl -- Strict monotonicity of `y` (from `2^a - 2^b ≥ 2^{a-1} > 2^b - 2^c`): have hy_pos : ∀ i : Fin k, 1 ≤ y i := by intro i have hlt : v i.castSucc < v i.succ := hv_strict (by simp [Fin.lt_def]) have hp : 2 ^ (v i.castSucc) < 2 ^ (v i.succ) := Nat.pow_lt_pow_right (by norm_num) hlt dsimp only [y]; omega have hy_strict : StrictMono y := by intro i j hij have hv_ij : v i.succ ≤ v j.castSucc := hv_strict.monotone (by show i.val + 1 ≤ j.val; exact hij) have hv_j : v j.castSucc + 1 ≤ v j.succ := hv_strict (by simp [Fin.lt_def]) have hp0 : 2 ^ (v i.castSucc) ≤ 2 ^ (v i.succ) := Nat.pow_le_pow_right (by norm_num) (hv_strict.monotone (by simp [Fin.le_def])) have hp1 : 2 ^ (v j.castSucc) * 2 ≤ 2 ^ (v j.succ) := by calc 2 ^ (v j.castSucc) * 2 = 2 ^ (v j.castSucc + 1) := (Nat.pow_succ _ _).symm _ ≤ 2 ^ (v j.succ) := Nat.pow_le_pow_right (by norm_num) hv_j have hp2 : 2 ^ (v i.succ) ≤ 2 ^ (v j.castSucc) := Nat.pow_le_pow_right (by norm_num) hv_ij have hp3 : 1 ≤ 2 ^ (v i.castSucc) := Nat.one_le_pow _ _ (by norm_num) dsimp only [y]; omega refine ⟨col, z, z_top, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ · intro i exact Nat.le_mul_of_pos_right M (hy_pos i) · intro i j hij have hyij : y i + 1 ≤ y j := hy_strict hij dsimp only [z] calc M * y i + M = M * (y i + 1) := by ring _ ≤ M * y j := Nat.mul_le_mul_left M hyij · intro i have hy_lt : y i + 1 ≤ y_top := by have hj_ex : ∃ j : Fin k, j ≠ i := by by_cases hi0 : i.val = 0 · exact ⟨⟨1, by omega⟩, fun h => by have := congr_arg Fin.val h; dsimp at this; omega⟩ · exact ⟨⟨0, by omega⟩, fun h => by have := congr_arg Fin.val h; dsimp at this; omega⟩ obtain ⟨j, hji⟩ := hj_ex have hpair : y i + y j ≤ ∑ t : Fin k, y t := by have hle := Finset.sum_le_univ_sum_of_nonneg (f := y) (s := {i, j}) (fun _ => Nat.zero_le _) rwa [Finset.sum_pair hji.symm] at hle have hjpos : 1 ≤ y j := hy_pos j omega dsimp only [z, z_top] calc M * y i + M = M * (y i + 1) := by ring _ ≤ M * y_top := Nat.mul_le_mul_left M hy_lt · dsimp only [z_top, y_top] have hpow : 2 ^ (v (Fin.last k)) - 2 ^ (v 0) ≤ 2 ^ R := le_trans (Nat.sub_le _ _) (Nat.pow_le_pow_right (by norm_num) (le_of_lt (hv_lt_R (Fin.last k)))) exact Nat.mul_le_mul_left M hpow · intro i exact hAmono (v i.castSucc) (hv_mem _) (v i.succ) (hv_mem _) (hv_strict (by simp [Fin.lt_def])) · exact hAmono (v 0) (hv_mem _) (v (Fin.last k)) (hv_mem _) (hv_strict (by show 0 < k; omega)) · dsimp only [z, z_top] rw [← Finset.mul_sum, hy_sum] /-! ## Section 3: Shift-to-`ℤ` Weak Rado Reduction Theorem & Scaling -/ /-- **Shift-to-`ℤ` Weak Rado Reduction Theorem**: For all `k ≥ 2`, `n ≥ 1`, `c ≥ 0`, finite `ℤ`-forcing (`IsZRadoFinite k n c`, with repeats allowed on `[-W, W]`) immediately implies finite **weak** (distinct-variable) Rado number `WR_k(n, c) < ∞` (`IsWeakRadoFinite k n c`). -/ theorem isWeakRadoFinite_of_isZRadoFinite {k n c : ℕ} (hk : 2 ≤ k) (hn : 1 ≤ n) (hZ : IsZRadoFinite k n c) : IsWeakRadoFinite k n c := by rcases hZ with ⟨W, hW⟩ -- Number of n-colorings of the window `[-W, W]` of length `2W + 1` is `n ^ (2W + 1)`. set M : ℕ := 2 * W + 1 have hM : 1 ≤ M := by omega let eWin : (Fin M → Fin n) ≃ Fin (n ^ M) := (Fintype.equivFin (Fin M → Fin n)).trans (finCongr (by simp)) have hC : 1 ≤ n ^ M := Nat.one_le_pow _ _ hn obtain ⟨N0, hN0⟩ := exists_mono_distinct_homog_sum k (n ^ M) M hk hC refine ⟨N0 + W, fun χ => ?_⟩ -- Define the window coloring Φ(z) encoding `s ↦ χ(z + s)` for `s ∈ [-W, W]`. let Φ : ℕ → Fin (n ^ M) := fun z => eWin (fun j : Fin M => χ (z + j.val - W)) obtain ⟨colWin, z, z_top, hz_ge, hz_gap, hz_top_gap, hz_top_le, hz_col, hz_top_col, hz_sum⟩ := hN0 Φ -- Decode the common window coloring on `[-W, W]` as a function `ψ : ℤ → Fin n`. let ψ : ℤ → Fin n := fun s => if h : 0 ≤ s + (W : ℤ) ∧ s + (W : ℤ) < (M : ℤ) then χ ((z ⟨0, by omega⟩ : ℕ) + (s + (W : ℤ)).toNat - W) else ⟨0, hn⟩ obtain ⟨col, s, t, hs_bd, ht_bd, hs_col, ht_col, hst_eq⟩ := hW ψ -- Key property: for ANY `u` with `Φ u = colWin`, `u ≥ M`, and `|v| ≤ W`, -- we have `χ ((u : ℤ) + v).toNat = ψ v`. have hwin_eq : ∀ (u : ℕ) (v : ℤ), M ≤ u → Φ u = colWin → |v| ≤ (W : ℤ) → χ (((u : ℤ) + v).toNat) = ψ v := by intro u v huM hΦu hvW have hlo : 0 ≤ v + (W : ℤ) := by have := neg_le_of_abs_le hvW; omega have hhi : v + (W : ℤ) < (M : ℤ) := by have := le_of_abs_le hvW; omega set j : ℕ := (v + (W : ℤ)).toNat have hjM : j < M := by omega have hΦ0 : Φ (z ⟨0, by omega⟩) = colWin := hz_col ⟨0, by omega⟩ have hfun : (fun r : Fin M => χ (u + r.val - W)) = (fun r : Fin M => χ (z ⟨0, by omega⟩ + r.val - W)) := eWin.injective (hΦu.trans hΦ0.symm) have hval := congr_fun hfun ⟨j, hjM⟩ have hcast : ((u : ℤ) + v).toNat = u + j - W := by omega rw [hcast, hval] simp only [ψ, hlo, hhi, and_self, ↓reduceDIte, j] let x : Fin k → ℕ := fun i => ((z i : ℤ) + s i).toNat let z_fin : ℕ := ((z_top : ℤ) + t).toNat have hx_cast : ∀ i : Fin k, (x i : ℤ) = (z i : ℤ) + s i := by intro i have h1 : (M : ℤ) ≤ (z i : ℤ) := by exact_mod_cast hz_ge i have h2 : -(W : ℤ) ≤ s i := neg_le_of_abs_le (hs_bd i) exact Int.toNat_of_nonneg (by omega) have hz_fin_cast : (z_fin : ℤ) = (z_top : ℤ) + t := by have h1 : (M : ℤ) ≤ (z_top : ℤ) := by have := hz_ge ⟨0, by omega⟩ have := hz_top_gap ⟨0, by omega⟩ omega have h2 : -(W : ℤ) ≤ t := neg_le_of_abs_le ht_bd exact Int.toNat_of_nonneg (by omega) refine ⟨col, x, z_fin, ?_, ?_, ?_, ?_, ?_, ?_⟩ · -- StrictMono x intro i j hij have hgap : z i + M ≤ z j := hz_gap i j hij have hsi : s i ≤ (W : ℤ) := le_of_abs_le (hs_bd i) have hsj : -(W : ℤ) ≤ s j := neg_le_of_abs_le (hs_bd j) have hci := hx_cast i have hcj := hx_cast j omega · -- 1 ≤ x i ∧ x i < z_fin intro i have hgi : M ≤ z i := hz_ge i have hgap : z i + M ≤ z_top := hz_top_gap i have hsi_lo : -(W : ℤ) ≤ s i := neg_le_of_abs_le (hs_bd i) have hsi_hi : s i ≤ (W : ℤ) := le_of_abs_le (hs_bd i) have ht_lo : -(W : ℤ) ≤ t := neg_le_of_abs_le ht_bd have hci := hx_cast i omega · -- 1 ≤ z_fin ∧ z_fin ≤ N0 + W have ht_lo : -(W : ℤ) ≤ t := neg_le_of_abs_le ht_bd have ht_hi : t ≤ (W : ℤ) := le_of_abs_le ht_bd have htopM : M ≤ z_top := by have := hz_ge ⟨0, by omega⟩ have := hz_top_gap ⟨0, by omega⟩ omega omega · -- ∀ i, χ (x i) = col intro i rw [hwin_eq (z i) (s i) (hz_ge i) (hz_col i) (hs_bd i)] exact hs_col i · -- χ z_fin = col have htopM : M ≤ z_top := by have := hz_ge ⟨0, by omega⟩ have := hz_top_gap ⟨0, by omega⟩ omega rw [hwin_eq z_top t htopM hz_top_col ht_bd] exact ht_col · -- (∑ i, x i) + c = z_fin have hZeq : ((∑ i : Fin k, x i) + c : ℤ) = (z_fin : ℤ) := by rw [Nat.cast_sum] have hsumx : ∑ i : Fin k, (x i : ℤ) = (∑ i : Fin k, (z i : ℤ)) + ∑ i : Fin k, s i := by rw [← Finset.sum_add_distrib] exact Finset.sum_congr rfl (fun i _ => hx_cast i) rw [hsumx, hz_fin_cast] have hsumz : ∑ i : Fin k, (z i : ℤ) = (z_top : ℤ) := by exact_mod_cast hz_sum linarith exact_mod_cast hZeq /-- **Scaling Lemma on `ℤ`**: if `E_{k, c}` is `ℤ`-forced with `n` colors, then so is `E_{k, m * c}` for every `m : ℕ`. -/ theorem isZRadoFinite_mul_scale {k n c m : ℕ} (h : IsZRadoFinite k n c) : IsZRadoFinite k n (m * c) := by rcases h with ⟨W, hW⟩ refine ⟨m * W, fun χ => ?_⟩ let χ' : ℤ → Fin n := fun s => χ ((m : ℤ) * s) obtain ⟨col, x, z, hxW, hzW, hxcol, hzcol, hsum⟩ := hW χ' refine ⟨col, fun i => (m : ℤ) * x i, (m : ℤ) * z, ?_, ?_, hxcol, hzcol, ?_⟩ · intro i rw [abs_mul, Nat.abs_cast] push_cast exact mul_le_mul_of_nonneg_left (hxW i) (Nat.cast_nonneg m) · rw [abs_mul, Nat.abs_cast] push_cast exact mul_le_mul_of_nonneg_left hzW (Nat.cast_nonneg m) · rw [← Finset.mul_sum] push_cast nlinarith /-- **Universal `(k - 1) ∣ c` Sufficiency**: for all `k ≥ 2`, `n ≥ 1`, and `c` divisible by `k - 1`, `IsZRadoFinite k n c` holds via the 1-point `ℤ`-core `{-c / (k - 1)}`. -/ theorem isZRadoFinite_of_dvd {k n c : ℕ} (hk : 2 ≤ k) (hdvd : (k - 1) ∣ c) : IsZRadoFinite k n c := by rcases hdvd with ⟨m, rfl⟩ refine ⟨m, fun χ => ?_⟩ refine hasZSol_combo1 (col := χ (-(m : ℤ))) (v1 := -(m : ℤ)) (z := -(m : ℤ)) rfl rfl (by simp) (by simp) ?_ have hcast : (((k - 1) * m : ℕ) : ℤ) = ((k : ℤ) - 1) * (m : ℤ) := by have : ((k - 1 : ℕ) : ℤ) = (k : ℤ) - 1 := by omega rw [Nat.cast_mul, this] rw [hcast]; ring /-- Corollary: whenever `(k - 1) ∣ c`, both `WR_k(n, c)` and `R_k(n, c)` are finite for all `n ≥ 1`. -/ theorem isWeakRadoFinite_of_dvd {k n c : ℕ} (hk : 2 ≤ k) (hn : 1 ≤ n) (hdvd : (k - 1) ∣ c) : IsWeakRadoFinite k n c := isWeakRadoFinite_of_isZRadoFinite hk hn (isZRadoFinite_of_dvd hk hdvd) /-! ## Section 4: Universal Necessity Theorem (All `k ≥ 2`, `n ≥ 1`, `c ≥ 0`) -/ /-- **Universal Divisibility Necessity** (Adhikari–Boza–Eliahou–Marín–Revuelta–Sanz): for all `k ≥ 2`, `n ≥ 1`, `c ≥ 0`, if `R_k(n, c) < ∞` then every divisor `d` of `k - 1` with `1 ≤ d ≤ n` also divides `c`. -/ theorem dvd_of_isStrongRadoFinite {k n c : ℕ} (hk : 2 ≤ k) (hfin : IsStrongRadoFinite k n c) : ∀ d, 1 ≤ d → d ≤ n → d ∣ (k - 1) → d ∣ c := by intro d hd1 hdn hdk rcases hfin with ⟨N, hN⟩ let χ : ℕ → Fin n := fun x => ⟨x % d, lt_of_lt_of_le (Nat.mod_lt x hd1) hdn⟩ obtain ⟨col, x, z, _, _, hxcol, hzcol, hsum⟩ := hN χ have hxmod : ∀ i : Fin k, x i % d = col.val := fun i => congr_arg Fin.val (hxcol i) have hzmod : z % d = col.val := congr_arg Fin.val hzcol have hsum_mod : (∑ i : Fin k, x i) % d = (k * col.val) % d := by rw [Finset.sum_nat_mod] have hcongr : ∑ i : Fin k, x i % d = ∑ _i : Fin k, col.val := Finset.sum_congr rfl (fun i _ => hxmod i) rw [hcongr, Finset.sum_const, Finset.card_univ, Fintype.card_fin, smul_eq_mul] have hcol_lt : col.val < d := by rw [← hxmod ⟨0, by omega⟩] exact Nat.mod_lt _ hd1 have h1 : (k * col.val + c) % d = col.val % d := by have := congr_arg (· % d) hsum rw [Nat.add_mod, hsum_mod, ← Nat.add_mod] at this rw [this, hzmod, Nat.mod_eq_of_lt hcol_lt] have hkm1 : k * col.val = (k - 1) * col.val + col.val := by have : k = (k - 1) + 1 := by omega nth_rw 1 [this]; ring rw [hkm1, add_assoc] at h1 have hzero : ((k - 1) * col.val) % d = 0 := Nat.mod_eq_zero_of_dvd (dvd_mul_of_dvd_left hdk _) have hc_mod : (col.val + c) % d = col.val % d := by rw [Nat.add_mod, hzero, zero_add, Nat.mod_mod] at h1 exact h1 have hcdvd : d ∣ c := by have hsub : (d : ℤ) ∣ (((col.val + c : ℕ) : ℤ) - (col.val : ℤ)) := by rw [Int.dvd_iff_emod_eq_zero, ← Int.emod_eq_emod_iff_emod_sub_eq_zero] exact_mod_cast hc_mod have hre : (((col.val + c : ℕ) : ℤ) - (col.val : ℤ)) = (c : ℤ) := by push_cast; ring rw [hre] at hsub exact Int.ofNat_dvd.mp hsub exact hcdvd theorem dvd_of_isWeakRadoFinite {k n c : ℕ} (hk : 2 ≤ k) (hfin : IsWeakRadoFinite k n c) : ∀ d, 1 ≤ d → d ≤ n → d ∣ (k - 1) → d ∣ c := dvd_of_isStrongRadoFinite hk (isStrongRadoFinite_of_isWeakRadoFinite hfin) /-! ## Section 5: Complete `n = 1` and `n = 2` Equivalences (All `k ≥ 2`, `c ≥ 0`) -/ /-- `n = 1` is always `ℤ`-finite (and hence weak and strong Rado finite) for all `k ≥ 2, c ≥ 0`. -/ theorem isZRadoFinite_one (k c : ℕ) : IsZRadoFinite k 1 c := by refine ⟨c, fun χ => ?_⟩ refine hasZSol_combo1 (col := ⟨0, Nat.zero_lt_one⟩) (v1 := 0) (z := (c : ℤ)) (Subsingleton.elim _ _) (Subsingleton.elim _ _) (by simp) (by simp) (by simp) theorem strongRado_finiteness_one_color {k c : ℕ} (hk : 2 ≤ k) : IsStrongRadoFinite k 1 c := isStrongRadoFinite_of_isWeakRadoFinite (isWeakRadoFinite_of_isZRadoFinite hk (le_refl 1) (isZRadoFinite_one k c)) theorem weakRado_finiteness_one_color {k c : ℕ} (hk : 2 ≤ k) : IsWeakRadoFinite k 1 c := isWeakRadoFinite_of_isZRadoFinite hk (le_refl 1) (isZRadoFinite_one k c) /-- `n = 2`, `k` even, `c = 1`: triangle `{-1, 0, 1}` forces a monochromatic solution on `[-1, 1]`. -/ private lemma isZRadoFinite_two_even_one {k : ℕ} (hk : 2 ≤ k) (heven : 2 ∣ k) : IsZRadoFinite k 2 1 := by rcases heven with ⟨m, rfl⟩ refine ⟨1, fun χ => ?_⟩ by_contra hno have h01 : χ 0 ≠ χ 1 := fun h => hno <| hasZSol_combo1 (col := χ 0) (v1 := 0) (z := 1) rfl h.symm (by norm_num) (by norm_num) (by push_cast; ring) have h0m1 : χ 0 ≠ χ (-1) := fun h => hno <| hasZSol_combo2 (col := χ 0) (a := 2 * m - 1) (b := 1) (v1 := 0) (v2 := -1) (z := 0) (by omega) rfl h.symm rfl (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) have h1m1 : χ 1 ≠ χ (-1) := fun h => hno <| hasZSol_combo2 (col := χ 1) (a := m) (b := m) (v1 := -1) (v2 := 1) (z := 1) (by omega) h.symm rfl rfl (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) have : χ 0 = χ 1 ∨ χ 0 = χ (-1) ∨ χ 1 = χ (-1) := by omega rcases this with h | h | h <;> contradiction /-- `n = 2`, `k` odd (`k ≥ 3`), `c = 2`: `[-2, 4]` forces a monochromatic solution. -/ private lemma isZRadoFinite_two_odd_two {k : ℕ} (hk : 3 ≤ k) (hodd : k % 2 = 1) : IsZRadoFinite k 2 2 := by set m := (k - 1) / 2 have hkm : k = 2 * m + 1 := by omega refine ⟨4, fun χ => ?_⟩ by_contra hno set r := χ 0 set b : Fin 2 := ⟨1 - r.val, by omega⟩ have hrb : r ≠ b := by intro h; have := congr_arg Fin.val h; dsimp [b] at this; omega have hexh : ∀ x : ℤ, χ x ≠ r → χ x = b := by intro x hx; apply Fin.ext; dsimp [b]; have := (χ x).isLt; have := r.isLt have : (χ x).val ≠ r.val := fun h => hx (Fin.ext h); omega have hexh' : ∀ x : ℤ, χ x ≠ b → χ x = r := by intro x hx; by_contra hnr; exact hx (hexh x hnr) have h2_b : χ 2 = b := hexh 2 fun h => hno <| hasZSol_combo1 (col := r) (v1 := 0) (z := 2) rfl h (by norm_num) (by norm_num) (by push_cast; ring) have hm2_b : χ (-2) = b := hexh (-2) fun h => hno <| hasZSol_combo2 (col := r) (a := 1) (b := 2 * m) (v1 := -2) (v2 := 0) (z := 0) (by omega) h rfl rfl (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) have hm1_b : χ (-1) = b := hexh (-1) fun h => hno <| hasZSol_combo2 (col := r) (a := 2) (b := 2 * m - 1) (v1 := -1) (v2 := 0) (z := 0) (by omega) h rfl rfl (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) have h1_r : χ 1 = r := hexh' 1 fun h => hno <| hasZSol_combo2 (col := b) (a := m + 1) (b := m) (v1 := -1) (v2 := 1) (z := 1) (by omega) hm1_b h h (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) have h4_b : χ 4 = b := hexh 4 fun h => hno <| hasZSol_combo2 (col := r) (a := 2) (b := 2 * m - 1) (v1 := 1) (v2 := 0) (z := 4) (by omega) h1_r rfl h (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) exact hno <| hasZSol_combo2 (col := b) (a := m) (b := m + 1) (v1 := -2) (v2 := 2) (z := 4) (by omega) hm2_b h2_b h4_b (by norm_num) (by norm_num) (by norm_num) (by push_cast; ring) /-- Complete `ℤ`-forcing characterization for `n = 2` (all `k ≥ 2`, `c ≥ 0`). -/ theorem isZRadoFinite_two_of_admissible {k c : ℕ} (hk : 2 ≤ k) (hadm : 2 ∣ (k - 1) → 2 ∣ c) : IsZRadoFinite k 2 c := by by_cases hc0 : c = 0 · subst hc0; exact isZRadoFinite_of_dvd hk (dvd_zero _) by_cases hpar : k % 2 = 0 · have h1 := isZRadoFinite_two_even_one hk (Nat.dvd_of_mod_eq_zero hpar) simpa using isZRadoFinite_mul_scale (m := c) h1 · have hodd : k % 2 = 1 := by omega have hk3 : 3 ≤ k := by omega have h2k : 2 ∣ (k - 1) := by omega rcases hadm h2k with ⟨m, rfl⟩ have h2 := isZRadoFinite_two_odd_two hk3 hodd have hs := isZRadoFinite_mul_scale (m := m) h2 rwa [mul_comm] at hs /-- **Complete 2-Color Strong Rado Finiteness Theorem (All `k ≥ 2`, `c ≥ 0`)**. -/ theorem strongRado_finiteness_two_colors_iff {k c : ℕ} (hk : 2 ≤ k) : IsStrongRadoFinite k 2 c ↔ (2 ∣ (k - 1) → 2 ∣ c) := by constructor · intro hfin h2k; exact dvd_of_isStrongRadoFinite hk hfin 2 (by omega) (by omega) h2k · intro hadm exact isStrongRadoFinite_of_isWeakRadoFinite (isWeakRadoFinite_of_isZRadoFinite hk (by omega) (isZRadoFinite_two_of_admissible hk hadm)) /-- **Complete 2-Color Weak Rado Finiteness Theorem (All `k ≥ 2`, `c ≥ 0`)**. -/ theorem weakRado_finiteness_two_colors_iff {k c : ℕ} (hk : 2 ≤ k) : IsWeakRadoFinite k 2 c ↔ (2 ∣ (k - 1) → 2 ∣ c) := by constructor · intro hfin h2k; exact dvd_of_isWeakRadoFinite hk hfin 2 (by omega) (by omega) h2k · intro hadm exact isWeakRadoFinite_of_isZRadoFinite hk (by omega) (isZRadoFinite_two_of_admissible hk hadm) /-! ## Section 6: Complete `n = 3` Finiteness Theorem — Main Breakthrough (All `k ≥ 2`, `c ≥ 0`) We resolve all six residue classes of `k (mod 6)` by explicit uniform-in-`k` `ℤ`-cores: - `k ≡ 0 (mod 6)`, `k ≥ 6`, `c = 1` - `k ≡ 2 (mod 6)`, `k ≥ 8`, `c = 1` (note `k = 2` has `(k - 1) = 1 ∣ c`) - `k ≡ 3 (mod 6)`, `k ≥ 9`, `c = 2` (note `k = 3` has `(k - 1) = 2 ∣ c`) - `k ≡ 5 (mod 6)`, `k ≥ 5`, `c = 2` - `k ≡ 4 (mod 6)`, `k ≥ 10`, `c = 3` (note `k = 4` has `(k - 1) = 3 ∣ c`) - `k ≡ 1 (mod 6)`, `k ≥ 13`, `c = 6` (note `k = 7` has `(k - 1) = 6 ∣ c`) -/ /-- Helper for `Fin 3`: three pairwise distinct colors exhaust `Fin 3`. -/ private lemma fin3_exhaust {r b g : Fin 3} (hrb : r ≠ b) (hrg : r ≠ g) (hbg : b ≠ g) (c : Fin 3) : c = r ∨ c = b ∨ c = g := by fin_cases r <;> fin_cases b <;> fin_cases g <;> fin_cases c <;> simp_all /-- Helper for `Fin 3`: given `r : Fin 3`, construct `b, g : Fin 3` pairwise distinct from `r`. -/ private lemma fin3_other_two (r : Fin 3) : ∃ b g : Fin 3, r ≠ b ∧ r ≠ g ∧ b ≠ g := by fin_cases r · exact ⟨1, 2, by decide, by decide, by decide⟩ · exact ⟨0, 2, by decide, by decide, by decide⟩ · exact ⟨0, 1, by decide, by decide, by decide⟩ /-- Helper: absolute value bound `|x| ≤ (W : ℤ)` from `-(W : ℤ) ≤ x ∧ x ≤ (W : ℤ)`. -/ private lemma abs_le_of_bounds {x : ℤ} {W : ℕ} (h1 : -(W : ℤ) ≤ x) (h2 : x ≤ (W : ℤ)) : |x| ≤ (W : ℤ) := abs_le.mpr ⟨h1, h2⟩ /-- Shared kill for `k` even ≥ 6, `c = 1`, when `0, -(k-1) ∈ r`, `1 ∈ b`, `-1, -2 ∈ g`. -/ private lemma kill_c1_m2_in_g {k W : ℕ} {χ : ℤ → Fin 3} {r b g : Fin 3} (hk : 6 ≤ k) (heven : 2 ∣ k) (hW : k ≤ W) (hrb : r ≠ b) (hrg : r ≠ g) (hbg : b ≠ g) (h0 : χ 0 = r) (h1 : χ 1 = b) (hm1 : χ (-1) = g) (hmkm1 : χ (-((k : ℤ) - 1)) = r) (hm2 : χ (-2) = g) (hno : ¬ HasZSol k 1 W χ) : False := by rcases heven with ⟨q, hkq⟩ have hmk_b : χ (-(k : ℤ)) = b := by have hnr : χ (-(k : ℤ)) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 1) (b := k - 1) (v1 := -(k : ℤ)) (v2 := 0) (z := -((k : ℤ) - 1)) (by omega) h h0 hmkm1 (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) have hng : χ (-(k : ℤ)) ≠ g := fun h => hno <| hasZSol_combo2 (col := g) (a := 1) (b := k - 1) (v1 := -2) (v2 := -1) (z := -(k : ℤ)) (by omega) hm2 hm1 h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ (-(k : ℤ))) with h | h | h · exact absurd h hnr · exact h · exact absurd h hng have hkm2_b : χ ((k : ℤ) - 2) = b := by have hnr : χ ((k : ℤ) - 2) ≠ r := fun h => hno <| hasZSol_combo3 (col := r) (a := 1) (b := 1) (d := k - 2) (v1 := -((k : ℤ) - 1)) (v2 := (k : ℤ) - 2) (v3 := 0) (z := 0) (by omega) hmkm1 h h0 h0 (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) have hng : χ ((k : ℤ) - 2) ≠ g := fun h => hno <| hasZSol_combo3 (col := g) (a := 1) (b := 1) (d := k - 2) (v1 := (k : ℤ) - 2) (v2 := -2) (v3 := -1) (z := -1) (by omega) h hm2 hm1 hm1 (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ ((k : ℤ) - 2)) with h | h | h · exact absurd h hnr · exact h · exact absurd h hng have hkm3_r : χ ((k : ℤ) - 3) = r := by have hng : χ ((k : ℤ) - 3) ≠ g := fun h => hno <| hasZSol_combo2 (col := g) (a := k - 1) (b := 1) (v1 := -1) (v2 := (k : ℤ) - 3) (z := -1) (by omega) hm1 h hm1 (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) have hnb : χ ((k : ℤ) - 3) ≠ b := fun h => hno <| hasZSol_combo3 (col := b) (a := 1) (b := 1) (d := k - 2) (v1 := -(k : ℤ)) (v2 := (k : ℤ) - 2) (v3 := 1) (z := (k : ℤ) - 3) (by omega) hmk_b hkm2_b h1 h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ ((k : ℤ) - 3)) with h | h | h · exact h · exact absurd h hnb · exact absurd h hng exact hno <| hasZSol_combo2 (col := r) (a := q) (b := q) (v1 := (k : ℤ) - 3) (v2 := -((k : ℤ) - 1)) (z := -((k : ℤ) - 1)) (by omega) hkm3_r hmkm1 hmkm1 (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by have : (k : ℤ) = 2 * (q : ℤ) := by exact_mod_cast hkq push_cast; nlinarith) /-- **Case 1 (`k = 6m ≥ 6`, `c = 1`, `n = 3`)**. -/ private lemma isZRadoFinite_three_mod6_0 {k : ℕ} (hk : 6 ≤ k) (hmod : k % 6 = 0) : IsZRadoFinite k 3 1 := by set m := k / 6 have hkm : k = 6 * m := by omega refine ⟨k, fun χ => ?_⟩ by_contra hno set r := χ 0; set b := χ 1; set g := χ (-1) have hrb : r ≠ b := fun h => hno <| hasZSol_combo1 (col := r) (v1 := 0) (z := 1) rfl h.symm (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hrg : r ≠ g := fun h => hno <| hasZSol_combo2 (col := r) (a := k - 1) (b := 1) (v1 := 0) (v2 := -1) (z := 0) (by omega) rfl h.symm rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hbg : b ≠ g := fun h => hno <| hasZSol_combo2 (col := b) (a := 3 * m) (b := 3 * m) (v1 := -1) (v2 := 1) (z := 1) (by omega) h.symm rfl rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hmkm1_r : χ (-((k : ℤ) - 1)) = r := by have hng : χ (-((k : ℤ) - 1)) ≠ g := fun h => hno <| hasZSol_combo1 (col := g) (v1 := -1) (z := -((k : ℤ) - 1)) rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hnb : χ (-((k : ℤ) - 1)) ≠ b := fun h => hno <| hasZSol_combo2 (col := b) (a := 2) (b := k - 2) (v1 := -((k : ℤ) - 1)) (v2 := 1) (z := -((k : ℤ) - 1)) (by omega) h rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ (-((k : ℤ) - 1))) with h | h | h · exact h · exact absurd h hnb · exact absurd h hng have hm2_g : χ (-2) = g := by have hnr : χ (-2) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 3 * m) (b := 3 * m) (v1 := -2) (v2 := 0) (z := -((k : ℤ) - 1)) (by omega) h rfl hmkm1_r (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) have hnb : χ (-2) ≠ b := fun h => hno <| hasZSol_combo2 (col := b) (a := 2 * m) (b := 4 * m) (v1 := -2) (v2 := 1) (z := 1) (by omega) h rfl rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) rcases fin3_exhaust hrb hrg hbg (χ (-2)) with h | h | h · exact absurd h hnr · exact absurd h hnb · exact h exact kill_c1_m2_in_g hk ⟨3 * m, by omega⟩ le_rfl hrb hrg hbg rfl rfl rfl hmkm1_r hm2_g hno /-- **Case 2 (`k = 6m + 2 ≥ 8`, `c = 1`, `n = 3`)**. -/ private lemma isZRadoFinite_three_mod6_2 {k : ℕ} (hk : 8 ≤ k) (hmod : k % 6 = 2) : IsZRadoFinite k 3 1 := by set m := (k - 2) / 6 have hkm : k = 6 * m + 2 := by omega refine ⟨k, fun χ => ?_⟩ by_contra hno set r := χ 0; set b := χ 1; set g := χ (-1) have hrb : r ≠ b := fun h => hno <| hasZSol_combo1 (col := r) (v1 := 0) (z := 1) rfl h.symm (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hrg : r ≠ g := fun h => hno <| hasZSol_combo2 (col := r) (a := k - 1) (b := 1) (v1 := 0) (v2 := -1) (z := 0) (by omega) rfl h.symm rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hbg : b ≠ g := fun h => hno <| hasZSol_combo2 (col := b) (a := 3 * m + 1) (b := 3 * m + 1) (v1 := -1) (v2 := 1) (z := 1) (by omega) h.symm rfl rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hmkm1_r : χ (-((k : ℤ) - 1)) = r := by have hng : χ (-((k : ℤ) - 1)) ≠ g := fun h => hno <| hasZSol_combo1 (col := g) (v1 := -1) (z := -((k : ℤ) - 1)) rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hnb : χ (-((k : ℤ) - 1)) ≠ b := fun h => hno <| hasZSol_combo2 (col := b) (a := 2) (b := k - 2) (v1 := -((k : ℤ) - 1)) (v2 := 1) (z := -((k : ℤ) - 1)) (by omega) h rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ (-((k : ℤ) - 1))) with h | h | h · exact h · exact absurd h hnb · exact absurd h hng have hm2_nr : χ (-2) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 3 * m + 1) (b := 3 * m + 1) (v1 := -2) (v2 := 0) (z := -((k : ℤ) - 1)) (by omega) h rfl hmkm1_r (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) rcases fin3_exhaust hrb hrg hbg (χ (-2)) with hm2_r | hm2_b | hm2_g · exact absurd hm2_r hm2_nr · -- Branch `-2 ∈ b`: have h2_r : χ 2 = r := by have hng : χ 2 ≠ g := fun h => hno <| hasZSol_combo2 (col := g) (a := 4 * m + 2) (b := 2 * m) (v1 := -1) (v2 := 2) (z := -1) (by omega) rfl h rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hnb : χ 2 ≠ b := fun h => hno <| hasZSol_combo2 (col := b) (a := 3 * m + 1) (b := 3 * m + 1) (v1 := -2) (v2 := 2) (z := 1) (by omega) hm2_b h rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) rcases fin3_exhaust hrb hrg hbg (χ 2) with h | h | h · exact h · exact absurd h hnb · exact absurd h hng have hkm5_g : χ ((k : ℤ) - 5) = g := by have hnb : χ ((k : ℤ) - 5) ≠ b := fun h => hno <| hasZSol_combo2 (col := b) (a := 2) (b := k - 2) (v1 := -2) (v2 := 1) (z := (k : ℤ) - 5) (by omega) hm2_b rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) have hnr : χ ((k : ℤ) - 5) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 3 * m - 2) (b := 3 * m + 4) (v1 := 2) (v2 := 0) (z := (k : ℤ) - 5) (by omega) h2_r rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) rcases fin3_exhaust hrb hrg hbg (χ ((k : ℤ) - 5)) with h | h | h · exact absurd h hnr · exact absurd h hnb · exact h have hm3_r : χ (-3) = r := by have hnb : χ (-3) ≠ b := fun h => hno <| hasZSol_combo2 (col := b) (a := 2 * m + 2) (b := 4 * m) (v1 := -2) (v2 := 1) (z := -3) (by omega) hm2_b rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hng : χ (-3) ≠ g := fun h => hno <| hasZSol_combo2 (col := g) (a := 1) (b := k - 1) (v1 := (k : ℤ) - 5) (v2 := -1) (z := -3) (by omega) hkm5_g rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ (-3)) with h | h | h · exact h · exact absurd h hnb · exact absurd h hng exact hno <| hasZSol_combo3 (col := r) (a := 1) (b := 2) (d := k - 3) (v1 := -3) (v2 := 2) (v3 := 0) (z := 2) (by omega) hm3_r h2_r rfl h2_r (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) · exact kill_c1_m2_in_g (by omega) ⟨3 * m + 1, by omega⟩ le_rfl hrb hrg hbg rfl rfl rfl hmkm1_r hm2_g hno /-- Shared kill for `k` odd ≥ 5, `c = 2`, when `0, -(k-2) ∈ r`, `2 ∈ b`, `-1, -2 ∈ g`. -/ private lemma kill_c2_m2_in_g {k W : ℕ} {χ : ℤ → Fin 3} {r b g : Fin 3} (hk : 5 ≤ k) (hodd : k % 2 = 1) (hW : k + 2 ≤ W) (hrb : r ≠ b) (hrg : r ≠ g) (hbg : b ≠ g) (h0 : χ 0 = r) (h2 : χ 2 = b) (hm1 : χ (-1) = g) (hmkm2 : χ (-((k : ℤ) - 2)) = r) (hm2 : χ (-2) = g) (hno : ¬ HasZSol k 2 W χ) : False := by set q := (k - 1) / 2 have hkq : k = 2 * q + 1 := by omega have hmk_b : χ (-(k : ℤ)) = b := by have hnr : χ (-(k : ℤ)) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 1) (b := k - 1) (v1 := -(k : ℤ)) (v2 := 0) (z := -((k : ℤ) - 2)) (by omega) h h0 hmkm2 (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) have hng : χ (-(k : ℤ)) ≠ g := fun h => hno <| hasZSol_combo2 (col := g) (a := 2) (b := k - 2) (v1 := -2) (v2 := -1) (z := -(k : ℤ)) (by omega) hm2 hm1 h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ (-(k : ℤ))) with h | h | h · exact absurd h hnr · exact h · exact absurd h hng have h1_r : χ 1 = r := by have hng : χ 1 ≠ g := fun h => hno <| hasZSol_combo2 (col := g) (a := q + 1) (b := q) (v1 := -1) (v2 := 1) (z := 1) (by omega) hm1 h h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hnb : χ 1 ≠ b := fun h => hno <| hasZSol_combo2 (col := b) (a := 2) (b := k - 2) (v1 := -(k : ℤ)) (v2 := 1) (z := -(k : ℤ)) (by omega) hmk_b h hmk_b (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ 1) with h | h | h · exact h · exact absurd h hnb · exact absurd h hng have hkm2_b : χ ((k : ℤ) - 2) = b := by have hnr : χ ((k : ℤ) - 2) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := k - 4) (b := 4) (v1 := 1) (v2 := 0) (z := (k : ℤ) - 2) (by omega) h1_r h0 h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) have hng : χ ((k : ℤ) - 2) ≠ g := fun h => hno <| hasZSol_combo3 (col := g) (a := 1) (b := 2) (d := k - 3) (v1 := (k : ℤ) - 2) (v2 := -2) (v3 := -1) (z := -1) (by omega) h hm2 hm1 hm1 (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ ((k : ℤ) - 2)) with h | h | h · exact absurd h hnr · exact h · exact absurd h hng have hkm1_b : χ ((k : ℤ) - 1) = b := by have hnr : χ ((k : ℤ) - 1) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := k - 3) (b := 3) (v1 := 1) (v2 := 0) (z := (k : ℤ) - 1) (by omega) h1_r h0 h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) have hng : χ ((k : ℤ) - 1) ≠ g := fun h => hno <| hasZSol_combo3 (col := g) (a := 1) (b := 3) (d := k - 4) (v1 := (k : ℤ) - 1) (v2 := -2) (v3 := -1) (z := -1) (by omega) h hm2 hm1 hm1 (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ ((k : ℤ) - 1)) with h | h | h · exact absurd h hnr · exact h · exact absurd h hng exact hno <| hasZSol_combo3 (col := b) (a := q) (b := q) (d := 1) (v1 := -(k : ℤ)) (v2 := (k : ℤ) - 2) (v3 := (k : ℤ) - 1) (z := 2) (by omega) hmk_b hkm2_b hkm1_b h2 (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by have : (k : ℤ) = 2 * (q : ℤ) + 1 := by exact_mod_cast hkq push_cast; nlinarith) /-- Shared kill for `k` odd ≥ 9 (with `k ≥ 11` when `k % 4 = 3`, or `k = 9` or `k ≥ 15`), `c = 2`, when `0, 1 ∈ r`, `2, -2 ∈ b`, `-1 ∈ g`. -/ private lemma kill_c2_m2_in_b {k W : ℕ} {χ : ℤ → Fin 3} {r b g : Fin 3} (hk : 9 ≤ k) (hodd : k % 2 = 1) (hW : k + 12 ≤ W) (hrb : r ≠ b) (hrg : r ≠ g) (hbg : b ≠ g) (h0 : χ 0 = r) (h1 : χ 1 = r) (h2 : χ 2 = b) (hm2 : χ (-2) = b) (hm1 : χ (-1) = g) (hno : ¬ HasZSol k 2 W χ) : False := by set q := (k - 1) / 2 have hkq : k = 2 * q + 1 := by omega have h4_g : χ 4 = g := by have hnr : χ 4 ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 2) (b := k - 2) (v1 := 1) (v2 := 0) (z := 4) (by omega) h1 h0 h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hnb : χ 4 ≠ b := fun h => hno <| hasZSol_combo2 (col := b) (a := q + 1) (b := q) (v1 := 2) (v2 := -2) (z := 4) (by omega) h2 hm2 h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) rcases fin3_exhaust hrb hrg hbg (χ 4) with h | h | h · exact absurd h hnr · exact absurd h hnb · exact h by_cases hmod4 : k % 4 = 3 · set t := (k + 1) / 4 have hkt : k = 4 * t - 1 := by omega have hkp1_g : χ ((k : ℤ) + 1) = g := by have hnr : χ ((k : ℤ) + 1) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := k - 1) (b := 1) (v1 := 1) (v2 := 0) (z := (k : ℤ) + 1) (by omega) h1 h0 h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) have hnb : χ ((k : ℤ) + 1) ≠ b := fun h => hno <| hasZSol_combo2 (col := b) (a := 3 * t - 1) (b := t) (v1 := 2) (v2 := -2) (z := (k : ℤ) + 1) (by omega) h2 hm2 h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) rcases fin3_exhaust hrb hrg hbg (χ ((k : ℤ) + 1)) with h | h | h · exact absurd h hnr · exact absurd h hnb · exact h exact hno <| hasZSol_combo2 (col := g) (a := 1) (b := k - 1) (v1 := (k : ℤ) + 1) (v2 := -1) (z := 4) (by omega) hkp1_g hm1 h4_g (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) · have hmod4' : k % 4 = 1 := by omega set t := (k - 1) / 4 have hkt : k = 4 * t + 1 := by omega have hkm1_g : χ ((k : ℤ) - 1) = g := by have hnr : χ ((k : ℤ) - 1) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := k - 3) (b := 3) (v1 := 1) (v2 := 0) (z := (k : ℤ) - 1) (by omega) h1 h0 h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) have hnb : χ ((k : ℤ) - 1) ≠ b := fun h => hno <| hasZSol_combo2 (col := b) (a := 3 * t) (b := t + 1) (v1 := 2) (v2 := -2) (z := (k : ℤ) - 1) (by omega) h2 hm2 h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) rcases fin3_exhaust hrb hrg hbg (χ ((k : ℤ) - 1)) with h | h | h · exact absurd h hnr · exact absurd h hnb · exact h by_cases hk9 : k = 9 · subst hk9 have h8_g : χ 8 = g := by have hnr : χ 8 ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 6) (b := 3) (v1 := 1) (v2 := 0) (z := 8) (by omega) h1 h0 h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by norm_num) have hnb : χ 8 ≠ b := fun h => hno <| hasZSol_combo2 (col := b) (a := 6) (b := 3) (v1 := 2) (v2 := -2) (z := 8) (by omega) h2 hm2 h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by norm_num) rcases fin3_exhaust hrb hrg hbg (χ 8) with h | h | h · exact absurd h hnr · exact absurd h hnb · exact h exact hno <| hasZSol_combo2 (col := g) (a := 3) (b := 6) (v1 := 4) (v2 := -1) (z := 8) (by omega) h4_g hm1 h8_g (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by norm_num) · have hk13 : 13 ≤ k := by omega have h12_g : χ 12 = g := by have hnr : χ 12 ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 10) (b := k - 10) (v1 := 1) (v2 := 0) (z := 12) (by omega) h1 h0 h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by norm_num) have hnb : χ 12 ≠ b := fun h => hno <| hasZSol_combo2 (col := b) (a := q + 3) (b := q - 2) (v1 := 2) (v2 := -2) (z := 12) (by omega) h2 hm2 h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) rcases fin3_exhaust hrb hrg hbg (χ 12) with h | h | h · exact absurd h hnr · exact absurd h hnb · exact h exact hno <| hasZSol_combo3 (col := g) (a := 1) (b := 2) (d := k - 3) (v1 := (k : ℤ) - 1) (v2 := 4) (v3 := -1) (z := 12) (by omega) hkm1_g h4_g hm1 h12_g (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) /-- **Case 3 (`k = 6m + 3 ≥ 9`, `c = 2`, `n = 3`)**. -/ private lemma isZRadoFinite_three_mod6_3 {k : ℕ} (hk : 9 ≤ k) (hmod : k % 6 = 3) : IsZRadoFinite k 3 2 := by set m := (k - 3) / 6 have hkm : k = 6 * m + 3 := by omega refine ⟨k + 12, fun χ => ?_⟩ by_contra hno set r := χ 0; set b := χ 2; set g := χ (-1) have hrb : r ≠ b := fun h => hno <| hasZSol_combo1 (col := r) (v1 := 0) (z := 2) rfl h.symm (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hrg : r ≠ g := fun h => hno <| hasZSol_combo2 (col := r) (a := 2) (b := k - 2) (v1 := -1) (v2 := 0) (z := 0) (by omega) h.symm rfl rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hbg : b ≠ g := fun h => hno <| hasZSol_combo2 (col := b) (a := 4 * m + 3) (b := 2 * m) (v1 := -1) (v2 := 2) (z := -1) (by omega) h.symm rfl h.symm (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hmkm2_r : χ (-((k : ℤ) - 2)) = r := by have hng : χ (-((k : ℤ) - 2)) ≠ g := fun h => hno <| hasZSol_combo1 (col := g) (v1 := -1) (z := -((k : ℤ) - 2)) rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hnb : χ (-((k : ℤ) - 2)) ≠ b := fun h => hno <| hasZSol_combo2 (col := b) (a := 3) (b := k - 3) (v1 := -((k : ℤ) - 2)) (v2 := 2) (z := -((k : ℤ) - 2)) (by omega) h rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ (-((k : ℤ) - 2))) with h | h | h · exact h · exact absurd h hnb · exact absurd h hng have hm2_nr : χ (-2) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 1) (b := k - 1) (v1 := -2) (v2 := 0) (z := 0) (by omega) h rfl rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) rcases fin3_exhaust hrb hrg hbg (χ (-2)) with hm2_r | hm2_b | hm2_g · exact absurd hm2_r hm2_nr · -- `-2 ∈ b`: force `1 ∈ r`, then `kill_c2_m2_in_b`. have h1_r : χ 1 = r := by have hng : χ 1 ≠ g := fun h => hno <| hasZSol_combo2 (col := g) (a := 3 * m + 2) (b := 3 * m + 1) (v1 := -1) (v2 := 1) (z := 1) (by omega) rfl h h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hnb : χ 1 ≠ b := fun h => hno <| hasZSol_combo2 (col := b) (a := 2 * m + 1) (b := 4 * m + 2) (v1 := -2) (v2 := 1) (z := 2) (by omega) hm2_b h rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) rcases fin3_exhaust hrb hrg hbg (χ 1) with h | h | h · exact h · exact absurd h hnb · exact absurd h hng exact kill_c2_m2_in_b hk (by omega) le_rfl hrb hrg hbg rfl h1_r rfl hm2_b rfl hno · exact kill_c2_m2_in_g (by omega) (by omega) (by omega) hrb hrg hbg rfl rfl rfl hmkm2_r hm2_g hno /-- **Case 4 (`k = 6m + 5 ≥ 5`, `c = 2`, `n = 3`)**. -/ private lemma isZRadoFinite_three_mod6_5 {k : ℕ} (hk : 5 ≤ k) (hmod : k % 6 = 5) : IsZRadoFinite k 3 2 := by set m := (k - 5) / 6 have hkm : k = 6 * m + 5 := by omega refine ⟨k + 12, fun χ => ?_⟩ by_contra hno set r := χ 0 obtain ⟨b, g, hrb, hrg, hbg⟩ := fin3_other_two r have h2_nr : χ 2 ≠ r := fun h => hno <| hasZSol_combo1 (col := r) (v1 := 0) (z := 2) rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hm1_nr : χ (-1) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 2) (b := k - 2) (v1 := -1) (v2 := 0) (z := 0) (by omega) h rfl rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hm2_nr : χ (-2) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 1) (b := k - 1) (v1 := -2) (v2 := 0) (z := 0) (by omega) h rfl rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have h1_ne_m1 : χ 1 ≠ χ (-1) := fun h => hno <| hasZSol_combo2 (col := χ 1) (a := 3 * m + 3) (b := 3 * m + 2) (v1 := -1) (v2 := 1) (z := 1) (by omega) h.symm rfl rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have h1_ne_m2 : χ 1 ≠ χ (-2) := fun h => hno <| hasZSol_combo2 (col := χ 1) (a := 2 * m + 3) (b := 4 * m + 2) (v1 := -2) (v2 := 1) (z := -2) (by omega) h.symm rfl h.symm (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) -- Helper for Branch 4a: `χ (-1) = g'`, `χ 2 = b'` with `r, b', g'` distinct. have h4a : ∀ (b' g' : Fin 3), r ≠ b' → r ≠ g' → b' ≠ g' → χ 2 = b' → χ (-1) = g' → False := by intro b' g' hrb' hrg' hbg' h2b' hm1g' have hmkm2_r : χ (-((k : ℤ) - 2)) = r := by have hng : χ (-((k : ℤ) - 2)) ≠ g' := fun h => hno <| hasZSol_combo1 (col := g') (v1 := -1) (z := -((k : ℤ) - 2)) hm1g' h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hnb : χ (-((k : ℤ) - 2)) ≠ b' := fun h => hno <| hasZSol_combo2 (col := b') (a := 3) (b := k - 3) (v1 := -((k : ℤ) - 2)) (v2 := 2) (z := -((k : ℤ) - 2)) (by omega) h h2b' h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb' hrg' hbg' (χ (-((k : ℤ) - 2))) with h | h | h · exact h · exact absurd h hnb · exact absurd h hng rcases fin3_exhaust hrb' hrg' hbg' (χ (-2)) with hm2r | hm2b' | hm2g' · exact absurd hm2r hm2_nr · -- `-2 ∈ b'`: force `1 ∈ r`, then `k = 5` directly or `kill_c2_m2_in_b` for `k ≥ 11`. have h1_r : χ 1 = r := by rcases fin3_exhaust hrb' hrg' hbg' (χ 1) with h | h | h · exact h · exact absurd (h.trans hm2b'.symm) h1_ne_m2 · exact absurd (h.trans hm1g'.symm) h1_ne_m1 by_cases hk5 : k = 5 · subst hk5 have hm5_g' : χ (-5) = g' := by have hnr : χ (-5) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 1) (b := 4) (v1 := -5) (v2 := 0) (z := -3) (by omega) h rfl hmkm2_r (by norm_num) (by norm_num) (by norm_num) (by norm_num) have hnb : χ (-5) ≠ b' := fun h => hno <| hasZSol_combo2 (col := b') (a := 2) (b := 3) (v1 := -5) (v2 := 2) (z := -2) (by omega) h h2b' hm2b' (by norm_num) (by norm_num) (by norm_num) (by norm_num) rcases fin3_exhaust hrb' hrg' hbg' (χ (-5)) with h | h | h · exact absurd h hnr · exact absurd h hnb · exact h have h4_g' : χ 4 = g' := by have hnr : χ 4 ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 2) (b := 3) (v1 := 1) (v2 := 0) (z := 4) (by omega) h1_r rfl h (by norm_num) (by norm_num) (by norm_num) (by norm_num) have hnb : χ 4 ≠ b' := fun h => hno <| hasZSol_combo2 (col := b') (a := 3) (b := 2) (v1 := 2) (v2 := -2) (z := 4) (by omega) h2b' hm2b' h (by norm_num) (by norm_num) (by norm_num) (by norm_num) rcases fin3_exhaust hrb' hrg' hbg' (χ 4) with h | h | h · exact absurd h hnr · exact absurd h hnb · exact h exact hno <| hasZSol_combo2 (col := g') (a := 3) (b := 2) (v1 := -5) (v2 := 4) (z := -5) (by omega) hm5_g' h4_g' hm5_g' (by norm_num) (by norm_num) (by norm_num) (by norm_num) · exact kill_c2_m2_in_b (by omega) (by omega) le_rfl hrb' hrg' hbg' rfl h1_r h2b' hm2b' hm1g' hno · exact kill_c2_m2_in_g hk (by omega) (by omega) hrb' hrg' hbg' rfl h2b' hm1g' hmkm2_r hm2g' hno -- Helper for Branch 4b: `χ (-1) = χ 2 = g'`, with `r, b', g'` distinct. have h4b : ∀ (b' g' : Fin 3), r ≠ b' → r ≠ g' → b' ≠ g' → χ 2 = g' → χ (-1) = g' → False := by intro b' g' hrb' hrg' hbg' h2g' hm1g' have hm2_b' : χ (-2) = b' := by have hng : χ (-2) ≠ g' := fun h => hno <| hasZSol_combo3 (col := g') (a := 3 * m + 1) (b := 3 * m + 2) (d := 2) (v1 := -2) (v2 := 2) (v3 := -1) (z := 2) (by omega) h h2g' hm1g' h2g' (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) rcases fin3_exhaust hrb' hrg' hbg' (χ (-2)) with h | h | h · exact absurd h hm2_nr · exact h · exact absurd h hng have h1_r : χ 1 = r := by rcases fin3_exhaust hrb' hrg' hbg' (χ 1) with h | h | h · exact h · exact absurd (h.trans hm2_b'.symm) h1_ne_m2 · exact absurd (h.trans hm1g'.symm) h1_ne_m1 by_cases hk5 : k = 5 · subst hk5 have h4_nr : χ 4 ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 2) (b := 3) (v1 := 1) (v2 := 0) (z := 4) (by omega) h1_r rfl h (by norm_num) (by norm_num) (by norm_num) (by norm_num) have h4_nb : χ 4 ≠ b' := fun h => hno <| hasZSol_combo2 (col := b') (a := 4) (b := 1) (v1 := -2) (v2 := 4) (z := -2) (by omega) hm2_b' h hm2_b' (by norm_num) (by norm_num) (by norm_num) (by norm_num) have h4_ng : χ 4 ≠ g' := fun h => hno <| hasZSol_combo2 (col := g') (a := 4) (b := 1) (v1 := -1) (v2 := 4) (z := 2) (by omega) hm1g' h h2g' (by norm_num) (by norm_num) (by norm_num) (by norm_num) rcases fin3_exhaust hrb' hrg' hbg' (χ 4) with h | h | h · exact absurd h h4_nr · exact absurd h h4_nb · exact absurd h h4_ng · have hk11 : 11 ≤ k := by omega have hmult3_b' : ∀ u : ℕ, 3 ≤ u → u ≤ k + 2 → u % 3 = 0 → χ (u : ℤ) = b' := by intro u hu3 huk hu3m have hnr : χ (u : ℤ) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := u - 2) (b := k - (u - 2)) (v1 := 1) (v2 := 0) (z := (u : ℤ)) (by omega) h1_r rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) have hng : χ (u : ℤ) ≠ g' := fun h => hno <| hasZSol_combo2 (col := g') (a := (u + k - 2) / 3) (b := k - (u + k - 2) / 3) (v1 := 2) (v2 := -1) (z := (u : ℤ)) (by omega) h2g' hm1g' h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) rcases fin3_exhaust hrb' hrg' hbg' (χ (u : ℤ)) with h | h | h · exact absurd h hnr · exact h · exact absurd h hng have h3_b' : χ 3 = b' := hmult3_b' 3 (by omega) (by omega) (by omega) have hkm2_b' : χ ((k : ℤ) - 2) = b' := by have := hmult3_b' (k - 2) (by omega) (by omega) (by omega) have hcast : ((k - 2 : ℕ) : ℤ) = (k : ℤ) - 2 := by omega rwa [hcast] at this have h12_b' : χ 12 = b' := hmult3_b' 12 (by omega) (by omega) (by omega) exact hno <| hasZSol_combo3 (col := b') (a := 2) (b := 2) (d := k - 4) (v1 := (k : ℤ) - 2) (v2 := 3) (v3 := -2) (z := 12) (by omega) hkm2_b' h3_b' hm2_b' h12_b' (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) -- Dispatch on colors of `2` and `-1` in `{b, g}`: rcases fin3_exhaust hrb hrg hbg (χ 2) with h2r | h2b | h2g · exact absurd h2r h2_nr · rcases fin3_exhaust hrb hrg hbg (χ (-1)) with hm1r | hm1b | hm1g · exact absurd hm1r hm1_nr · exact h4b g b hrg hrb hbg.symm h2b hm1b · exact h4a b g hrb hrg hbg h2b hm1g · rcases fin3_exhaust hrb hrg hbg (χ (-1)) with hm1r | hm1b | hm1g · exact absurd hm1r hm1_nr · exact h4a g b hrg hrb hbg.symm h2g hm1b · exact h4b b g hrb hrg hbg h2g hm1g /-- **Case 5 (`k = 6m + 4 ≥ 10`, `c = 3`, `n = 3`)**. -/ private lemma isZRadoFinite_three_mod6_4 {k : ℕ} (hk : 10 ≤ k) (hmod : k % 6 = 4) : IsZRadoFinite k 3 3 := by set m := (k - 4) / 6 have hkm : k = 6 * m + 4 := by omega refine ⟨k + 19, fun χ => ?_⟩ by_contra hno set r := χ 0; set b := χ 3; set g := χ (-3) have hrb : r ≠ b := fun h => hno <| hasZSol_combo1 (col := r) (v1 := 0) (z := 3) rfl h.symm (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hrg : r ≠ g := fun h => hno <| hasZSol_combo2 (col := r) (a := 1) (b := k - 1) (v1 := -3) (v2 := 0) (z := 0) (by omega) h.symm rfl rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hbg : b ≠ g := fun h => hno <| hasZSol_combo2 (col := b) (a := 3 * m + 2) (b := 3 * m + 2) (v1 := -3) (v2 := 3) (z := 3) (by omega) h.symm rfl rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hm1_nr : χ (-1) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 3) (b := k - 3) (v1 := -1) (v2 := 0) (z := 0) (by omega) h rfl rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have h1_ne_m1 : χ 1 ≠ χ (-1) := fun h => hno <| hasZSol_combo2 (col := χ 1) (a := 3 * m + 4) (b := 3 * m) (v1 := -1) (v2 := 1) (z := -1) (by omega) h.symm rfl h.symm (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) rcases fin3_exhaust hrb hrg hbg (χ (-1)) with hm1_r | hm1_b | hm1_g · exact absurd hm1_r hm1_nr · -- Branch 5a: `-1 ∈ b` (so `3, -1 ∈ b`, `1 ∉ b`). rcases fin3_exhaust hrb hrg hbg (χ 1) with h1_r | h1_b | h1_g · -- `1 ∈ r`: every `u ∈ [4, k + 3]` with `(u + k - 3) % 4 = 0` is in `g`. have hu_g : ∀ u : ℕ, 4 ≤ u → u ≤ k + 3 → (u + k - 3) % 4 = 0 → χ (u : ℤ) = g := by intro u hu4 huk hu4m have hnr : χ (u : ℤ) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := u - 3) (b := k - (u - 3)) (v1 := 1) (v2 := 0) (z := (u : ℤ)) (by omega) h1_r rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) have hnb : χ (u : ℤ) ≠ b := fun h => hno <| hasZSol_combo2 (col := b) (a := (u + k - 3) / 4) (b := k - (u + k - 3) / 4) (v1 := 3) (v2 := -1) (z := (u : ℤ)) (by omega) rfl hm1_b h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) rcases fin3_exhaust hrb hrg hbg (χ (u : ℤ)) with h | h | h · exact absurd h hnr · exact absurd h hnb · exact h by_cases hmod4 : k % 4 = 2 · have h9_g : χ 9 = g := hu_g 9 (by omega) (by omega) (by omega) have hkm1_g : χ ((k : ℤ) - 1) = g := by have := hu_g (k - 1) (by omega) (by omega) (by omega) have hcast : ((k - 1 : ℕ) : ℤ) = (k : ℤ) - 1 := by omega rwa [hcast] at this exact hno <| hasZSol_combo2 (col := g) (a := 3) (b := k - 3) (v1 := (k : ℤ) - 1) (v2 := -3) (z := 9) (by omega) hkm1_g rfl h9_g (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) · have hmod4' : k % 4 = 0 := by omega have hk16 : 16 ≤ k := by omega have h7_g : χ 7 = g := hu_g 7 (by omega) (by omega) (by omega) have h19_g : χ 19 = g := hu_g 19 (by omega) (by omega) (by omega) have hkm1_g : χ ((k : ℤ) - 1) = g := by have := hu_g (k - 1) (by omega) (by omega) (by omega) have hcast : ((k - 1 : ℕ) : ℤ) = (k : ℤ) - 1 := by omega rwa [hcast] at this exact hno <| hasZSol_combo3 (col := g) (a := 3) (b := 1) (d := k - 4) (v1 := (k : ℤ) - 1) (v2 := 7) (v3 := -3) (z := 19) (by omega) hkm1_g h7_g rfl h19_g (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) · exact absurd (h1_b.trans hm1_b.symm) h1_ne_m1 · -- `1 ∈ g`: immediate kill by `k % 4 = 2` vs `k % 4 = 0`. by_cases hmod4 : k % 4 = 2 · exact hno <| hasZSol_combo2 (col := g) (a := (3 * k - 6) / 4) (b := (k + 6) / 4) (v1 := 1) (v2 := -3) (z := -3) (by omega) h1_g rfl rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) · have hmod4' : k % 4 = 0 := by omega exact hno <| hasZSol_combo2 (col := b) (a := (k - 4) / 4) (b := (3 * k + 4) / 4) (v1 := 3) (v2 := -1) (z := -1) (by omega) rfl hm1_b hm1_b (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) · -- Branch 5b: `-1 ∈ g` (so `-3, -1 ∈ g`, `1 ∉ g`). have hmkm3_r : χ (-((k : ℤ) - 3)) = r := by have hng : χ (-((k : ℤ) - 3)) ≠ g := fun h => hno <| hasZSol_combo1 (col := g) (v1 := -1) (z := -((k : ℤ) - 3)) hm1_g h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hnb : χ (-((k : ℤ) - 3)) ≠ b := fun h => hno <| hasZSol_combo2 (col := b) (a := 4) (b := k - 4) (v1 := -((k : ℤ) - 3)) (v2 := 3) (z := -((k : ℤ) - 3)) (by omega) h rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ (-((k : ℤ) - 3))) with h | h | h · exact h · exact absurd h hnb · exact absurd h hng have hm2_nr : χ (-2) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 3 * m + 2) (b := 3 * m + 2) (v1 := -2) (v2 := 0) (z := -((k : ℤ) - 3)) (by omega) h rfl hmkm3_r (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) have hmk_nr : χ (-(k : ℤ)) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 1) (b := k - 1) (v1 := -(k : ℤ)) (v2 := 0) (z := -((k : ℤ) - 3)) (by omega) h rfl hmkm3_r (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ 1) with h1_r | h1_b | h1_g · -- Subbranch 5b-1: `1 ∈ r`. rcases fin3_exhaust hrb hrg hbg (χ (-2)) with hm2_r | hm2_b | hm2_g · exact absurd hm2_r hm2_nr · -- `-2 ∈ b`: force `k - 3 ∈ b` and `k - 1 ∈ b`, then kill in `b`. have hkm3_b : χ ((k : ℤ) - 3) = b := by have hnr : χ ((k : ℤ) - 3) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := k - 6) (b := 6) (v1 := 1) (v2 := 0) (z := (k : ℤ) - 3) (by omega) h1_r rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) have hng : χ ((k : ℤ) - 3) ≠ g := fun h => hno <| hasZSol_combo3 (col := g) (a := 1) (b := 1) (d := k - 2) (v1 := (k : ℤ) - 3) (v2 := -3) (v3 := -1) (z := -1) (by omega) h rfl hm1_g hm1_g (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ ((k : ℤ) - 3)) with h | h | h · exact absurd h hnr · exact h · exact absurd h hng have hkm1_b : χ ((k : ℤ) - 1) = b := by have hnr : χ ((k : ℤ) - 1) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := k - 4) (b := 4) (v1 := 1) (v2 := 0) (z := (k : ℤ) - 1) (by omega) h1_r rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) have hng : χ ((k : ℤ) - 1) ≠ g := fun h => hno <| hasZSol_combo3 (col := g) (a := 1) (b := 2) (d := k - 3) (v1 := (k : ℤ) - 1) (v2 := -3) (v3 := -1) (z := -1) (by omega) h rfl hm1_g hm1_g (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ ((k : ℤ) - 1)) with h | h | h · exact absurd h hnr · exact h · exact absurd h hng exact hno <| hasZSol_combo3 (col := b) (a := k - 2) (b := 1) (d := 1) (v1 := -2) (v2 := (k : ℤ) - 3) (v3 := (k : ℤ) - 1) (z := 3) (by omega) hm2_b hkm3_b hkm1_b rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) · -- `-2 ∈ g`: force `-k ∈ b` and `k ∈ b`, then kill in `b`. have hmk_b : χ (-(k : ℤ)) = b := by have hng : χ (-(k : ℤ)) ≠ g := fun h => hno <| hasZSol_combo3 (col := g) (a := 1) (b := 1) (d := k - 2) (v1 := -3) (v2 := -2) (v3 := -1) (z := -(k : ℤ)) (by omega) rfl hm2_g hm1_g h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ (-(k : ℤ))) with h | h | h · exact absurd h hmk_nr · exact h · exact absurd h hng have hk_b : χ (k : ℤ) = b := by have hnr : χ (k : ℤ) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := k - 3) (b := 3) (v1 := 1) (v2 := 0) (z := (k : ℤ)) (by omega) h1_r rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) have hng : χ (k : ℤ) ≠ g := fun h => hno <| hasZSol_combo4 (col := g) (a := 1) (b := 2) (d := 1) (e := k - 4) (v1 := (k : ℤ)) (v2 := -3) (v3 := -2) (v4 := -1) (z := -1) (by omega) h rfl hm2_g hm1_g hm1_g (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ (k : ℤ)) with h | h | h · exact absurd h hnr · exact h · exact absurd h hng exact hno <| hasZSol_combo2 (col := b) (a := 3 * m + 2) (b := 3 * m + 2) (v1 := -(k : ℤ)) (v2 := (k : ℤ)) (z := 3) (by omega) hmk_b hk_b rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) · -- Subbranch 5b-2: `1 ∈ b`. rcases fin3_exhaust hrb hrg hbg (χ (-2)) with hm2_r | hm2_b | hm2_g · exact absurd hm2_r hm2_nr · exact hno <| hasZSol_combo2 (col := b) (a := 2 * m + 2) (b := 4 * m + 2) (v1 := -2) (v2 := 1) (z := 1) (by omega) hm2_b h1_b h1_b (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) · have hmk_b : χ (-(k : ℤ)) = b := by have hng : χ (-(k : ℤ)) ≠ g := fun h => hno <| hasZSol_combo3 (col := g) (a := 1) (b := 1) (d := k - 2) (v1 := -3) (v2 := -2) (v3 := -1) (z := -(k : ℤ)) (by omega) rfl hm2_g hm1_g h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ (-(k : ℤ))) with h | h | h · exact absurd h hmk_nr · exact h · exact absurd h hng have hkm6_b : χ ((k : ℤ) - 6) = b := by have hnr : χ ((k : ℤ) - 6) ≠ r := fun h => hno <| hasZSol_combo3 (col := r) (a := 1) (b := 1) (d := k - 2) (v1 := -((k : ℤ) - 3)) (v2 := (k : ℤ) - 6) (v3 := 0) (z := 0) (by omega) hmkm3_r h rfl rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) have hng : χ ((k : ℤ) - 6) ≠ g := fun h => hno <| hasZSol_combo2 (col := g) (a := 1) (b := k - 1) (v1 := (k : ℤ) - 6) (v2 := -1) (z := -2) (by omega) h hm1_g hm2_g (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ ((k : ℤ) - 6)) with h | h | h · exact absurd h hnr · exact h · exact absurd h hng have hkm5_r : χ ((k : ℤ) - 5) = r := by have hng : χ ((k : ℤ) - 5) ≠ g := fun h => hno <| hasZSol_combo2 (col := g) (a := 1) (b := k - 1) (v1 := (k : ℤ) - 5) (v2 := -1) (z := -1) (by omega) h hm1_g hm1_g (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) have hnb : χ ((k : ℤ) - 5) ≠ b := fun h => hno <| hasZSol_combo3 (col := b) (a := 1) (b := 1) (d := k - 2) (v1 := -(k : ℤ)) (v2 := (k : ℤ) - 6) (v3 := 1) (z := (k : ℤ) - 5) (by omega) hmk_b hkm6_b h1_b h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb hrg hbg (χ ((k : ℤ) - 5)) with h | h | h · exact h · exact absurd h hnb · exact absurd h hng exact hno <| hasZSol_combo2 (col := r) (a := 3 * m + 2) (b := 3 * m + 2) (v1 := (k : ℤ) - 5) (v2 := -((k : ℤ) - 3)) (z := -((k : ℤ) - 3)) (by omega) hkm5_r hmkm3_r hmkm3_r (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by have : (k : ℤ) = 6 * (m : ℤ) + 4 := by exact_mod_cast hkm push_cast; nlinarith) · exact absurd (h1_g.trans hm1_g.symm) h1_ne_m1 /-- **Case 6 (`k = 6m + 1 ≥ 13`, `c = 6`, `n = 3`)**. -/ private lemma isZRadoFinite_three_mod6_1 {k : ℕ} (hk : 13 ≤ k) (hmod : k % 6 = 1) : IsZRadoFinite k 3 6 := by set m := (k - 1) / 6 have hkm : k = 6 * m + 1 := by omega have hm2 : 2 ≤ m := by omega refine ⟨k + 7, fun χ => ?_⟩ by_contra hno set r := χ 0 obtain ⟨b, g, hrb, hrg, hbg⟩ := fin3_other_two r -- All five of {-6, -3, -2, -1, 6} differ from `r = χ 0`: have h6_nr : χ 6 ≠ r := fun h => hno <| hasZSol_combo1 (col := r) (v1 := 0) (z := 6) rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hm6_nr : χ (-6) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 1) (b := k - 1) (v1 := -6) (v2 := 0) (z := 0) (by omega) h rfl rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hm3_nr : χ (-3) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 2) (b := k - 2) (v1 := -3) (v2 := 0) (z := 0) (by omega) h rfl rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hm2_nr : χ (-2) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 3) (b := k - 3) (v1 := -2) (v2 := 0) (z := 0) (by omega) h rfl rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hm1_nr : χ (-1) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 6) (b := k - 6) (v1 := -1) (v2 := 0) (z := 0) (by omega) h rfl rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) -- Edges (-1, 1) and (-2, 1): have h1_ne_m1 : χ 1 ≠ χ (-1) := fun h => hno <| hasZSol_combo2 (col := χ 1) (a := 3 * m + 4) (b := 3 * m - 3) (v1 := -1) (v2 := 1) (z := -1) (by omega) h.symm rfl h.symm (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) have h1_ne_m2 : χ 1 ≠ χ (-2) := fun h => hno <| hasZSol_combo2 (col := χ 1) (a := 2 * m + 3) (b := 4 * m - 2) (v1 := -2) (v2 := 1) (z := -2) (by omega) h.symm rfl h.symm (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) -- Forbidden triples with 6: have hforb_m3_m2_6 : ∀ col, χ (-3) = col → χ (-2) = col → χ 6 = col → False := fun col h1 h2 h3 => hno <| hasZSol_combo3 (col := col) (a := 3) (b := 4 * m - 1) (d := 2 * m - 1) (v1 := -2) (v2 := -3) (v3 := 6) (z := -3) (by omega) h2 h1 h3 h1 (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) have hforb_m6_m1_6 : ∀ col, χ (-6) = col → χ (-1) = col → χ 6 = col → False := fun col h1 h2 h3 => hno <| hasZSol_combo3 (col := col) (a := 6) (b := 3 * m - 2) (d := 3 * m - 3) (v1 := -1) (v2 := -6) (v3 := 6) (z := -6) (by omega) h2 h1 h3 h1 (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) have hforb_m3_m1_6 : ∀ col, χ (-3) = col → χ (-1) = col → χ 6 = col → False := fun col h1 h2 h3 => hno <| hasZSol_combo3 (col := col) (a := 6) (b := 4 * m - 3) (d := 2 * m - 2) (v1 := -1) (v2 := -3) (v3 := 6) (z := -3) (by omega) h2 h1 h3 h1 (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) have hforb_m2_m1_6 : ∀ col, χ (-2) = col → χ (-1) = col → χ 6 = col → False := fun col h1 h2 h3 => hno <| hasZSol_combo3 (col := col) (a := m + 7) (b := 4 * m - 6) (d := m) (v1 := -2) (v2 := -1) (v3 := 6) (z := -2) (by omega) h1 h2 h3 h1 (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) -- Core symmetry-factored proof assuming `χ (-1) = g'` with `r, b', g'` distinct: have hcore : ∀ (b' g' : Fin 3), r ≠ b' → r ≠ g' → b' ≠ g' → χ (-1) = g' → False := by intro b' g' hrb' hrg' hbg' hm1g' rcases fin3_exhaust hrb' hrg' hbg' (χ 6) with h6r | h6b' | h6g' · exact absurd h6r h6_nr · -- `6 ∈ b'`: split on whether `-2 ∈ b'` (Case 6b) or `-2 ∈ g'` (Case 6c). rcases fin3_exhaust hrb' hrg' hbg' (χ (-2)) with hm2r | hm2b' | hm2g' · exact absurd hm2r hm2_nr · -- **Case 6b**: `0 ∈ r`, `-1 ∈ g'`, `-2, 6 ∈ b'`. -- Forbidden triple `(-3, -2, 6)` forces `-3 ∈ g'`, and edges `(-1, 1), (-2, 1)` force `1 ∈ r`. have hm3g' : χ (-3) = g' := by rcases fin3_exhaust hrb' hrg' hbg' (χ (-3)) with h | h | h · exact absurd h hm3_nr · exact absurd (hforb_m3_m2_6 b' h hm2b' h6b') id · exact h have h1r : χ 1 = r := by rcases fin3_exhaust hrb' hrg' hbg' (χ 1) with h | h | h · exact h · exact absurd (h.trans hm2b'.symm) h1_ne_m2 · exact absurd (h.trans hm1g'.symm) h1_ne_m1 -- `x = -(k + 4)` cannot be in `r`, `g'`, or `b'`! set x : ℤ := -((k : ℤ) + 4) have hxr : χ x ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := k - 2) (b := 2) (v1 := 1) (v2 := x) (z := x) (by omega) h1r h h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) have hxg' : χ x ≠ g' := fun h => hno <| hasZSol_combo2 (col := g') (a := k - 5) (b := 5) (v1 := -1) (v2 := -3) (z := x) (by omega) hm1g' hm3g' h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) have hxb' : χ x ≠ b' := fun h => hno <| hasZSol_combo3 (col := b') (a := 3 * m) (b := 3 * m - 2) (d := 3) (v1 := 6) (v2 := -2) (v3 := x) (z := x) (by omega) h6b' hm2b' h h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) rcases fin3_exhaust hrb' hrg' hbg' (χ x) with h | h | h · exact absurd h hxr · exact absurd h hxb' · exact absurd h hxg' · -- **Case 6c**: `0 ∈ r`, `-1, -2 ∈ g'`, `6 ∈ b'`. -- Force `-(k - 6) ∈ r`, `1 ∈ b'`, `-k ∈ b'`, then `2` is dead in all three colors! have hmkm6_r : χ (-((k : ℤ) - 6)) = r := by have hng : χ (-((k : ℤ) - 6)) ≠ g' := fun h => hno <| hasZSol_combo1 (col := g') (v1 := -1) (z := -((k : ℤ) - 6)) hm1g' h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; ring) have hnb : χ (-((k : ℤ) - 6)) ≠ b' := fun h => hno <| hasZSol_combo2 (col := b') (a := 7) (b := k - 7) (v1 := -((k : ℤ) - 6)) (v2 := 6) (z := -((k : ℤ) - 6)) (by omega) h h6b' h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb' hrg' hbg' (χ (-((k : ℤ) - 6))) with h | h | h · exact h · exact absurd h hnb · exact absurd h hng have h1b' : χ 1 = b' := by have hnr : χ 1 ≠ r := fun h => hno <| hasZSol_combo3 (col := r) (a := 2) (b := k - 12) (d := 10) (v1 := -((k : ℤ) - 6)) (v2 := 1) (v3 := 0) (z := -((k : ℤ) - 6)) (by omega) hmkm6_r h rfl hmkm6_r (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb' hrg' hbg' (χ 1) with h | h | h · exact absurd h hnr · exact h · exact absurd (h.trans hm1g'.symm) h1_ne_m1 have hmk_b' : χ (-(k : ℤ)) = b' := by have hnr : χ (-(k : ℤ)) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 1) (b := k - 1) (v1 := -(k : ℤ)) (v2 := 0) (z := -((k : ℤ) - 6)) (by omega) h rfl hmkm6_r (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) have hng : χ (-(k : ℤ)) ≠ g' := fun h => hno <| hasZSol_combo2 (col := g') (a := 6) (b := k - 6) (v1 := -2) (v2 := -1) (z := -(k : ℤ)) (by omega) hm2g' hm1g' h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb' hrg' hbg' (χ (-(k : ℤ))) with h | h | h · exact absurd h hnr · exact h · exact absurd h hng -- Kill `x = 2`: have h2r : χ 2 ≠ r := fun h => hno <| hasZSol_combo3 (col := r) (a := 2) (b := 6 * m - 8) (d := 7) (v1 := -((k : ℤ) - 6)) (v2 := 2) (v3 := 0) (z := 0) (by omega) hmkm6_r h rfl rfl (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) have h2g' : χ 2 ≠ g' := fun h => hno <| hasZSol_combo2 (col := g') (a := 4 * m + 3) (b := 2 * m - 2) (v1 := -1) (v2 := 2) (z := -1) (by omega) hm1g' h hm1g' (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) have h2b' : χ 2 ≠ b' := fun h => hno <| hasZSol_combo3 (col := b') (a := 1) (b := 1) (d := k - 2) (v1 := -(k : ℤ)) (v2 := 2) (v3 := 1) (z := 6) (by omega) hmk_b' h h1b' h6b' (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by push_cast; omega) rcases fin3_exhaust hrb' hrg' hbg' (χ 2) with h | h | h · exact absurd h h2r · exact absurd h h2b' · exact absurd h h2g' · -- **Case 6a**: `6 ∈ g'` (so `-1, 6 ∈ g'`). -- The three forbidden triples force `-6, -3, -2 ∈ b'`, and edges `(-1, 1), (-2, 1)` force `1 ∈ r`. have hm6b' : χ (-6) = b' := by rcases fin3_exhaust hrb' hrg' hbg' (χ (-6)) with h | h | h · exact absurd h hm6_nr · exact h · exact absurd (hforb_m6_m1_6 g' h hm1g' h6g') id have hm3b' : χ (-3) = b' := by rcases fin3_exhaust hrb' hrg' hbg' (χ (-3)) with h | h | h · exact absurd h hm3_nr · exact h · exact absurd (hforb_m3_m1_6 g' h hm1g' h6g') id have hm2b' : χ (-2) = b' := by rcases fin3_exhaust hrb' hrg' hbg' (χ (-2)) with h | h | h · exact absurd h hm2_nr · exact h · exact absurd (hforb_m2_m1_6 g' h hm1g' h6g') id have h1r : χ 1 = r := by rcases fin3_exhaust hrb' hrg' hbg' (χ 1) with h | h | h · exact h · exact absurd (h.trans hm2b'.symm) h1_ne_m2 · exact absurd (h.trans hm1g'.symm) h1_ne_m1 by_cases hm_eq2 : m = 2 · -- `k = 13`: `x = 7` is dead in all three colors! have hk13 : k = 13 := by omega subst hk13 have h7r : χ 7 ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := 1) (b := 12) (v1 := 1) (v2 := 0) (z := 7) (by omega) h1r rfl h (by norm_num) (by norm_num) (by norm_num) (by norm_num) have h7g' : χ 7 ≠ g' := fun h => hno <| hasZSol_combo2 (col := g') (a := 2) (b := 11) (v1 := 6) (v2 := -1) (z := 7) (by omega) h6g' hm1g' h (by norm_num) (by norm_num) (by norm_num) (by norm_num) have h7b' : χ 7 ≠ b' := fun h => hno <| hasZSol_combo4 (col := b') (a := 4) (b := 5) (d := 2) (e := 2) (v1 := 7) (v2 := -6) (v3 := -3) (v4 := -2) (z := -6) (by omega) h hm6b' hm3b' hm2b' hm6b' (by norm_num) (by norm_num) (by norm_num) (by norm_num) (by norm_num) (by norm_num) rcases fin3_exhaust hrb' hrg' hbg' (χ 7) with h | h | h · exact absurd h h7r · exact absurd h h7b' · exact absurd h h7g' · -- `m ≥ 3` (`k ≥ 19`): unique `r0 ∈ {0..6}` with `7 ∣ (2 * k + r0 - 6)` makes `u = k + r0` dead! have hk19 : 19 ≤ k := by omega set r0 : ℕ := (7 - (2 * k - 6) % 7) % 7 have hr0_le : r0 ≤ 6 := by omega set u : ℕ := k + r0 have hdiv7 : (u + k - 6) % 7 = 0 := by omega have hur : χ (u : ℤ) ≠ r := fun h => hno <| hasZSol_combo2 (col := r) (a := u - 6) (b := k - (u - 6)) (v1 := 1) (v2 := 0) (z := (u : ℤ)) (by omega) h1r rfl h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) have hug' : χ (u : ℤ) ≠ g' := fun h => hno <| hasZSol_combo2 (col := g') (a := (u + k - 6) / 7) (b := k - (u + k - 6) / 7) (v1 := 6) (v2 := -1) (z := (u : ℤ)) (by omega) h6g' hm1g' h (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) have hub' : χ (u : ℤ) ≠ b' := fun h => hno <| hasZSol_combo4 (col := b') (a := 3) (b := r0 + 6) (d := 1) (e := k - r0 - 10) (v1 := (u : ℤ)) (v2 := -6) (v3 := -2) (v4 := -3) (z := -2) (by omega) h hm6b' hm2b' hm3b' hm2b' (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (abs_le_of_bounds (by omega) (by omega)) (by omega) rcases fin3_exhaust hrb' hrg' hbg' (χ (u : ℤ)) with h | h | h · exact absurd h hur · exact absurd h hub' · exact absurd h hug' rcases fin3_exhaust hrb hrg hbg (χ (-1)) with hm1r | hm1b | hm1g · exact absurd hm1r hm1_nr · exact hcore g b hrg hrb hbg.symm hm1b · exact hcore b g hrb hrg hbg hm1g /-- **Unified `ℤ`-forcing Theorem for `n = 3` (All `k ≥ 2`, `c ≥ 0`)**. -/ theorem isZRadoFinite_three_of_admissible {k c : ℕ} (hk : 2 ≤ k) (hadm : ∀ d, 1 ≤ d → d ≤ 3 → d ∣ (k - 1) → d ∣ c) : IsZRadoFinite k 3 c := by by_cases hc0 : c = 0 · subst hc0; exact isZRadoFinite_of_dvd hk (dvd_zero _) have hmod : k % 6 = 0 ∨ k % 6 = 1 ∨ k % 6 = 2 ∨ k % 6 = 3 ∨ k % 6 = 4 ∨ k % 6 = 5 := by omega rcases hmod with h0 | h1 | h2 | h3 | h4 | h5 · -- k ≡ 0 (mod 6), k ≥ 6: scale c = 1 simpa using isZRadoFinite_mul_scale (m := c) (isZRadoFinite_three_mod6_0 (by omega) h0) · -- k ≡ 1 (mod 6): 2 ∣ (k - 1) and 3 ∣ (k - 1), so 6 ∣ c have h2c : 2 ∣ c := hadm 2 (by omega) (by omega) (by omega) have h3c : 3 ∣ c := hadm 3 (by omega) (by omega) (by omega) have h6c : 6 ∣ c := by omega by_cases hk7 : k = 7 · subst hk7; exact isZRadoFinite_of_dvd (by omega) h6c · rcases h6c with ⟨q, rfl⟩ have hs := isZRadoFinite_mul_scale (m := q) (isZRadoFinite_three_mod6_1 (by omega) h1) rwa [mul_comm] at hs · -- k ≡ 2 (mod 6): k = 2 ⇒ (k-1) = 1 ∣ c; k ≥ 8 ⇒ scale c = 1 by_cases hk2 : k = 2 · subst hk2; exact isZRadoFinite_of_dvd (by omega) (one_dvd c) · simpa using isZRadoFinite_mul_scale (m := c) (isZRadoFinite_three_mod6_2 (by omega) h2) · -- k ≡ 3 (mod 6): 2 ∣ (k - 1) ⇒ 2 ∣ c; k = 3 ⇒ (k-1) = 2 ∣ c; k ≥ 9 ⇒ scale c = 2 have h2c : 2 ∣ c := hadm 2 (by omega) (by omega) (by omega) by_cases hk3 : k = 3 · subst hk3; exact isZRadoFinite_of_dvd (by omega) h2c · rcases h2c with ⟨q, rfl⟩ have hs := isZRadoFinite_mul_scale (m := q) (isZRadoFinite_three_mod6_3 (by omega) h3) rwa [mul_comm] at hs · -- k ≡ 4 (mod 6): 3 ∣ (k - 1) ⇒ 3 ∣ c; k = 4 ⇒ (k-1) = 3 ∣ c; k ≥ 10 ⇒ scale c = 3 have h3c : 3 ∣ c := hadm 3 (by omega) (by omega) (by omega) by_cases hk4 : k = 4 · subst hk4; exact isZRadoFinite_of_dvd (by omega) h3c · rcases h3c with ⟨q, rfl⟩ have hs := isZRadoFinite_mul_scale (m := q) (isZRadoFinite_three_mod6_4 (by omega) h4) rwa [mul_comm] at hs · -- k ≡ 5 (mod 6): 2 ∣ (k - 1) ⇒ 2 ∣ c; k ≥ 5 ⇒ scale c = 2 have h2c : 2 ∣ c := hadm 2 (by omega) (by omega) (by omega) rcases h2c with ⟨q, rfl⟩ have hs := isZRadoFinite_mul_scale (m := q) (isZRadoFinite_three_mod6_5 (by omega) h5) rwa [mul_comm] at hs /-- **Complete Large-Color Regime (`n ≥ k - 1`)**: for all `k ≥ 2`, `n ≥ k - 1`, `c ≥ 0`, both strong and weak Rado finiteness are equivalent to `(k - 1) ∣ c`. -/ theorem strongRado_finiteness_large_colors_iff {k n c : ℕ} (hk : 2 ≤ k) (hn : k - 1 ≤ n) : IsStrongRadoFinite k n c ↔ (k - 1) ∣ c := by constructor · intro hfin; exact dvd_of_isStrongRadoFinite hk hfin (k - 1) (by omega) hn (dvd_refl _) · intro hdvd exact isStrongRadoFinite_of_isWeakRadoFinite (isWeakRadoFinite_of_dvd hk (by omega) hdvd) theorem weakRado_finiteness_large_colors_iff {k n c : ℕ} (hk : 2 ≤ k) (hn : k - 1 ≤ n) : IsWeakRadoFinite k n c ↔ (k - 1) ∣ c := by constructor · intro hfin; exact dvd_of_isWeakRadoFinite hk hfin (k - 1) (by omega) hn (dvd_refl _) · intro hdvd; exact isWeakRadoFinite_of_dvd hk (by omega) hdvd /-- **MAIN THEOREM 1 — Complete 3-Color Strong Rado Finiteness Theorem (All `k ≥ 2`, `c ≥ 0`)**: Resolving the Adhikari–Boza–Eliahou–Marín–Revuelta–Sanz Finiteness Conjecture completely for `n = 3` across all `k ≥ 2` and `c ≥ 0`. -/ theorem strongRado_finiteness_three_colors_iff {k c : ℕ} (hk : 2 ≤ k) : IsStrongRadoFinite k 3 c ↔ ∀ d, 1 ≤ d → d ≤ 3 → d ∣ (k - 1) → d ∣ c := by constructor · exact dvd_of_isStrongRadoFinite hk · intro hadm exact isStrongRadoFinite_of_isWeakRadoFinite (isWeakRadoFinite_of_isZRadoFinite hk (by omega) (isZRadoFinite_three_of_admissible hk hadm)) /-- **MAIN THEOREM 2 — Complete 3-Color Weak Rado Finiteness Theorem (All `k ≥ 2`, `c ≥ 0`)**: Resolving the Adhikari–Boza–Eliahou–Marín–Revuelta–Sanz Finiteness Conjecture for **weak** (distinct-variable) Rado numbers `WR_k(3, c)` across all `k ≥ 2` and `c ≥ 0`. -/ theorem weakRado_finiteness_three_colors_iff {k c : ℕ} (hk : 2 ≤ k) : IsWeakRadoFinite k 3 c ↔ ∀ d, 1 ≤ d → d ≤ 3 → d ∣ (k - 1) → d ∣ c := by constructor · exact dvd_of_isWeakRadoFinite hk · intro hadm exact isWeakRadoFinite_of_isZRadoFinite hk (by omega) (isZRadoFinite_three_of_admissible hk hadm) /-- **MAIN THEOREM 3 — Strong-Weak Finiteness Equivalence for `n = 2` and `n = 3`**: For all `k ≥ 2` and `c ≥ 0`, `R_k(n, c) < ∞ ↔ WR_k(n, c) < ∞` for `n ∈ {1, 2, 3}`. -/ theorem strong_iff_weak_rado_two_colors {k c : ℕ} (hk : 2 ≤ k) : IsStrongRadoFinite k 2 c ↔ IsWeakRadoFinite k 2 c := (strongRado_finiteness_two_colors_iff hk).trans (weakRado_finiteness_two_colors_iff hk).symm theorem strong_iff_weak_rado_three_colors {k c : ℕ} (hk : 2 ≤ k) : IsStrongRadoFinite k 3 c ↔ IsWeakRadoFinite k 3 c := (strongRado_finiteness_three_colors_iff hk).trans (weakRado_finiteness_three_colors_iff hk).symm /-! ## Section 7: Axiom Audit -/ #print axioms multicolor_ramsey #print axioms exists_mono_distinct_homog_sum #print axioms isWeakRadoFinite_of_isZRadoFinite #print axioms isZRadoFinite_mul_scale #print axioms isZRadoFinite_of_dvd #print axioms isWeakRadoFinite_of_dvd #print axioms dvd_of_isStrongRadoFinite #print axioms strongRado_finiteness_large_colors_iff #print axioms weakRado_finiteness_large_colors_iff #print axioms strongRado_finiteness_two_colors_iff #print axioms weakRado_finiteness_two_colors_iff #print axioms strongRado_finiteness_three_colors_iff #print axioms weakRado_finiteness_three_colors_iff #print axioms strong_iff_weak_rado_two_colors #print axioms strong_iff_weak_rado_three_colors end WeakRadoFiniteness