/-Copyright (c) 2026 Carles MarΓn. All rights reserved.Released under Apache 2.0 license as described in the file LICENSE.Authors: Carles MarΓn, Claude (AI assistant)-//-encaje: formalizaciΓ³n de apoyo del Paper III; usa la puerta Excovery y el nΓΊcleo AngularPeaks, no es una herramienta nueva.-/module public import Formalizations.Combinatorics.Caballero.AngularPeakspublic import Std.Data.TreeSet.Lemmas /-!# Exact angular profile: algebraic bridge This file formalizes the deduction from the three-step law and threerepresentative sections to the finite-b profile. The geometricthree-step law and the three direct section identities are explicithypotheses here. They are not yet formalized.-/ /-!## References * C. MarΓn, Exact angular ambiguity profile for Dyck words of divisors (Part III), Zenodo (2026), doi:10.5281/zenodo.24699411.* C. MarΓn, How Many Dyck Words Do the Divisors of an Integer Make? Exact Counts and Quasipolynomial Growth (Part I), Zenodo (2026), doi:10.5281/zenodo.24536372 (concept DOI).-/ @[expose] public section namespace CaballeroExact open CaballeroPeaks /-- Coordinatewise translation of a cell vector. -/def shiftWord (w : Palabra) (t : β€) : Palabra := match w with | (a, b, c, d, e) => (a + t, b + t, c + t, d + t, e + t) /-- The upper clipping commutes with the three-unit translationprovided lower clipping is absent. -/theorem clip_shift (b v : β€) (hv : -b - 1 β€ v) : clip (b + 3) (v + 3) = clip b v + 3 := by unfold clip omega /-- Away from either clipping boundary, translations by 0, 1 or 2also commute with the change b β¦ b+3. -/theorem clip_shift_unclipped (b v t : β€) (ht0 : 0 β€ t) (ht3 : t β€ 3) (hl : -b - 1 β€ v) (hu : v β€ b) : clip (b + 3) (v + t) = clip b v + t := by unfold clip omega /-- Clipping to the cell range cannot increase the span of twoordered integer coordinates. -/theorem clip_span_le (b u v : β€) (hb : 0 β€ b) (huv : u β€ v) : clip b v - clip b u β€ v - u := by unfold clip omega /-- The span of the five-coordinate section vector is at most4ΞΈ+1, including where coordinates are clipped. -/theorem section_span_le (b : β€) (ΞΈ Ξ : β) (hb : 0 β€ b) (hΞΈ : 0 β€ ΞΈ) : ((clip b βΞ + 2 * ΞΈβ - clip b βΞ - 2 * ΞΈβ : β€) : β) β€ 4 * ΞΈ + 1 := by have hu : βΞ - 2 * ΞΈβ β€ βΞ + 2 * ΞΈβ := by apply Int.floor_le_floor linarith have hc := clip_span_le b βΞ - 2 * ΞΈβ βΞ + 2 * ΞΈβ hb hu have hc' : ((clip b βΞ + 2 * ΞΈβ - clip b βΞ - 2 * ΞΈβ : β€) : β) β€ ((βΞ + 2 * ΞΈβ - βΞ - 2 * ΞΈβ : β€) : β) := by exact_mod_cast hc have hupper := Int.floor_le (Ξ + 2 * ΞΈ) have hlower := Int.lt_floor_add_one (Ξ - 2 * ΞΈ) push_cast at hc' β’ linarith /-- The five-coordinate section vector from Part III. -/noncomputable def sectionWord (b : β€) (ΞΈ Ξ : β) : Palabra := (clip b βΞ - 2 * ΞΈβ, clip b βΞ - ΞΈβ, clip b βΞβ, clip b βΞ + ΞΈβ, clip b βΞ + 2 * ΞΈβ) /-- The geometric shift of a section vector in the upper region.The five explicit lower-bound hypotheses state exactly where lowerclipping is absent. -/theorem sectionWord_shift_three (b : β€) (ΞΈ Ξ : β) (h0 : -b - 1 β€ βΞ - 2 * ΞΈβ) (h1 : -b - 1 β€ βΞ - ΞΈβ) (h2 : -b - 1 β€ βΞβ) (h3 : -b - 1 β€ βΞ + ΞΈβ) (h4 : -b - 1 β€ βΞ + 2 * ΞΈβ) : sectionWord (b + 3) ΞΈ (Ξ + 3) = shiftWord (sectionWord b ΞΈ Ξ) 3 := by simp only [sectionWord, shiftWord, Prod.mk.injEq] have e0 : β(Ξ + 3) - 2 * ΞΈβ = βΞ - 2 * ΞΈβ + 3 := by convert Int.floor_add_intCast (Ξ - 2 * ΞΈ) 3 using 1 ring_nf have e1 : β(Ξ + 3) - ΞΈβ = βΞ - ΞΈβ + 3 := by convert Int.floor_add_intCast (Ξ - ΞΈ) 3 using 1 ring_nf have e2 : βΞ + 3β = βΞβ + 3 := by exact Int.floor_add_intCast Ξ 3 have e3 : β(Ξ + 3) + ΞΈβ = βΞ + ΞΈβ + 3 := by convert Int.floor_add_intCast (Ξ + ΞΈ) 3 using 1 ring_nf have e4 : β(Ξ + 3) + 2 * ΞΈβ = βΞ + 2 * ΞΈβ + 3 := by convert Int.floor_add_intCast (Ξ + 2 * ΞΈ) 3 using 1 ring_nf rw [e0, e1, e2, e3, e4, clip_shift b _ h0, clip_shift b _ h1, clip_shift b _ h2, clip_shift b _ h3, clip_shift b _ h4] simp /-- Geometric shift for a unit whose five raw floor coordinatesare all inside the clipping range. This is the common part of R0,R1 and R2; their different values of t are passed as an argument. -/theorem sectionWord_shift_unclipped (b t : β€) (ΞΈ Ξ : β) (ht0 : 0 β€ t) (ht3 : t β€ 3) (h0 : -b - 1 β€ βΞ - 2 * ΞΈβ β§ βΞ - 2 * ΞΈβ β€ b) (h1 : -b - 1 β€ βΞ - ΞΈβ β§ βΞ - ΞΈβ β€ b) (h2 : -b - 1 β€ βΞβ β§ βΞβ β€ b) (h3 : -b - 1 β€ βΞ + ΞΈβ β§ βΞ + ΞΈβ β€ b) (h4 : -b - 1 β€ βΞ + 2 * ΞΈβ β§ βΞ + 2 * ΞΈβ β€ b) : sectionWord (b + 3) ΞΈ (Ξ + t) = shiftWord (sectionWord b ΞΈ Ξ) t := by simp only [sectionWord, shiftWord, Prod.mk.injEq] have e0 : β(Ξ + t) - 2 * ΞΈβ = βΞ - 2 * ΞΈβ + t := by convert Int.floor_add_intCast (Ξ - 2 * ΞΈ) t using 1 ring_nf have e1 : β(Ξ + t) - ΞΈβ = βΞ - ΞΈβ + t := by convert Int.floor_add_intCast (Ξ - ΞΈ) t using 1 ring_nf have e2 : βΞ + tβ = βΞβ + t := Int.floor_add_intCast Ξ t have e3 : β(Ξ + t) + ΞΈβ = βΞ + ΞΈβ + t := by convert Int.floor_add_intCast (Ξ + ΞΈ) t using 1 ring_nf have e4 : β(Ξ + t) + 2 * ΞΈβ = βΞ + 2 * ΞΈβ + t := by convert Int.floor_add_intCast (Ξ + 2 * ΞΈ) t using 1 ring_nf rw [e0, e1, e2, e3, e4, clip_shift_unclipped b _ t ht0 ht3 h0.1 h0.2, clip_shift_unclipped b _ t ht0 ht3 h1.1 h1.2, clip_shift_unclipped b _ t ht0 ht3 h2.1 h2.2, clip_shift_unclipped b _ t ht0 ht3 h3.1 h3.2, clip_shift_unclipped b _ t ht0 ht3 h4.1 h4.2] simp /-- The generic O1 family commutes with the three-step translationon the nonnegative parameter range relevant to R3. -/theorem O1_shift (b s : β€) (hb : 1 β€ b) (hs : 0 β€ s) : O1 (b + 3) (s + 9) = shiftWord (O1 b s) 3 := by simp only [O1, shiftWord, Prod.mk.injEq] simp only [clip] omega /-- The generic G family has the same translation law. -/theorem G_shift (b s : β€) (hb : 1 β€ b) (hs : 0 β€ s) : G (b + 3) (s + 9) = shiftWord (G b s) 3 := by simp only [G, shiftWord, Prod.mk.injEq] simp only [clip] omega /-- First vector in the D family of Part I. -/def D1 (b i e : β€) : Palabra := (b - 6 - 3 * i, b - 4 - 2 * i + e, b - 1 - i, b, b) /-- Second vector in the D family of Part I. -/def D2 (b i e : β€) : Palabra := (b - 5 - 3 * i, b - 4 - 2 * i + e, b - 2 - i, b, b) def E1 (b i : β€) : Palabra := (b - 6 - 2 * i, b - 2 - i, b, b, b) def E2 (b i : β€) : Palabra := (b - 5 - 2 * i, b - 3 - i, b, b, b) def F1 (b x : β€) : Palabra := (x, b - 1, b, b, b) def F3 (b : β€) : Palabra := (b - 3, b - 2, b, b, b) /-- Every non-G D, E and F vector translates as stated in theregion-by-region proof. -/theorem DE_shift (b i e : β€) : D1 (b + 3) i e = shiftWord (D1 b i e) 3 β§ D2 (b + 3) i e = shiftWord (D2 b i e) 3 β§ E1 (b + 3) i = shiftWord (E1 b i) 3 β§ E2 (b + 3) i = shiftWord (E2 b i) 3 := by simp only [D1, D2, E1, E2, shiftWord, Prod.mk.injEq] simp; omega theorem F_shift (b x : β€) : F1 (b + 3) (x + 3) = shiftWord (F1 b x) 3 β§ F3 (b + 3) = shiftWord (F3 b) 3 := by simp only [F1, F3, shiftWord, Prod.mk.injEq] simp; omega /-- New D indices after b β¦ b+3 are too wide to occur in asection of slope ΞΈ once b > 4ΞΈ+1. -/theorem D_new_span (b i : β€) (hold : b - 5 < 3 * i) : b + 3 - (b + 3 - 6 - 3 * i) β₯ b + 1 := by omega theorem E_new_span (b i : β€) (hold : b - 5 < 2 * i) : b + 3 - (b + 3 - 6 - 2 * i) β₯ b + 2 := by omega theorem F_new_span (b x : β€) (hx : -1 β€ x) (hx1 : x β€ 1) : b + 3 - x β₯ b + 2 := by omega /-- A realised O2 on the upper branch is unclipped at the firstcoordinate and clipped above in the other four. -/theorem O2_upper_form (b s : β€) (hb : 1 β€ b) (hs0 : 2 * b + 1 β€ s) (hs1 : s β€ 3 * b) : O2 b s = (s - 2 * b - 2, b, b, b, b) := by simp only [O2, clip, Prod.mk.injEq] omega /-- O2 upper-branch translation, including clipping. -/theorem O2_shift (b s : β€) (hb : 1 β€ b) (hs0 : 2 * b + 1 β€ s) (hs1 : s β€ 3 * b) : O2 (b + 3) (s + 9) = shiftWord (O2 b s) 3 := by rw [O2_upper_form b s hb hs0 hs1] rw [O2_upper_form (b + 3) (s + 9) (by omega) (by omega) (by omega)] simp only [shiftWord, Prod.mk.injEq] simp; omega /-- The integer residue coefficient in the proposed exact profile. -/def epsilon (r : β) : β := if r = 0 then 0 else if r = 1 then 1 else 5 /-- The limiting profile of Part III, on positive slopes. -/noncomputable def F2 (ΞΈ : β) : β := if ΞΈ β€ 1 / 4 then 2 * ΞΈ else if ΞΈ β€ 1 / 3 then 6 * ΞΈ - 1 else if ΞΈ β€ 1 / 2 then 3 - 6 * ΞΈ else if ΞΈ β€ 2 / 3 then 2 * ΞΈ - 1 else if ΞΈ β€ 3 / 4 then 5 / 3 - 2 * ΞΈ else if ΞΈ β€ 1 then (2 / 3) * (1 - ΞΈ) else 0 /-- Boundary correction of Part III, restricted to 0 < ΞΈ β€ 1. -/noncomputable def kappa (ΞΈ : β) : β := if ΞΈ β€ 1 / 3 then ΞΈ else if ΞΈ β€ 1 / 2 then 4 * ΞΈ - 1 else if ΞΈ β€ 3 / 4 then 1 else 4 * (1 - ΞΈ) /-- Residue correction of Part III, restricted to 0 < ΞΈ β€ 1. -/noncomputable def delta (ΞΈ : β) : β := if ΞΈ β€ 2 / 3 then 0 else if ΞΈ β€ 3 / 4 then 3 * ΞΈ - 2 else 1 - ΞΈ /-- On the stated domain the residue correction has exactly thesupport asserted in the paper. -/theorem delta_pos_iff (ΞΈ : β) : 0 < delta ΞΈ β 2 / 3 < ΞΈ β§ ΞΈ < 1 := by unfold delta split_ifs <;> constructor Β· intro h constructor <;> linarith Β· rintro β¨h0, h1β© linarith Β· intro h constructor <;> linarith Β· rintro β¨h0, h1β© linarith Β· intro h constructor <;> linarith Β· rintro β¨h0, h1β© linarith /-- The explicit functions reproduce the independently formalizedpeak lengths and vanish on the diagonal correction. -/theorem control_peak_values : F2 (1 / 3) = 1 β§ F2 (2 / 3) = 1 / 3 β§ kappa (1 / 3) = 1 / 3 β§ kappa (2 / 3) = 1 β§ delta (1 / 3) = 0 β§ delta (2 / 3) = 0 β§ F2 1 = 0 β§ kappa 1 = 0 := by norm_num [F2, kappa, delta] /-- A sequence constant under shifts by three is constant on eachresidue class above its lower bound. -/theorem stable_residue (f : β β β) (N n m : β) (hstep : β k, N β€ k β f (k + 3) = f k) (hn : N β€ n) (hm : N β€ m) (hmod : n % 3 = m % 3) : f n = f m := by have aux : β k, N β€ k β f k = f (N + (k - N) % 3) := by intro k induction k using Nat.strong_induction_on with | h k ih => intro hk by_cases hsmall : k < N + 3 Β· have heq : k = N + (k - N) % 3 := by omega conv_lhs => rw [heq] Β· have hprev : N β€ k - 3 := by omega have hlt : k - 3 < k := by omega have heq : k - 3 + 3 = k := by omega have hrem : (k - 3 - N) % 3 = (k - N) % 3 := by omega calc f k = f ((k - 3) + 3) := by congr 1; omega _ = f (k - 3) := hstep (k - 3) hprev _ = f (N + (k - 3 - N) % 3) := ih (k - 3) hlt hprev _ = f (N + (k - N) % 3) := by rw [hrem] have hrem : (n - N) % 3 = (m - N) % 3 := by omega rw [aux n hn, aux m hm, hrem] /-- Once the exact three-step law and one base section in eachresidue are known, every section above the threshold has theclaimed profile. This is a conditional algebraic bridge. -/theorem profile_from_three_bases (L : β β β) (N b : β) (F ΞΊ Ξ΄ : β) (hN : N β€ 30) (hstep : β k, N β€ k β L (k + 3) - L k = 3 * F) (hbase : β r : β, r < 3 β L (30 + r) - ((30 + r : β) : β) * F = ΞΊ + epsilon r / 3 * Ξ΄) (hb : N β€ b) : L b = (b : β) * F + ΞΊ + epsilon (b % 3) / 3 * Ξ΄ := by let f : β β β := fun k => L k - (k : β) * F have hf : β k, N β€ k β f (k + 3) = f k := by intro k hk dsimp [f] have hs := hstep k hk push_cast linarith let r := b % 3 have hr : r < 3 := Nat.mod_lt _ (by decide) have hbaseN : N β€ 30 + r := by omega have hmod : b % 3 = (30 + r) % 3 := by dsimp [r] omega have hsame := stable_residue f N b (30 + r) hf hb hbaseN hmod have hbr := hbase r hr dsimp [f] at hsame dsimp [r] at hbr β’ linarith /-- The exact profile formula, conditional on the geometricthree-step law and the three direct finite-section identities.The named hypotheses are still being formalized. -/theorem exact_profile_conditional (L : β β β β β) (ΞΈ : β) (N b : β) (_hΞΈ : 0 < ΞΈ) (_hΞΈ1 : ΞΈ β€ 1) (hN : N β€ 30) (hstep : β k, N β€ k β L (k + 3) ΞΈ - L k ΞΈ = 3 * F2 ΞΈ) (hbase : β r : β, r < 3 β L (30 + r) ΞΈ - ((30 + r : β) : β) * F2 ΞΈ = kappa ΞΈ + epsilon r / 3 * delta ΞΈ) (hb : N β€ b) : L b ΞΈ = (b : β) * F2 ΞΈ + kappa ΞΈ + epsilon (b % 3) / 3 * delta ΞΈ := by exact profile_from_three_bases (fun k => L k ΞΈ) N b (F2 ΞΈ) (kappa ΞΈ) (delta ΞΈ) hN hstep hbase hb /-! ### BASE_54: the 54 finite-section identities (Theorem `thm:exact`, b = 30, 31, 32) The classification of Part I enters as the named hypothesis `hcl` of `base_54`, as in`CaballeroPeaks.picos_condicional`. -/ section BaseKappa open MeasureTheory /-- Word of the cell at `(Ξ, ΞΈ)`: `c_h = clip βΞ + hΞΈβ`, `h = -2, β¦, 2`. -/noncomputable def cellWord (b : β€) (Ξ ΞΈ : β) : Palabra := (clip b βΞ + ((-2 : β€) : β) * ΞΈβ, clip b βΞ + ((-1 : β€) : β) * ΞΈβ, clip b βΞ + ((0 : β€) : β) * ΞΈβ, clip b βΞ + ((1 : β€) : β) * ΞΈβ, clip b βΞ + ((2 : β€) : β) * ΞΈβ) /-- Integer cell word on the grid `ΞΈ = p/q`, `Ξ β (m/q, (m+1)/q)`. -/def zWord (b : β€) (p q m : β€) : Palabra := (clip b ((m + (-2) * p) / q), clip b ((m + (-1) * p) / q), clip b ((m + 0 * p) / q), clip b ((m + 1 * p) / q), clip b ((m + 2 * p) / q)) theorem floor_cell (p q : β) (hq : 0 < q) (m h : β€) (Ξ : β) (h0 : (m : β) / q < Ξ) (h1 : Ξ < ((m : β) + 1) / q) : βΞ + (h : β) * ((p : β) / q)β = (m + h * p) / (q : β€) := by have hqpos : (0 : β) < q := by exact_mod_cast hq have hqz : (0 : β€) < q := by exact_mod_cast hq have e1 : (m : β) < Ξ * q := by have := (div_lt_iffβ hqpos).mp h0 linarith have e2 : Ξ * q < (m : β) + 1 := (lt_div_iffβ hqpos).mp h1 set z : β€ := (m + h * p) / (q : β€) with hz have hz1 : z * (q : β€) β€ m + h * p := by rw [hz]; exact Int.ediv_mul_le _ (by omega) have hz2 : m + h * p < (z + 1) * (q : β€) := by rw [hz] exact Int.lt_ediv_add_one_mul_self _ hqz have hz1' : (z : β) * q β€ (m : β) + h * p := by exact_mod_cast hz1 have hz2'' : m + h * p + 1 β€ (z + 1) * (q : β€) := Int.add_one_le_of_lt hz2 have hz2' : (m : β) + h * p + 1 β€ ((z : β) + 1) * q := by exact_mod_cast hz2'' have eq : Ξ + (h : β) * ((p : β) / q) = (Ξ * q + h * p) / q := by field_simp rw [Int.floor_eq_iff, eq, le_div_iffβ hqpos, div_lt_iffβ hqpos] constructor <;> nlinarith theorem cellWord_cell (b : β€) (p q : β) (hq : 0 < q) (m : β€) (Ξ : β) (h0 : (m : β) / q < Ξ) (h1 : Ξ < ((m : β) + 1) / q) : cellWord b Ξ ((p : β) / q) = zWord b p q m := by unfold cellWord zWord rw [floor_cell p q hq m (-2) Ξ h0 h1, floor_cell p q hq m (-1) Ξ h0 h1, floor_cell p q hq m 0 Ξ h0 h1, floor_cell p q hq m 1 Ξ h0 h1, floor_cell p q hq m 2 Ξ h0 h1] /-- Section `ΞΈ = p/q` of the ambiguous set: its measure is the number of marked unit cells over `q`. -/theorem section_volume (b p q : β) (hq : 0 < q) (R : Palabra β Bool) : volume {Ξ : β | 0 β€ Ξ β§ Ξ β€ (b : β) + 2 * ((p : β) / q) β§ R (cellWord b Ξ ((p : β) / q)) = true} = (((Finset.range (b * q + 2 * p)).filter (fun m : β => R (zWord b p q m) = true)).card : ENNReal) * ENNReal.ofReal (1 / (q : β)) := by have hqpos : (0 : β) < q := by exact_mod_cast hq set M : β := b * q + 2 * p with hM set I : Finset β := (Finset.range M).filter (fun m : β => R (zWord b p q m) = true) with hI set s : Set β := {Ξ : β | 0 β€ Ξ β§ Ξ β€ (b : β) + 2 * ((p : β) / q) β§ R (cellWord b Ξ ((p : β) / q)) = true} with hs set U : Set β := β m β I, Set.Ioo ((m : β) / q) (((m : β) + 1) / q) with hU set E : Set β := (fun m : β => (m : β) / q) '' (Finset.range (M + 1) : Set β) with hE have hMq : ((M : β) : β) / q = (b : β) + 2 * ((p : β) / q) := by rw [hM]; push_cast; field_simp have hUvol : volume U = (I.card : ENNReal) * ENNReal.ofReal (1 / (q : β)) := by rw [hU, measure_biUnion_finset] Β· rw [Finset.sum_congr rfl (g := fun _ => ENNReal.ofReal (1 / (q : β)))] Β· simp Β· intro m _ rw [Real.volume_Ioo] congr 1 field_simp ring Β· intro m _ m' _ hne simp only [Function.onFun] rw [Set.Ioo_disjoint_Ioo] rcases lt_or_gt_of_ne hne with hlt | hlt Β· have : (m : β) + 1 β€ m' := by exact_mod_cast hlt have h2 : ((m : β) + 1) / q β€ (m' : β) / q := by gcongr exact le_trans (min_le_left _ _) (le_trans h2 (le_max_right _ _)) Β· have : (m' : β) + 1 β€ m := by exact_mod_cast hlt have h2 : ((m' : β) + 1) / q β€ (m : β) / q := by gcongr exact le_trans (min_le_right _ _) (le_trans h2 (le_max_left _ _)) Β· intro m _ exact measurableSet_Ioo have hUs : U β s := by intro Ξ hΞ simp only [hU, Set.mem_iUnion] at hΞ obtain β¨m, hm, h0, h1β© := hΞ have hmI := Finset.mem_filter.mp hm have hmM : m < M := Finset.mem_range.mp hmI.1 have hmM' : (m : β) + 1 β€ M := by exact_mod_cast hmM refine β¨?_, ?_, ?_β© Β· have : (0 : β) β€ (m : β) / q := by positivity linarith Β· rw [β hMq] have : ((m : β) + 1) / q β€ (M : β) / q := by gcongr linarith Β· have := cellWord_cell (b : β€) p q hq (m : β€) Ξ (by rw [Int.cast_natCast]; exact h0) (by rw [Int.cast_natCast]; exact h1) rw [this] exact hmI.2 have hsU : s β U βͺ E := by intro Ξ hΞ obtain β¨hΞ0, hΞ1, hΞ2β© := hΞ have hLq0 : 0 β€ Ξ * q := by positivity have hLq1 : Ξ * q β€ M := by rw [β hMq] at hΞ1 have := (le_div_iffβ hqpos).mp hΞ1 exact this set m : β := βΞ * qββ with hm have hm1 : (m : β) β€ Ξ * q := Nat.floor_le hLq0 have hm2 : Ξ * q < (m : β) + 1 := Nat.lt_floor_add_one _ by_cases heq : (m : β) = Ξ * q Β· right refine β¨m, ?_, ?_β© Β· rw [Finset.mem_coe, Finset.mem_range] have : (m : β) β€ M := by linarith have : m β€ M := by exact_mod_cast this omega Β· simp only rw [heq]; field_simp Β· left have hlt : (m : β) < Ξ * q := lt_of_le_of_ne hm1 heq simp only [hU, Set.mem_iUnion] have hmM : m < M := by have : (m : β) < M := lt_of_lt_of_le hlt hLq1 exact_mod_cast this have h0 : (m : β) / q < Ξ := by rw [div_lt_iffβ hqpos]; linarith have h1 : Ξ < ((m : β) + 1) / q := by rw [lt_div_iffβ hqpos]; linarith refine β¨m, ?_, h0, h1β© rw [hI, Finset.mem_filter, Finset.mem_range] refine β¨hmM, ?_β© have := cellWord_cell (b : β€) p q hq (m : β€) Ξ (by rw [Int.cast_natCast]; exact h0) (by rw [Int.cast_natCast]; exact h1) rw [this] at hΞ2 exact hΞ2 have hE0 : volume E = 0 := by apply Set.Finite.measure_zero exact (Finset.finite_toSet _).image _ apply le_antisymm Β· calc volume s β€ volume (U βͺ E) := measure_mono hsU _ β€ volume U + volume E := measure_union_le _ _ _ = volume U := by rw [hE0, add_zero] _ = _ := hUvol Β· rw [β hUvol] exact measure_mono hUs /-- Integer interval `lo, lo+1, β¦, lo+n-1`. -/def irange (lo : β€) (n : β) : List β€ := (List.range n).map (fun i : β => lo + (i : β€)) theorem mem_irange {lo : β€} {n : β} {x : β€} : x β irange lo n β lo β€ x β§ x < lo + n := by unfold irange rw [List.mem_map] constructor Β· rintro β¨a, ha, rflβ© rw [List.mem_range] at ha omega Β· intro h exact β¨(x - lo).toNat, List.mem_range.mpr (by omega), by omegaβ© def wl1 (b : β€) : List Palabra := (irange 0 (b.toNat + 1)).flatMap (fun m1 => [(-(min b (2 * m1)) - 1, -(min b m1) - 1, 0, min b m1, min b (2 * m1)), (-(min b (2 * m1 + 1)) - 1, -(min b m1) - 1, 0, min b m1, min b (2 * m1 + 1))]) def wl2 (b : β€) : List Palabra := (irange 1 (3 * b).toNat).flatMap (fun s => if O1 b s β O2 b s then [O1 b s, O2 b s] else []) def wl3 (b : β€) : List Palabra := (irange 1 (b / 2).toNat).flatMap (fun k => [(-2 * k - 1, -k, 0, k, 2 * k), (-2 * k, -k, 0, k, 2 * k - 1)]) def wl4 (b : β€) : List Palabra := if 1 β€ (b - 2) / 3 β§ b = 3 * ((b - 2) / 3) + 2 then [(-((b - 2) / 3) - 2, -1, (b - 2) / 3, 2 * ((b - 2) / 3) + 2, b), (-((b - 2) / 3) - 1, -1, (b - 2) / 3, 2 * ((b - 2) / 3) + 1, b), (-((b - 2) / 3) - 2, -1, (b - 2) / 3 + 1, 2 * ((b - 2) / 3) + 2, b), (-((b - 2) / 3) - 1, 0, (b - 2) / 3, 2 * ((b - 2) / 3) + 1, b), (-((b - 2) / 3) - 2, 0, (b - 2) / 3 + 1, 2 * ((b - 2) / 3) + 2, b), (-((b - 2) / 3) - 1, 0, (b - 2) / 3 + 1, 2 * ((b - 2) / 3) + 1, b)] else [] def wl5 (b : β€) : List Palabra := [(-b, -1, b - 1, b, b), G b b, (-b, 0, b - 1, b, b), G b (b + 1)] def wl6 (b : β€) : List Palabra := (irange 0 ((b - 5) / 3 + 1).toNat).flatMap (fun i => (irange 0 2).flatMap (fun e => [(b - 6 - 3 * i, b - 4 - 2 * i + e, b - 1 - i, b, b), (b - 5 - 3 * i, b - 4 - 2 * i + e, b - 2 - i, b, b)])) def wl7 (b : β€) : List Palabra := (irange 0 ((b - 5) / 2 + 1).toNat).flatMap (fun i => [(b - 6 - 2 * i, b - 2 - i, b, b, b), (b - 5 - 2 * i, b - 3 - i, b, b, b)]) def wl8 (b : β€) : List Palabra := (irange (-1) (b - 1).toNat).flatMap (fun x => [(x, b - 1, b, b, b), G b (2 * b + 2 + x)] ++ (if x = b - 4 then [(b - 3, b - 2, b, b, b)] else [])) /-- The list of words of Lemma 9.3 of Part I (`enLista`), as an explicit finite list. -/def wlist (b : β€) : List Palabra := wl1 b ++ wl2 b ++ wl3 b ++ wl4 b ++ wl5 b ++ wl6 b ++ wl7 b ++ wl8 b theorem fam1 (b : β€) (hb : 0 β€ b) (w : Palabra) : (β m1 m2 : Int, 0 β€ m1 β§ (m2 = 2 * m1 β¨ m2 = 2 * m1 + 1) β§ w = (-(min b m2) - 1, -(min b m1) - 1, 0, min b m1, min b m2)) β w β wl1 b := by simp only [wl1, List.mem_flatMap, mem_irange, List.mem_cons, List.not_mem_nil, or_false] constructor Β· rintro β¨m1, m2, h0, h2, hwβ© refine β¨min m1 b, β¨by omega, by omegaβ©, ?_β© rcases h2 with h2 | h2 <;> subst h2 <;> subst hw Β· left; simp only [Prod.mk.injEq, true_and]; omega Β· right; simp only [Prod.mk.injEq, true_and]; omega Β· rintro β¨a, β¨ha0, ha1β©, hβ© rcases h with h | h Β· exact β¨a, 2 * a, ha0, Or.inl rfl, hβ© Β· exact β¨a, 2 * a + 1, ha0, Or.inr rfl, hβ© theorem fam2 (b : β€) (hb : 0 β€ b) (w : Palabra) : (β s : Int, 1 β€ s β§ s β€ 3 * b β§ O1 b s β O2 b s β§ (w = O1 b s β¨ w = O2 b s)) β w β wl2 b := by simp only [wl2, List.mem_flatMap, mem_irange] constructor Β· rintro β¨s, h1, h2, h3, h4β© refine β¨s, β¨h1, by omegaβ©, ?_β© rw [ite_eq_left h3] simpa using h4 Β· rintro β¨s, β¨h1, h2β©, hβ© by_cases hne : O1 b s β O2 b s Β· rw [ite_eq_left hne] at h exact β¨s, h1, by omega, hne, by simpa using hβ© Β· rw [ite_eq_right hne] at h simp at h theorem fam3 (b : β€) (_hb : 0 β€ b) (w : Palabra) : (β k : Int, 1 β€ k β§ 2 * k β€ b β§ (w = (-2 * k - 1, -k, 0, k, 2 * k) β¨ w = (-2 * k, -k, 0, k, 2 * k - 1))) β w β wl3 b := by simp only [wl3, List.mem_flatMap, mem_irange, List.mem_cons, List.not_mem_nil, or_false] constructor Β· rintro β¨k, h1, h2, h3β© exact β¨k, β¨h1, by omegaβ©, h3β© Β· rintro β¨k, β¨h1, h2β©, h3β© exact β¨k, h1, by omega, h3β© theorem fam4 (b : β€) (w : Palabra) : (β v : Int, 1 β€ v β§ b = 3 * v + 2 β§ (w = (-v - 2, -1, v, 2 * v + 2, b) β¨ w = (-v - 1, -1, v, 2 * v + 1, b) β¨ w = (-v - 2, -1, v + 1, 2 * v + 2, b) β¨ w = (-v - 1, 0, v, 2 * v + 1, b) β¨ w = (-v - 2, 0, v + 1, 2 * v + 2, b) β¨ w = (-v - 1, 0, v + 1, 2 * v + 1, b))) β w β wl4 b := by unfold wl4 constructor Β· rintro β¨v, h1, h2, h3β© have hv : (b - 2) / 3 = v := by omega rw [ite_eq_left β¨by omega, by omegaβ©, hv] simpa [List.mem_cons] using h3 Β· intro h by_cases hc : 1 β€ (b - 2) / 3 β§ b = 3 * ((b - 2) / 3) + 2 Β· rw [ite_eq_left hc] at h refine β¨(b - 2) / 3, hc.1, hc.2, ?_β© simpa [List.mem_cons] using h Β· rw [ite_eq_right hc] at h simp at h theorem fam5 (b : β€) (w : Palabra) : (w = (-b, -1, b - 1, b, b) β¨ w = G b b β¨ w = (-b, 0, b - 1, b, b) β¨ w = G b (b + 1)) β w β wl5 b := by simp [wl5, List.mem_cons] theorem fam6 (b : β€) (_hb : 5 β€ b) (w : Palabra) : (β i e : Int, 0 β€ i β§ 3 * i β€ b - 5 β§ 0 β€ e β§ e β€ 1 β§ (w = (b - 6 - 3 * i, b - 4 - 2 * i + e, b - 1 - i, b, b) β¨ w = (b - 5 - 3 * i, b - 4 - 2 * i + e, b - 2 - i, b, b))) β w β wl6 b := by simp only [wl6, List.mem_flatMap, mem_irange, List.mem_cons, List.not_mem_nil, or_false] constructor Β· rintro β¨i, e, h1, h2, h3, h4, h5β© exact β¨i, β¨h1, by omegaβ©, e, β¨h3, by omegaβ©, h5β© Β· rintro β¨i, β¨h1, h2β©, e, β¨h3, h4β©, h5β© exact β¨i, e, h1, by omega, h3, by omega, h5β© theorem fam7 (b : β€) (_hb : 5 β€ b) (w : Palabra) : (β i : Int, 0 β€ i β§ 2 * i β€ b - 5 β§ (w = (b - 6 - 2 * i, b - 2 - i, b, b, b) β¨ w = (b - 5 - 2 * i, b - 3 - i, b, b, b))) β w β wl7 b := by simp only [wl7, List.mem_flatMap, mem_irange, List.mem_cons, List.not_mem_nil, or_false] constructor Β· rintro β¨i, h1, h2, h3β© exact β¨i, β¨h1, by omegaβ©, h3β© Β· rintro β¨i, β¨h1, h2β©, h3β© exact β¨i, h1, by omega, h3β© theorem fam8 (b : β€) (hb : 5 β€ b) (w : Palabra) : (β x : Int, -1 β€ x β§ x β€ b - 3 β§ (w = (x, b - 1, b, b, b) β¨ w = G b (2 * b + 2 + x) β¨ (x = b - 4 β§ w = (b - 3, b - 2, b, b, b)))) β w β wl8 b := by simp only [wl8, List.mem_flatMap, mem_irange, List.mem_append, List.mem_cons, List.not_mem_nil, or_false] constructor Β· rintro β¨x, h1, h2, h3β© refine β¨x, β¨h1, by omegaβ©, ?_β© rcases h3 with h3 | h3 | β¨h3, h4β© Β· exact Or.inl (Or.inl h3) Β· exact Or.inl (Or.inr h3) Β· right rw [ite_eq_left h3] simpa using h4 Β· rintro β¨x, β¨h1, h2β©, h3β© refine β¨x, h1, by omega, ?_β© rcases h3 with (h3 | h3) | h3 Β· exact Or.inl h3 Β· exact Or.inr (Or.inl h3) Β· by_cases hx : x = b - 4 Β· rw [ite_eq_left hx] at h3 exact Or.inr (Or.inr β¨hx, by simpa using h3β©) Β· rw [ite_eq_right hx] at h3 simp at h3 theorem enLista_iff_wlist (b : β€) (hb : 5 β€ b) (w : Palabra) : enLista b w β w β wlist b := by unfold enLista wlist rw [fam1 b (by omega), fam2 b (by omega), fam3 b (by omega), fam4, fam5, fam6 b hb, fam7 b hb, fam8 b hb] simp only [List.mem_append] tauto /-- Injective numeric code of a word whose coordinates lie in `[-64, 63]`. -/def wcode (w : Palabra) : β := ((((w.1 + 64).toNat * 128 + (w.2.1 + 64).toNat) * 128 + (w.2.2.1 + 64).toNat) * 128 + (w.2.2.2.1 + 64).toNat) * 128 + (w.2.2.2.2 + 64).toNat /-- The coordinates of a word lie in `[-64, 63]`. -/abbrev inR (w : Palabra) : Prop := -64 β€ w.1 β§ w.1 < 64 β§ -64 β€ w.2.1 β§ w.2.1 < 64 β§ -64 β€ w.2.2.1 β§ w.2.2.1 < 64 β§ -64 β€ w.2.2.2.1 β§ w.2.2.2.1 < 64 β§ -64 β€ w.2.2.2.2 β§ w.2.2.2.2 < 64 theorem wcode_inj (w w' : Palabra) (h : inR w) (h' : inR w') (e : wcode w = wcode w') : w = w' := by obtain β¨a, b, c, d, fβ© := w obtain β¨a', b', c', d', f'β© := w' simp only [inR, wcode] at h h' e simp only [Prod.mk.injEq] omega /-- Lookup table of the classification list, by numeric code. -/def cset (b : β€) : Std.TreeSet β compare := Std.TreeSet.ofList ((wlist b).map wcode) compare /-- Decidable membership in the classification list (through the table). -/def inTab (b : β€) (w : Palabra) : Bool := (cset b).contains (wcode w) theorem inTab_iff (b : β€) (hb : 5 β€ b) (hr : β w β wlist b, inR w) (w : Palabra) (hw : inR w) : inTab b w = true β enLista b w := by rw [enLista_iff_wlist b hb] unfold inTab cset rw [Std.TreeSet.contains_ofList] constructor Β· intro h have h' : wcode w β (wlist b).map wcode := by simpa using h obtain β¨w', hw', eβ© := List.mem_map.mp h' have := wcode_inj w' w (hr w' hw') hw e subst this exact hw' Β· intro h simpa using List.mem_map_of_mem (f := wcode) h theorem cellWord_inR (b : β€) (hb0 : 0 β€ b) (hb1 : b < 64) (Ξ ΞΈ : β) : inR (cellWord b Ξ ΞΈ) := by unfold cellWord inR clip simp only omega /-- The ambiguous length `L_b(ΞΈ)` of the section: the measure of the set of `Ξ` in `[0, b+2ΞΈ]` whosecell word is ambiguous (`Amb`). -/noncomputable def secLen (Amb : β€ β Palabra β Prop) (b : β) (ΞΈ : β) : β := (volume {Ξ : β | 0 β€ Ξ β§ Ξ β€ (b : β) + 2 * ΞΈ β§ Amb (b : β€) (cellWord (b : β€) Ξ ΞΈ)}).toReal /-- Number of unit cells `(m/q, (m+1)/q)` of the section `ΞΈ = p/q` whose word is in the list. -/def cnt (b p q : β) : β := ((Finset.range (b * q + 2 * p)).filter (fun m : β => inTab (b : β€) (zWord (b : β€) (p : β€) (q : β€) (m : β€)) = true)).card theorem secLen_eq (Amb : β€ β Palabra β Prop) (b p q : β) (hq : 0 < q) (hb : 5 β€ b) (hb2 : b < 64) (hr : β w β wlist (b : β€), inR w) (hcl : β w, Amb (b : β€) w β enLista (b : β€) w) (ΞΈ : β) (hΞΈ : (p : β) / q = ΞΈ) : secLen Amb b ΞΈ = (cnt b p q : β) / q := by subst hΞΈ have hqpos : (0 : β) < q := by exact_mod_cast hq have hset : {Ξ : β | 0 β€ Ξ β§ Ξ β€ (b : β) + 2 * ((p : β) / q) β§ Amb (b : β€) (cellWord (b : β€) Ξ ((p : β) / q))} = {Ξ : β | 0 β€ Ξ β§ Ξ β€ (b : β) + 2 * ((p : β) / q) β§ inTab (b : β€) (cellWord (b : β€) Ξ ((p : β) / q)) = true} := by ext Ξ constructor Β· rintro β¨h0, h1, h2β© exact β¨h0, h1, (inTab_iff (b : β€) (by omega) hr _ (cellWord_inR _ (by omega) (by omega) _ _)).mpr ((hcl _).mp h2)β© Β· rintro β¨h0, h1, h2β© exact β¨h0, h1, (hcl _).mpr ((inTab_iff (b : β€) (by omega) hr _ (cellWord_inR _ (by omega) (by omega) _ _)).mp h2)β© unfold secLen rw [hset, section_volume b p q hq (inTab (b : β€))] rw [ENNReal.toReal_mul, ENNReal.toReal_natCast, ENNReal.toReal_ofReal (by positivity)] unfold cnt field_simp theorem hr30 : β w β wlist 30, inR w := by decide +kerneltheorem hr31 : β w β wlist 31, inR w := by decide +kerneltheorem hr32 : β w β wlist 32, inR w := by decide +kernel /-- The eighteen slopes of the finite certificate: two interior points of each Farey chamber of order four and its right endpoint. -/noncomputable def thetaPts : List β := [(1 : β) / 12, (1 : β) / 6, (1 : β) / 4, (5 : β) / 18, (11 : β) / 36, (1 : β) / 3, (7 : β) / 18, (4 : β) / 9, (1 : β) / 2, (5 : β) / 9, (11 : β) / 18, (2 : β) / 3, (25 : β) / 36, (13 : β) / 18, (3 : β) / 4, (5 : β) / 6, (11 : β) / 12, 1] theorem cnt_30_1_12 : cnt 30 1 12 = 61 := by decide +kernel theorem sec_30_1_12 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((30 : β) : β€) w β enLista ((30 : β) : β€) w) : secLen Amb 30 ((1 : β) / 12) = ((30 : β) : β) * F2 ((1 : β) / 12) + kappa ((1 : β) / 12) + epsilon (30 % 3) / 3 * delta ((1 : β) / 12) := by rw [secLen_eq Amb 30 1 12 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr30) hcl ((1 : β) / 12) (by norm_num), cnt_30_1_12] norm_num [F2, kappa, delta, epsilon] theorem cnt_30_1_6 : cnt 30 1 6 = 61 := by decide +kernel theorem sec_30_1_6 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((30 : β) : β€) w β enLista ((30 : β) : β€) w) : secLen Amb 30 ((1 : β) / 6) = ((30 : β) : β) * F2 ((1 : β) / 6) + kappa ((1 : β) / 6) + epsilon (30 % 3) / 3 * delta ((1 : β) / 6) := by rw [secLen_eq Amb 30 1 6 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr30) hcl ((1 : β) / 6) (by norm_num), cnt_30_1_6] norm_num [F2, kappa, delta, epsilon] theorem cnt_30_1_4 : cnt 30 1 4 = 61 := by decide +kernel theorem sec_30_1_4 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((30 : β) : β€) w β enLista ((30 : β) : β€) w) : secLen Amb 30 ((1 : β) / 4) = ((30 : β) : β) * F2 ((1 : β) / 4) + kappa ((1 : β) / 4) + epsilon (30 % 3) / 3 * delta ((1 : β) / 4) := by rw [secLen_eq Amb 30 1 4 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr30) hcl ((1 : β) / 4) (by norm_num), cnt_30_1_4] norm_num [F2, kappa, delta, epsilon] theorem cnt_30_5_18 : cnt 30 5 18 = 365 := by decide +kernel theorem sec_30_5_18 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((30 : β) : β€) w β enLista ((30 : β) : β€) w) : secLen Amb 30 ((5 : β) / 18) = ((30 : β) : β) * F2 ((5 : β) / 18) + kappa ((5 : β) / 18) + epsilon (30 % 3) / 3 * delta ((5 : β) / 18) := by rw [secLen_eq Amb 30 5 18 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr30) hcl ((5 : β) / 18) (by norm_num), cnt_30_5_18] norm_num [F2, kappa, delta, epsilon] theorem cnt_30_11_36 : cnt 30 11 36 = 911 := by decide +kernel theorem sec_30_11_36 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((30 : β) : β€) w β enLista ((30 : β) : β€) w) : secLen Amb 30 ((11 : β) / 36) = ((30 : β) : β) * F2 ((11 : β) / 36) + kappa ((11 : β) / 36) + epsilon (30 % 3) / 3 * delta ((11 : β) / 36) := by rw [secLen_eq Amb 30 11 36 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr30) hcl ((11 : β) / 36) (by norm_num), cnt_30_11_36] norm_num [F2, kappa, delta, epsilon] theorem cnt_30_1_3 : cnt 30 1 3 = 91 := by decide +kernel theorem sec_30_1_3 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((30 : β) : β€) w β enLista ((30 : β) : β€) w) : secLen Amb 30 ((1 : β) / 3) = ((30 : β) : β) * F2 ((1 : β) / 3) + kappa ((1 : β) / 3) + epsilon (30 % 3) / 3 * delta ((1 : β) / 3) := by rw [secLen_eq Amb 30 1 3 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr30) hcl ((1 : β) / 3) (by norm_num), cnt_30_1_3] norm_num [F2, kappa, delta, epsilon] theorem cnt_30_7_18 : cnt 30 7 18 = 370 := by decide +kernel theorem sec_30_7_18 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((30 : β) : β€) w β enLista ((30 : β) : β€) w) : secLen Amb 30 ((7 : β) / 18) = ((30 : β) : β) * F2 ((7 : β) / 18) + kappa ((7 : β) / 18) + epsilon (30 % 3) / 3 * delta ((7 : β) / 18) := by rw [secLen_eq Amb 30 7 18 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr30) hcl ((7 : β) / 18) (by norm_num), cnt_30_7_18] norm_num [F2, kappa, delta, epsilon] theorem cnt_30_4_9 : cnt 30 4 9 = 97 := by decide +kernel theorem sec_30_4_9 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((30 : β) : β€) w β enLista ((30 : β) : β€) w) : secLen Amb 30 ((4 : β) / 9) = ((30 : β) : β) * F2 ((4 : β) / 9) + kappa ((4 : β) / 9) + epsilon (30 % 3) / 3 * delta ((4 : β) / 9) := by rw [secLen_eq Amb 30 4 9 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr30) hcl ((4 : β) / 9) (by norm_num), cnt_30_4_9] norm_num [F2, kappa, delta, epsilon] theorem cnt_30_1_2 : cnt 30 1 2 = 2 := by decide +kernel theorem sec_30_1_2 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((30 : β) : β€) w β enLista ((30 : β) : β€) w) : secLen Amb 30 ((1 : β) / 2) = ((30 : β) : β) * F2 ((1 : β) / 2) + kappa ((1 : β) / 2) + epsilon (30 % 3) / 3 * delta ((1 : β) / 2) := by rw [secLen_eq Amb 30 1 2 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr30) hcl ((1 : β) / 2) (by norm_num), cnt_30_1_2] norm_num [F2, kappa, delta, epsilon] theorem cnt_30_5_9 : cnt 30 5 9 = 39 := by decide +kernel theorem sec_30_5_9 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((30 : β) : β€) w β enLista ((30 : β) : β€) w) : secLen Amb 30 ((5 : β) / 9) = ((30 : β) : β) * F2 ((5 : β) / 9) + kappa ((5 : β) / 9) + epsilon (30 % 3) / 3 * delta ((5 : β) / 9) := by rw [secLen_eq Amb 30 5 9 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr30) hcl ((5 : β) / 9) (by norm_num), cnt_30_5_9] norm_num [F2, kappa, delta, epsilon] theorem cnt_30_11_18 : cnt 30 11 18 = 138 := by decide +kernel theorem sec_30_11_18 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((30 : β) : β€) w β enLista ((30 : β) : β€) w) : secLen Amb 30 ((11 : β) / 18) = ((30 : β) : β) * F2 ((11 : β) / 18) + kappa ((11 : β) / 18) + epsilon (30 % 3) / 3 * delta ((11 : β) / 18) := by rw [secLen_eq Amb 30 11 18 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr30) hcl ((11 : β) / 18) (by norm_num), cnt_30_11_18] norm_num [F2, kappa, delta, epsilon] theorem cnt_30_2_3 : cnt 30 2 3 = 33 := by decide +kernel theorem sec_30_2_3 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((30 : β) : β€) w β enLista ((30 : β) : β€) w) : secLen Amb 30 ((2 : β) / 3) = ((30 : β) : β) * F2 ((2 : β) / 3) + kappa ((2 : β) / 3) + epsilon (30 % 3) / 3 * delta ((2 : β) / 3) := by rw [secLen_eq Amb 30 2 3 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr30) hcl ((2 : β) / 3) (by norm_num), cnt_30_2_3] norm_num [F2, kappa, delta, epsilon] theorem cnt_30_25_36 : cnt 30 25 36 = 336 := by decide +kernel theorem sec_30_25_36 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((30 : β) : β€) w β enLista ((30 : β) : β€) w) : secLen Amb 30 ((25 : β) / 36) = ((30 : β) : β) * F2 ((25 : β) / 36) + kappa ((25 : β) / 36) + epsilon (30 % 3) / 3 * delta ((25 : β) / 36) := by rw [secLen_eq Amb 30 25 36 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr30) hcl ((25 : β) / 36) (by norm_num), cnt_30_25_36] norm_num [F2, kappa, delta, epsilon] theorem cnt_30_13_18 : cnt 30 13 18 = 138 := by decide +kernel theorem sec_30_13_18 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((30 : β) : β€) w β enLista ((30 : β) : β€) w) : secLen Amb 30 ((13 : β) / 18) = ((30 : β) : β) * F2 ((13 : β) / 18) + kappa ((13 : β) / 18) + epsilon (30 % 3) / 3 * delta ((13 : β) / 18) := by rw [secLen_eq Amb 30 13 18 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr30) hcl ((13 : β) / 18) (by norm_num), cnt_30_13_18] norm_num [F2, kappa, delta, epsilon] theorem cnt_30_3_4 : cnt 30 3 4 = 24 := by decide +kernel theorem sec_30_3_4 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((30 : β) : β€) w β enLista ((30 : β) : β€) w) : secLen Amb 30 ((3 : β) / 4) = ((30 : β) : β) * F2 ((3 : β) / 4) + kappa ((3 : β) / 4) + epsilon (30 % 3) / 3 * delta ((3 : β) / 4) := by rw [secLen_eq Amb 30 3 4 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr30) hcl ((3 : β) / 4) (by norm_num), cnt_30_3_4] norm_num [F2, kappa, delta, epsilon] theorem cnt_30_5_6 : cnt 30 5 6 = 24 := by decide +kernel theorem sec_30_5_6 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((30 : β) : β€) w β enLista ((30 : β) : β€) w) : secLen Amb 30 ((5 : β) / 6) = ((30 : β) : β) * F2 ((5 : β) / 6) + kappa ((5 : β) / 6) + epsilon (30 % 3) / 3 * delta ((5 : β) / 6) := by rw [secLen_eq Amb 30 5 6 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr30) hcl ((5 : β) / 6) (by norm_num), cnt_30_5_6] norm_num [F2, kappa, delta, epsilon] theorem cnt_30_11_12 : cnt 30 11 12 = 24 := by decide +kernel theorem sec_30_11_12 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((30 : β) : β€) w β enLista ((30 : β) : β€) w) : secLen Amb 30 ((11 : β) / 12) = ((30 : β) : β) * F2 ((11 : β) / 12) + kappa ((11 : β) / 12) + epsilon (30 % 3) / 3 * delta ((11 : β) / 12) := by rw [secLen_eq Amb 30 11 12 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr30) hcl ((11 : β) / 12) (by norm_num), cnt_30_11_12] norm_num [F2, kappa, delta, epsilon] theorem cnt_30_1_1 : cnt 30 1 1 = 0 := by decide +kernel theorem sec_30_1_1 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((30 : β) : β€) w β enLista ((30 : β) : β€) w) : secLen Amb 30 (1) = ((30 : β) : β) * F2 (1) + kappa (1) + epsilon (30 % 3) / 3 * delta (1) := by rw [secLen_eq Amb 30 1 1 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr30) hcl (1) (by norm_num), cnt_30_1_1] norm_num [F2, kappa, delta, epsilon] theorem cnt_31_1_12 : cnt 31 1 12 = 63 := by decide +kernel theorem sec_31_1_12 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((31 : β) : β€) w β enLista ((31 : β) : β€) w) : secLen Amb 31 ((1 : β) / 12) = ((31 : β) : β) * F2 ((1 : β) / 12) + kappa ((1 : β) / 12) + epsilon (31 % 3) / 3 * delta ((1 : β) / 12) := by rw [secLen_eq Amb 31 1 12 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr31) hcl ((1 : β) / 12) (by norm_num), cnt_31_1_12] norm_num [F2, kappa, delta, epsilon] theorem cnt_31_1_6 : cnt 31 1 6 = 63 := by decide +kernel theorem sec_31_1_6 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((31 : β) : β€) w β enLista ((31 : β) : β€) w) : secLen Amb 31 ((1 : β) / 6) = ((31 : β) : β) * F2 ((1 : β) / 6) + kappa ((1 : β) / 6) + epsilon (31 % 3) / 3 * delta ((1 : β) / 6) := by rw [secLen_eq Amb 31 1 6 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr31) hcl ((1 : β) / 6) (by norm_num), cnt_31_1_6] norm_num [F2, kappa, delta, epsilon] theorem cnt_31_1_4 : cnt 31 1 4 = 63 := by decide +kernel theorem sec_31_1_4 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((31 : β) : β€) w β enLista ((31 : β) : β€) w) : secLen Amb 31 ((1 : β) / 4) = ((31 : β) : β) * F2 ((1 : β) / 4) + kappa ((1 : β) / 4) + epsilon (31 % 3) / 3 * delta ((1 : β) / 4) := by rw [secLen_eq Amb 31 1 4 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr31) hcl ((1 : β) / 4) (by norm_num), cnt_31_1_4] norm_num [F2, kappa, delta, epsilon] theorem cnt_31_5_18 : cnt 31 5 18 = 377 := by decide +kernel theorem sec_31_5_18 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((31 : β) : β€) w β enLista ((31 : β) : β€) w) : secLen Amb 31 ((5 : β) / 18) = ((31 : β) : β) * F2 ((5 : β) / 18) + kappa ((5 : β) / 18) + epsilon (31 % 3) / 3 * delta ((5 : β) / 18) := by rw [secLen_eq Amb 31 5 18 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr31) hcl ((5 : β) / 18) (by norm_num), cnt_31_5_18] norm_num [F2, kappa, delta, epsilon] theorem cnt_31_11_36 : cnt 31 11 36 = 941 := by decide +kernel theorem sec_31_11_36 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((31 : β) : β€) w β enLista ((31 : β) : β€) w) : secLen Amb 31 ((11 : β) / 36) = ((31 : β) : β) * F2 ((11 : β) / 36) + kappa ((11 : β) / 36) + epsilon (31 % 3) / 3 * delta ((11 : β) / 36) := by rw [secLen_eq Amb 31 11 36 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr31) hcl ((11 : β) / 36) (by norm_num), cnt_31_11_36] norm_num [F2, kappa, delta, epsilon] theorem cnt_31_1_3 : cnt 31 1 3 = 94 := by decide +kernel theorem sec_31_1_3 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((31 : β) : β€) w β enLista ((31 : β) : β€) w) : secLen Amb 31 ((1 : β) / 3) = ((31 : β) : β) * F2 ((1 : β) / 3) + kappa ((1 : β) / 3) + epsilon (31 % 3) / 3 * delta ((1 : β) / 3) := by rw [secLen_eq Amb 31 1 3 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr31) hcl ((1 : β) / 3) (by norm_num), cnt_31_1_3] norm_num [F2, kappa, delta, epsilon] theorem cnt_31_7_18 : cnt 31 7 18 = 382 := by decide +kernel theorem sec_31_7_18 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((31 : β) : β€) w β enLista ((31 : β) : β€) w) : secLen Amb 31 ((7 : β) / 18) = ((31 : β) : β) * F2 ((7 : β) / 18) + kappa ((7 : β) / 18) + epsilon (31 % 3) / 3 * delta ((7 : β) / 18) := by rw [secLen_eq Amb 31 7 18 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr31) hcl ((7 : β) / 18) (by norm_num), cnt_31_7_18] norm_num [F2, kappa, delta, epsilon] theorem cnt_31_4_9 : cnt 31 4 9 = 100 := by decide +kernel theorem sec_31_4_9 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((31 : β) : β€) w β enLista ((31 : β) : β€) w) : secLen Amb 31 ((4 : β) / 9) = ((31 : β) : β) * F2 ((4 : β) / 9) + kappa ((4 : β) / 9) + epsilon (31 % 3) / 3 * delta ((4 : β) / 9) := by rw [secLen_eq Amb 31 4 9 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr31) hcl ((4 : β) / 9) (by norm_num), cnt_31_4_9] norm_num [F2, kappa, delta, epsilon] theorem cnt_31_1_2 : cnt 31 1 2 = 2 := by decide +kernel theorem sec_31_1_2 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((31 : β) : β€) w β enLista ((31 : β) : β€) w) : secLen Amb 31 ((1 : β) / 2) = ((31 : β) : β) * F2 ((1 : β) / 2) + kappa ((1 : β) / 2) + epsilon (31 % 3) / 3 * delta ((1 : β) / 2) := by rw [secLen_eq Amb 31 1 2 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr31) hcl ((1 : β) / 2) (by norm_num), cnt_31_1_2] norm_num [F2, kappa, delta, epsilon] theorem cnt_31_5_9 : cnt 31 5 9 = 40 := by decide +kernel theorem sec_31_5_9 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((31 : β) : β€) w β enLista ((31 : β) : β€) w) : secLen Amb 31 ((5 : β) / 9) = ((31 : β) : β) * F2 ((5 : β) / 9) + kappa ((5 : β) / 9) + epsilon (31 % 3) / 3 * delta ((5 : β) / 9) := by rw [secLen_eq Amb 31 5 9 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr31) hcl ((5 : β) / 9) (by norm_num), cnt_31_5_9] norm_num [F2, kappa, delta, epsilon] theorem cnt_31_11_18 : cnt 31 11 18 = 142 := by decide +kernel theorem sec_31_11_18 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((31 : β) : β€) w β enLista ((31 : β) : β€) w) : secLen Amb 31 ((11 : β) / 18) = ((31 : β) : β) * F2 ((11 : β) / 18) + kappa ((11 : β) / 18) + epsilon (31 % 3) / 3 * delta ((11 : β) / 18) := by rw [secLen_eq Amb 31 11 18 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr31) hcl ((11 : β) / 18) (by norm_num), cnt_31_11_18] norm_num [F2, kappa, delta, epsilon] theorem cnt_31_2_3 : cnt 31 2 3 = 34 := by decide +kernel theorem sec_31_2_3 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((31 : β) : β€) w β enLista ((31 : β) : β€) w) : secLen Amb 31 ((2 : β) / 3) = ((31 : β) : β) * F2 ((2 : β) / 3) + kappa ((2 : β) / 3) + epsilon (31 % 3) / 3 * delta ((2 : β) / 3) := by rw [secLen_eq Amb 31 2 3 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr31) hcl ((2 : β) / 3) (by norm_num), cnt_31_2_3] norm_num [F2, kappa, delta, epsilon] theorem cnt_31_25_36 : cnt 31 25 36 = 347 := by decide +kernel theorem sec_31_25_36 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((31 : β) : β€) w β enLista ((31 : β) : β€) w) : secLen Amb 31 ((25 : β) / 36) = ((31 : β) : β) * F2 ((25 : β) / 36) + kappa ((25 : β) / 36) + epsilon (31 % 3) / 3 * delta ((25 : β) / 36) := by rw [secLen_eq Amb 31 25 36 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr31) hcl ((25 : β) / 36) (by norm_num), cnt_31_25_36] norm_num [F2, kappa, delta, epsilon] theorem cnt_31_13_18 : cnt 31 13 18 = 143 := by decide +kernel theorem sec_31_13_18 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((31 : β) : β€) w β enLista ((31 : β) : β€) w) : secLen Amb 31 ((13 : β) / 18) = ((31 : β) : β) * F2 ((13 : β) / 18) + kappa ((13 : β) / 18) + epsilon (31 % 3) / 3 * delta ((13 : β) / 18) := by rw [secLen_eq Amb 31 13 18 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr31) hcl ((13 : β) / 18) (by norm_num), cnt_31_13_18] norm_num [F2, kappa, delta, epsilon] theorem cnt_31_3_4 : cnt 31 3 4 = 25 := by decide +kernel theorem sec_31_3_4 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((31 : β) : β€) w β enLista ((31 : β) : β€) w) : secLen Amb 31 ((3 : β) / 4) = ((31 : β) : β) * F2 ((3 : β) / 4) + kappa ((3 : β) / 4) + epsilon (31 % 3) / 3 * delta ((3 : β) / 4) := by rw [secLen_eq Amb 31 3 4 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr31) hcl ((3 : β) / 4) (by norm_num), cnt_31_3_4] norm_num [F2, kappa, delta, epsilon] theorem cnt_31_5_6 : cnt 31 5 6 = 25 := by decide +kernel theorem sec_31_5_6 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((31 : β) : β€) w β enLista ((31 : β) : β€) w) : secLen Amb 31 ((5 : β) / 6) = ((31 : β) : β) * F2 ((5 : β) / 6) + kappa ((5 : β) / 6) + epsilon (31 % 3) / 3 * delta ((5 : β) / 6) := by rw [secLen_eq Amb 31 5 6 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr31) hcl ((5 : β) / 6) (by norm_num), cnt_31_5_6] norm_num [F2, kappa, delta, epsilon] theorem cnt_31_11_12 : cnt 31 11 12 = 25 := by decide +kernel theorem sec_31_11_12 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((31 : β) : β€) w β enLista ((31 : β) : β€) w) : secLen Amb 31 ((11 : β) / 12) = ((31 : β) : β) * F2 ((11 : β) / 12) + kappa ((11 : β) / 12) + epsilon (31 % 3) / 3 * delta ((11 : β) / 12) := by rw [secLen_eq Amb 31 11 12 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr31) hcl ((11 : β) / 12) (by norm_num), cnt_31_11_12] norm_num [F2, kappa, delta, epsilon] theorem cnt_31_1_1 : cnt 31 1 1 = 0 := by decide +kernel theorem sec_31_1_1 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((31 : β) : β€) w β enLista ((31 : β) : β€) w) : secLen Amb 31 (1) = ((31 : β) : β) * F2 (1) + kappa (1) + epsilon (31 % 3) / 3 * delta (1) := by rw [secLen_eq Amb 31 1 1 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr31) hcl (1) (by norm_num), cnt_31_1_1] norm_num [F2, kappa, delta, epsilon] theorem cnt_32_1_12 : cnt 32 1 12 = 65 := by decide +kernel theorem sec_32_1_12 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((32 : β) : β€) w β enLista ((32 : β) : β€) w) : secLen Amb 32 ((1 : β) / 12) = ((32 : β) : β) * F2 ((1 : β) / 12) + kappa ((1 : β) / 12) + epsilon (32 % 3) / 3 * delta ((1 : β) / 12) := by rw [secLen_eq Amb 32 1 12 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr32) hcl ((1 : β) / 12) (by norm_num), cnt_32_1_12] norm_num [F2, kappa, delta, epsilon] theorem cnt_32_1_6 : cnt 32 1 6 = 65 := by decide +kernel theorem sec_32_1_6 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((32 : β) : β€) w β enLista ((32 : β) : β€) w) : secLen Amb 32 ((1 : β) / 6) = ((32 : β) : β) * F2 ((1 : β) / 6) + kappa ((1 : β) / 6) + epsilon (32 % 3) / 3 * delta ((1 : β) / 6) := by rw [secLen_eq Amb 32 1 6 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr32) hcl ((1 : β) / 6) (by norm_num), cnt_32_1_6] norm_num [F2, kappa, delta, epsilon] theorem cnt_32_1_4 : cnt 32 1 4 = 65 := by decide +kernel theorem sec_32_1_4 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((32 : β) : β€) w β enLista ((32 : β) : β€) w) : secLen Amb 32 ((1 : β) / 4) = ((32 : β) : β) * F2 ((1 : β) / 4) + kappa ((1 : β) / 4) + epsilon (32 % 3) / 3 * delta ((1 : β) / 4) := by rw [secLen_eq Amb 32 1 4 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr32) hcl ((1 : β) / 4) (by norm_num), cnt_32_1_4] norm_num [F2, kappa, delta, epsilon] theorem cnt_32_5_18 : cnt 32 5 18 = 389 := by decide +kernel theorem sec_32_5_18 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((32 : β) : β€) w β enLista ((32 : β) : β€) w) : secLen Amb 32 ((5 : β) / 18) = ((32 : β) : β) * F2 ((5 : β) / 18) + kappa ((5 : β) / 18) + epsilon (32 % 3) / 3 * delta ((5 : β) / 18) := by rw [secLen_eq Amb 32 5 18 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr32) hcl ((5 : β) / 18) (by norm_num), cnt_32_5_18] norm_num [F2, kappa, delta, epsilon] theorem cnt_32_11_36 : cnt 32 11 36 = 971 := by decide +kernel theorem sec_32_11_36 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((32 : β) : β€) w β enLista ((32 : β) : β€) w) : secLen Amb 32 ((11 : β) / 36) = ((32 : β) : β) * F2 ((11 : β) / 36) + kappa ((11 : β) / 36) + epsilon (32 % 3) / 3 * delta ((11 : β) / 36) := by rw [secLen_eq Amb 32 11 36 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr32) hcl ((11 : β) / 36) (by norm_num), cnt_32_11_36] norm_num [F2, kappa, delta, epsilon] theorem cnt_32_1_3 : cnt 32 1 3 = 97 := by decide +kernel theorem sec_32_1_3 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((32 : β) : β€) w β enLista ((32 : β) : β€) w) : secLen Amb 32 ((1 : β) / 3) = ((32 : β) : β) * F2 ((1 : β) / 3) + kappa ((1 : β) / 3) + epsilon (32 % 3) / 3 * delta ((1 : β) / 3) := by rw [secLen_eq Amb 32 1 3 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr32) hcl ((1 : β) / 3) (by norm_num), cnt_32_1_3] norm_num [F2, kappa, delta, epsilon] theorem cnt_32_7_18 : cnt 32 7 18 = 394 := by decide +kernel theorem sec_32_7_18 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((32 : β) : β€) w β enLista ((32 : β) : β€) w) : secLen Amb 32 ((7 : β) / 18) = ((32 : β) : β) * F2 ((7 : β) / 18) + kappa ((7 : β) / 18) + epsilon (32 % 3) / 3 * delta ((7 : β) / 18) := by rw [secLen_eq Amb 32 7 18 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr32) hcl ((7 : β) / 18) (by norm_num), cnt_32_7_18] norm_num [F2, kappa, delta, epsilon] theorem cnt_32_4_9 : cnt 32 4 9 = 103 := by decide +kernel theorem sec_32_4_9 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((32 : β) : β€) w β enLista ((32 : β) : β€) w) : secLen Amb 32 ((4 : β) / 9) = ((32 : β) : β) * F2 ((4 : β) / 9) + kappa ((4 : β) / 9) + epsilon (32 % 3) / 3 * delta ((4 : β) / 9) := by rw [secLen_eq Amb 32 4 9 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr32) hcl ((4 : β) / 9) (by norm_num), cnt_32_4_9] norm_num [F2, kappa, delta, epsilon] theorem cnt_32_1_2 : cnt 32 1 2 = 2 := by decide +kernel theorem sec_32_1_2 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((32 : β) : β€) w β enLista ((32 : β) : β€) w) : secLen Amb 32 ((1 : β) / 2) = ((32 : β) : β) * F2 ((1 : β) / 2) + kappa ((1 : β) / 2) + epsilon (32 % 3) / 3 * delta ((1 : β) / 2) := by rw [secLen_eq Amb 32 1 2 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr32) hcl ((1 : β) / 2) (by norm_num), cnt_32_1_2] norm_num [F2, kappa, delta, epsilon] theorem cnt_32_5_9 : cnt 32 5 9 = 41 := by decide +kernel theorem sec_32_5_9 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((32 : β) : β€) w β enLista ((32 : β) : β€) w) : secLen Amb 32 ((5 : β) / 9) = ((32 : β) : β) * F2 ((5 : β) / 9) + kappa ((5 : β) / 9) + epsilon (32 % 3) / 3 * delta ((5 : β) / 9) := by rw [secLen_eq Amb 32 5 9 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr32) hcl ((5 : β) / 9) (by norm_num), cnt_32_5_9] norm_num [F2, kappa, delta, epsilon] theorem cnt_32_11_18 : cnt 32 11 18 = 146 := by decide +kernel theorem sec_32_11_18 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((32 : β) : β€) w β enLista ((32 : β) : β€) w) : secLen Amb 32 ((11 : β) / 18) = ((32 : β) : β) * F2 ((11 : β) / 18) + kappa ((11 : β) / 18) + epsilon (32 % 3) / 3 * delta ((11 : β) / 18) := by rw [secLen_eq Amb 32 11 18 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr32) hcl ((11 : β) / 18) (by norm_num), cnt_32_11_18] norm_num [F2, kappa, delta, epsilon] theorem cnt_32_2_3 : cnt 32 2 3 = 35 := by decide +kernel theorem sec_32_2_3 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((32 : β) : β€) w β enLista ((32 : β) : β€) w) : secLen Amb 32 ((2 : β) / 3) = ((32 : β) : β) * F2 ((2 : β) / 3) + kappa ((2 : β) / 3) + epsilon (32 % 3) / 3 * delta ((2 : β) / 3) := by rw [secLen_eq Amb 32 2 3 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr32) hcl ((2 : β) / 3) (by norm_num), cnt_32_2_3] norm_num [F2, kappa, delta, epsilon] theorem cnt_32_25_36 : cnt 32 25 36 = 361 := by decide +kernel theorem sec_32_25_36 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((32 : β) : β€) w β enLista ((32 : β) : β€) w) : secLen Amb 32 ((25 : β) / 36) = ((32 : β) : β) * F2 ((25 : β) / 36) + kappa ((25 : β) / 36) + epsilon (32 % 3) / 3 * delta ((25 : β) / 36) := by rw [secLen_eq Amb 32 25 36 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr32) hcl ((25 : β) / 36) (by norm_num), cnt_32_25_36] norm_num [F2, kappa, delta, epsilon] theorem cnt_32_13_18 : cnt 32 13 18 = 151 := by decide +kernel theorem sec_32_13_18 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((32 : β) : β€) w β enLista ((32 : β) : β€) w) : secLen Amb 32 ((13 : β) / 18) = ((32 : β) : β) * F2 ((13 : β) / 18) + kappa ((13 : β) / 18) + epsilon (32 % 3) / 3 * delta ((13 : β) / 18) := by rw [secLen_eq Amb 32 13 18 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr32) hcl ((13 : β) / 18) (by norm_num), cnt_32_13_18] norm_num [F2, kappa, delta, epsilon] theorem cnt_32_3_4 : cnt 32 3 4 = 27 := by decide +kernel theorem sec_32_3_4 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((32 : β) : β€) w β enLista ((32 : β) : β€) w) : secLen Amb 32 ((3 : β) / 4) = ((32 : β) : β) * F2 ((3 : β) / 4) + kappa ((3 : β) / 4) + epsilon (32 % 3) / 3 * delta ((3 : β) / 4) := by rw [secLen_eq Amb 32 3 4 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr32) hcl ((3 : β) / 4) (by norm_num), cnt_32_3_4] norm_num [F2, kappa, delta, epsilon] theorem cnt_32_5_6 : cnt 32 5 6 = 27 := by decide +kernel theorem sec_32_5_6 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((32 : β) : β€) w β enLista ((32 : β) : β€) w) : secLen Amb 32 ((5 : β) / 6) = ((32 : β) : β) * F2 ((5 : β) / 6) + kappa ((5 : β) / 6) + epsilon (32 % 3) / 3 * delta ((5 : β) / 6) := by rw [secLen_eq Amb 32 5 6 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr32) hcl ((5 : β) / 6) (by norm_num), cnt_32_5_6] norm_num [F2, kappa, delta, epsilon] theorem cnt_32_11_12 : cnt 32 11 12 = 27 := by decide +kernel theorem sec_32_11_12 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((32 : β) : β€) w β enLista ((32 : β) : β€) w) : secLen Amb 32 ((11 : β) / 12) = ((32 : β) : β) * F2 ((11 : β) / 12) + kappa ((11 : β) / 12) + epsilon (32 % 3) / 3 * delta ((11 : β) / 12) := by rw [secLen_eq Amb 32 11 12 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr32) hcl ((11 : β) / 12) (by norm_num), cnt_32_11_12] norm_num [F2, kappa, delta, epsilon] theorem cnt_32_1_1 : cnt 32 1 1 = 0 := by decide +kernel theorem sec_32_1_1 (Amb : β€ β Palabra β Prop) (hcl : β w, Amb ((32 : β) : β€) w β enLista ((32 : β) : β€) w) : secLen Amb 32 (1) = ((32 : β) : β) * F2 (1) + kappa (1) + epsilon (32 % 3) / 3 * delta (1) := by rw [secLen_eq Amb 32 1 1 (by norm_num) (by norm_num) (by norm_num) (by simpa using hr32) hcl (1) (by norm_num), cnt_32_1_1] norm_num [F2, kappa, delta, epsilon] /-- BASE_54. The 54 finite-section identities of Theorem `thm:exact` (Paper III): for `b = 30, 31, 32`and each of the eighteen slopes of `thetaPts`, the ambiguous length of the section equals`b Fβ(ΞΈ) + ΞΊ(ΞΈ) + Ξ΅_{b mod 3} Ξ΄(ΞΈ) / 3`. The classification of Part I enters, as in `picos_condicional`,as the named hypothesis `hcl` (a word is ambiguous iff it lies in the list `enLista`), here only for thethree values of `b` used. -/theorem base_54 (Amb : β€ β Palabra β Prop) (hcl : β b : β€, (b = 30 β¨ b = 31 β¨ b = 32) β β w, Amb b w β enLista b w) : β b : β, (b = 30 β¨ b = 31 β¨ b = 32) β β ΞΈ β thetaPts, secLen Amb b ΞΈ = (b : β) * F2 ΞΈ + kappa ΞΈ + epsilon (b % 3) / 3 * delta ΞΈ := by intro b hb ΞΈ hΞΈ simp only [thetaPts, List.mem_cons, List.not_mem_nil, or_false] at hΞΈ rcases hb with rfl | rfl | rfl Β· have h30 := hcl ((30 : β) : β€) (by norm_num) rcases hΞΈ with rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl Β· exact sec_30_1_12 Amb h30 Β· exact sec_30_1_6 Amb h30 Β· exact sec_30_1_4 Amb h30 Β· exact sec_30_5_18 Amb h30 Β· exact sec_30_11_36 Amb h30 Β· exact sec_30_1_3 Amb h30 Β· exact sec_30_7_18 Amb h30 Β· exact sec_30_4_9 Amb h30 Β· exact sec_30_1_2 Amb h30 Β· exact sec_30_5_9 Amb h30 Β· exact sec_30_11_18 Amb h30 Β· exact sec_30_2_3 Amb h30 Β· exact sec_30_25_36 Amb h30 Β· exact sec_30_13_18 Amb h30 Β· exact sec_30_3_4 Amb h30 Β· exact sec_30_5_6 Amb h30 Β· exact sec_30_11_12 Amb h30 Β· exact sec_30_1_1 Amb h30 Β· have h31 := hcl ((31 : β) : β€) (by norm_num) rcases hΞΈ with rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl Β· exact sec_31_1_12 Amb h31 Β· exact sec_31_1_6 Amb h31 Β· exact sec_31_1_4 Amb h31 Β· exact sec_31_5_18 Amb h31 Β· exact sec_31_11_36 Amb h31 Β· exact sec_31_1_3 Amb h31 Β· exact sec_31_7_18 Amb h31 Β· exact sec_31_4_9 Amb h31 Β· exact sec_31_1_2 Amb h31 Β· exact sec_31_5_9 Amb h31 Β· exact sec_31_11_18 Amb h31 Β· exact sec_31_2_3 Amb h31 Β· exact sec_31_25_36 Amb h31 Β· exact sec_31_13_18 Amb h31 Β· exact sec_31_3_4 Amb h31 Β· exact sec_31_5_6 Amb h31 Β· exact sec_31_11_12 Amb h31 Β· exact sec_31_1_1 Amb h31 Β· have h32 := hcl ((32 : β) : β€) (by norm_num) rcases hΞΈ with rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl Β· exact sec_32_1_12 Amb h32 Β· exact sec_32_1_6 Amb h32 Β· exact sec_32_1_4 Amb h32 Β· exact sec_32_5_18 Amb h32 Β· exact sec_32_11_36 Amb h32 Β· exact sec_32_1_3 Amb h32 Β· exact sec_32_7_18 Amb h32 Β· exact sec_32_4_9 Amb h32 Β· exact sec_32_1_2 Amb h32 Β· exact sec_32_5_9 Amb h32 Β· exact sec_32_11_18 Amb h32 Β· exact sec_32_2_3 Amb h32 Β· exact sec_32_25_36 Amb h32 Β· exact sec_32_13_18 Amb h32 Β· exact sec_32_3_4 Amb h32 Β· exact sec_32_5_6 Amb h32 Β· exact sec_32_11_12 Amb h32 Β· exact sec_32_1_1 Amb h32 end BaseKappa end CaballeroExact