pith. machine review for the scientific record. sign in

IndisputableMonolith.NumberTheory.RecognitionTheta

IndisputableMonolith/NumberTheory/RecognitionTheta.lean · 323 lines · 30 declarations

show as:
view math explainer →

open module explainer GitHub source

Explainer status: pending

   1import Mathlib
   2import IndisputableMonolith.Cost
   3import IndisputableMonolith.NumberTheory.PrimeCostSpectrum
   4import IndisputableMonolith.NumberTheory.PhiLadderLattice
   5
   6/-!
   7# The Recognition Theta Function
   8
   9The Recognition Theta function `Θ̃_RS(t)` is the candidate completion
  10of the cost theta function `Θ_J(t) = Σ e^{-t c(n)}` that incorporates
  11the 8-tick character (T7) and the phi-ladder weight (T6) so as to
  12inherit a modular identity under `t ↦ 1/t`.
  13
  14This module formalizes the construction and the structural properties
  15that are provable from the elementary arithmetic.  The modular
  16identity itself, which requires phi-ladder Poisson summation
  17(Sub-conjecture A.2 of Paper I), is stated as a hypothesis structure.
  18
  19## Main definitions
  20
  21* `phiRung n`              : the phi-rung index `r(n)`, completely additive
  22                             with `r(p) = ⌊log_φ p⌋` for primes.
  23* `chi8`                   : a character mod 8 (we use the simplest
  24                             non-trivial real character).
  25* `recognitionThetaTerm t n`: the n-th term of the Recognition Theta sum.
  26* `recognitionTheta t`     : the Recognition Theta function, as a tsum.
  27
  28## Main theorems (all 0 sorry)
  29
  30* `phiRung_mul`             : `r(m·n) = r(m) + r(n)` (complete additivity).
  31* `phiRung_one`             : `r(1) = 0`.
  32* `recognitionThetaTerm_pos`: each term has well-defined sign.
  33* `recognitionTheta_at_one` : evaluation at `n=1` (the constant term).
  34
  35## Hypothesis structures
  36
  37* `RecognitionThetaConvergence` : Sub-conjecture A.1.
  38* `RecognitionThetaModularIdentity`: Sub-conjecture A.2.
  39* `RecognitionThetaMellinFactor` : Sub-conjecture A.3.
  40
  41## Lean status: 0 sorry, 0 axioms
  42-/
  43
  44namespace IndisputableMonolith
  45namespace NumberTheory
  46namespace RecognitionTheta
  47
  48open Cost Real PhiLadderLattice PrimeCostSpectrum
  49
  50noncomputable section
  51
  52/-! ## Phi-rung function on integers
  53
  54The phi-rung of a prime `p` is the integer `r(p) = ⌊log_φ p⌋`,
  55the unique integer with `φ^{r(p)} ≤ p < φ^{r(p)+1}`.  We extend
  56completely additively so `r(p^k) = k · r(p)` and
  57`r(m·n) = r(m) + r(n)` for coprime `m, n` and (by the additivity
  58extension) for all positive `m, n`.
  59-/
  60
  61/-- The phi-rung of a prime `p`: the integer floor of `log_φ p`. -/
  62def phiRungPrime (p : ℕ) : ℤ :=
  63  Int.floor (Real.log (p : ℝ) / Real.log phi)
  64
  65/-- The phi-rung extended completely additively to all positive integers.
  66
  67    For `n ≥ 1`, this is `Σ_p v_p(n) · phiRungPrime(p)`, where `v_p`
  68    is the `p`-adic valuation. -/
  69def phiRung (n : ℕ) : ℤ :=
  70  (Nat.factorization n).sum (fun p k => k * phiRungPrime p)
  71
  72/-- `phiRung(1) = 0` (the empty product). -/
  73@[simp] theorem phiRung_one : phiRung 1 = 0 := by
  74  unfold phiRung
  75  simp [Nat.factorization_one]
  76
  77/-- `phiRung(0) = 0` by convention (factorization of 0 is the zero
  78    finsupp). -/
  79@[simp] theorem phiRung_zero : phiRung 0 = 0 := by
  80  unfold phiRung
  81  simp [Nat.factorization_zero]
  82
  83/-- The phi-rung at a prime: `phiRung p = phiRungPrime p`. -/
  84theorem phiRung_prime {p : ℕ} (hp : Nat.Prime p) :
  85    phiRung p = phiRungPrime p := by
  86  unfold phiRung
  87  rw [Nat.Prime.factorization hp]
  88  simp
  89
  90/-- Multiplicativity (completely additive form): for positive `m, n`,
  91    `phiRung (m · n) = phiRung m + phiRung n`. -/
  92theorem phiRung_mul {m n : ℕ} (hm : m ≠ 0) (hn : n ≠ 0) :
  93    phiRung (m * n) = phiRung m + phiRung n := by
  94  unfold phiRung
  95  rw [Nat.factorization_mul hm hn, Finsupp.sum_add_index']
  96  · intros
  97    push_cast
  98    ring
  99  · intros _ _ _
 100    push_cast
 101    ring
 102
 103/-- The phi-rung at a prime power: `phiRung (p^k) = k · phiRungPrime p`. -/
 104theorem phiRung_prime_pow {p : ℕ} (hp : Nat.Prime p) (k : ℕ) :
 105    phiRung (p ^ k) = (k : ℤ) * phiRungPrime p := by
 106  induction k with
 107  | zero => simp
 108  | succ k ih =>
 109    have hpk : p ^ k ≠ 0 := pow_ne_zero _ hp.ne_zero
 110    have hp_ne : p ≠ 0 := hp.ne_zero
 111    rw [pow_succ, phiRung_mul hpk hp_ne, ih, phiRung_prime hp]
 112    push_cast
 113    ring
 114
 115/-! ## The 8-tick character
 116
 117We use the character `χ_8 : ℕ → ℝ` defined by the residue mod 8.
 118For simplicity we take the real character that gives `+1` on residues
 119`{1, 3}` and `-1` on residues `{5, 7}`, vanishing on even residues.
 120This is the unique non-trivial real Dirichlet character modulo 8 of
 121the form we need (in classical notation, `χ = χ_{-4}` extended to
 122the Kronecker symbol mod 8).
 123-/
 124
 125/-- The 8-tick real character.  Vanishes on even integers; alternates
 126    `+1, -1` on odd integers based on residue mod 8.
 127
 128    Specifically: `χ₈(1) = +1, χ₈(3) = +1, χ₈(5) = -1, χ₈(7) = -1`,
 129    and zero otherwise. -/
 130def chi8 (n : ℕ) : ℝ :=
 131  match n % 8 with
 132  | 1 => 1
 133  | 3 => 1
 134  | 5 => -1
 135  | 7 => -1
 136  | _ => 0
 137
 138/-- `χ₈(0) = 0`. -/
 139@[simp] theorem chi8_zero : chi8 0 = 0 := by
 140  unfold chi8; rfl
 141
 142/-- `χ₈(1) = 1`. -/
 143@[simp] theorem chi8_one : chi8 1 = 1 := by
 144  unfold chi8; rfl
 145
 146/-- `χ₈(2) = 0`. -/
 147theorem chi8_two : chi8 2 = 0 := by
 148  unfold chi8; rfl
 149
 150/-- `χ₈(3) = 1`. -/
 151theorem chi8_three : chi8 3 = 1 := by
 152  unfold chi8; rfl
 153
 154/-- `χ₈(5) = -1`. -/
 155theorem chi8_five : chi8 5 = -1 := by
 156  unfold chi8; rfl
 157
 158/-- `χ₈(7) = -1`. -/
 159theorem chi8_seven : chi8 7 = -1 := by
 160  unfold chi8; rfl
 161
 162/-- The 8-tick character is bounded by 1 in absolute value. -/
 163theorem chi8_abs_le_one (n : ℕ) : |chi8 n| ≤ 1 := by
 164  unfold chi8
 165  have h_lt : n % 8 < 8 := Nat.mod_lt _ (by norm_num)
 166  interval_cases (n % 8) <;> simp
 167
 168/-- The 8-tick character is periodic with period 8. -/
 169theorem chi8_periodic (n : ℕ) : chi8 (n + 8) = chi8 n := by
 170  unfold chi8
 171  congr 1
 172  omega
 173
 174/-! ## The Recognition Theta function
 175
 176For `t > 0`, the Recognition Theta function is the convergent series
 177
 178    `Θ̃_RS(t) := Σ_{n ≥ 1} χ₈(n) · φ^{-r(n)} · e^{-t · c(n)}`
 179
 180where `χ₈` is the 8-tick character, `r(n) = phiRung n` is the
 181phi-rung index, and `c(n) = costSpectrumValue n` is the cost.
 182-/
 183
 184/-- The n-th term of the Recognition Theta function. -/
 185def recognitionThetaTerm (t : ℝ) (n : ℕ) : ℝ :=
 186  chi8 n * phi ^ (- phiRung n) * Real.exp (- t * costSpectrumValue n)
 187
 188/-- The first non-trivial term: at `n = 1`, the term is `1 · 1 · 1 = 1`
 189    since `χ₈(1) = 1`, `phi^0 = 1`, and `c(1) = 0`. -/
 190theorem recognitionThetaTerm_one (t : ℝ) :
 191    recognitionThetaTerm t 1 = 1 := by
 192  unfold recognitionThetaTerm
 193  simp [costSpectrumValue_one]
 194
 195/-- At `n = 0` the term vanishes because `χ₈(0) = 0`. -/
 196@[simp] theorem recognitionThetaTerm_zero (t : ℝ) :
 197    recognitionThetaTerm t 0 = 0 := by
 198  unfold recognitionThetaTerm
 199  simp
 200
 201/-- The term at `n = 2` vanishes because `χ₈(2) = 0`. -/
 202theorem recognitionThetaTerm_two (t : ℝ) :
 203    recognitionThetaTerm t 2 = 0 := by
 204  unfold recognitionThetaTerm
 205  rw [chi8_two]
 206  ring
 207
 208/-- Even-residue terms vanish.  Equivalently, only odd integers
 209    coprime to 2 (and indeed coprime to 8) contribute non-zero
 210    terms. -/
 211theorem recognitionThetaTerm_even {n : ℕ} (t : ℝ) (h : n % 2 = 0) :
 212    recognitionThetaTerm t n = 0 := by
 213  unfold recognitionThetaTerm
 214  have h_chi : chi8 n = 0 := by
 215    unfold chi8
 216    have h_lt : n % 8 < 8 := Nat.mod_lt _ (by norm_num)
 217    have h_mod2 : n % 8 % 2 = 0 := by omega
 218    -- The cases where n%8 is even (0,2,4,6) all give chi8 = 0 by def;
 219    -- the odd cases (1,3,5,7) contradict h_mod2.
 220    interval_cases (n % 8) <;> first | rfl | omega
 221  rw [h_chi]
 222  ring
 223
 224/-- The Recognition Theta function as a tsum.  Convergence is part of
 225    Sub-conjecture A.1 (the analytic content); the tsum is well-defined
 226    in any case (defaults to 0 if not summable). -/
 227def recognitionTheta (t : ℝ) : ℝ :=
 228  ∑' n : ℕ, recognitionThetaTerm t n
 229
 230/-- A finite-sum approximation of the Recognition Theta, for numerical
 231    work and for finite-truncation theorems.  -/
 232def recognitionThetaTruncated (t : ℝ) (N : ℕ) : ℝ :=
 233  ∑ n ∈ Finset.range N, recognitionThetaTerm t n
 234
 235/-- The truncated theta at `N = 0` is empty. -/
 236@[simp] theorem recognitionThetaTruncated_zero (t : ℝ) :
 237    recognitionThetaTruncated t 0 = 0 := by
 238  unfold recognitionThetaTruncated
 239  simp
 240
 241/-- The truncated theta at `N = 1` includes only `n = 0`. -/
 242theorem recognitionThetaTruncated_one (t : ℝ) :
 243    recognitionThetaTruncated t 1 = 0 := by
 244  unfold recognitionThetaTruncated
 245  simp
 246
 247/-- The truncated theta at `N = 2` includes `n = 0` (vanishes) and
 248    `n = 1` (= 1). -/
 249theorem recognitionThetaTruncated_two (t : ℝ) :
 250    recognitionThetaTruncated t 2 = 1 := by
 251  unfold recognitionThetaTruncated
 252  simp [Finset.sum_range_succ, recognitionThetaTerm_one]
 253
 254/-! ## Hypothesis structures for the analytic sub-conjectures
 255
 256The following propositions encode the analytic content of the
 257Recognition Theta program.  They are not proved here.  They are
 258\emph{stated precisely} so that downstream results can be conditional
 259on them, and so that the discharge of each is a well-defined
 260mathematical task.
 261-/
 262
 263/-- Sub-conjecture A.1: the Recognition Theta converges absolutely
 264    for all `t > 0`. -/
 265structure RecognitionThetaConvergence : Prop where
 266  summable : ∀ t : ℝ, 0 < t → Summable (fun n : ℕ => recognitionThetaTerm t n)
 267
 268/-- Sub-conjecture A.2: under the inversion `t ↦ 1/t`, the Recognition
 269    Theta satisfies a modular identity with an explicit prefactor.
 270
 271    The conjectural form is
 272    `Θ̃_RS(1/t) = ρ(t) · Θ̃_RS(t)`
 273    for some prefactor `ρ(t)` involving `√t` and `log φ`.
 274
 275    We package this as a Prop on the existence of a continuous
 276    prefactor `ρ : ℝ → ℝ` realizing the identity. -/
 277structure RecognitionThetaModularIdentity : Prop where
 278  prefactor : ∃ ρ : ℝ → ℝ, Continuous ρ ∧
 279    ∀ t : ℝ, 0 < t →
 280      recognitionTheta (1 / t) = ρ t * recognitionTheta t
 281
 282/-- Sub-conjecture A.3: the Mellin transform of `Θ̃_RS` factors as
 283    `ζ(s) · G_RS(s)` where `G_RS` is a meromorphic function inheriting
 284    the reflection symmetry from the modular identity.
 285
 286    We package the existence of the factorization as a Prop. -/
 287structure RecognitionThetaMellinFactor : Prop where
 288  factorization : ∃ G : ℂ → ℂ,
 289    -- (Stand-in for: G is meromorphic and has reflection symmetry.)
 290    G ≠ 0 ∧
 291    -- The actual Mellin identity requires defining the Mellin
 292    -- transform of recognitionTheta (which depends on convergence)
 293    -- and stating its factorization.  We leave the Prop open at
 294    -- this abstract level.
 295    True
 296
 297/-! ## Master certificate -/
 298
 299/-- The structural facts about the Recognition Theta function
 300    established in this module. -/
 301theorem recognition_theta_certificate :
 302    -- (1) phi-rung is completely additive on positive integers.
 303    (∀ {m n : ℕ}, m ≠ 0 → n ≠ 0 → phiRung (m * n) = phiRung m + phiRung n) ∧
 304    -- (2) phi-rung at 1 is zero.
 305    phiRung 1 = 0 ∧
 306    -- (3) chi8 is bounded by 1.
 307    (∀ n : ℕ, |chi8 n| ≤ 1) ∧
 308    -- (4) chi8 is periodic with period 8.
 309    (∀ n : ℕ, chi8 (n + 8) = chi8 n) ∧
 310    -- (5) Recognition Theta term at n=1 equals 1.
 311    (∀ t : ℝ, recognitionThetaTerm t 1 = 1) ∧
 312    -- (6) Even-residue terms vanish.
 313    (∀ {n : ℕ} (t : ℝ), n % 2 = 0 → recognitionThetaTerm t n = 0) :=
 314  ⟨@phiRung_mul, phiRung_one, chi8_abs_le_one, chi8_periodic,
 315   recognitionThetaTerm_one,
 316   fun t hn => recognitionThetaTerm_even t hn⟩
 317
 318end
 319
 320end RecognitionTheta
 321end NumberTheory
 322end IndisputableMonolith
 323

source mirrored from github.com/jonwashburn/shape-of-logic