pith. machine review for the scientific record. sign in

IndisputableMonolith.Foundation.MultiplicativeRecognizerL4

IndisputableMonolith/Foundation/MultiplicativeRecognizerL4.lean · 234 lines · 13 declarations

show as:
view math explainer →

open module explainer GitHub source

Explainer status: pending

   1import Mathlib
   2import IndisputableMonolith.Foundation.LogicAsFunctionalEquation
   3import IndisputableMonolith.Foundation.RecognizerInducesLogic
   4import IndisputableMonolith.Foundation.PrimitiveDistinction
   5
   6/-!
   7# (L4) Composition Consistency from a Multiplicative Recognizer
   8
   9`Foundation.RecognizerInducesLogic` exposed (L4) Composition Consistency
  10as a substantive hypothesis (`Recognizer.RecognizerComposition`). The
  11companion paper `RS_Recognition_Geometry_Logic_Unification.tex` claimed
  12that any compositional recognizer family on a multiplicative event space
  13satisfies (L4) automatically. This module formalises the honest version.
  14
  15## The honest framing
  16
  17The default `Recognizer.cost` is the equality-induced cost (zero on the
  18diagonal, a positive weight elsewhere). On the multiplicative event space
  19`(ℝ_{>0}, ·)`, that cost provably fails (L4) (see
  20`PrimitiveDistinction.composition_consistency_not_definitional`).
  21
  22What this module formalises is the conditional theorem: **if** a recognizer
  23is paired with a continuous Law-of-Logic-satisfying comparison operator
  24`C` whose event space is the positive reals under multiplication, **then**
  25the d'Alembert form of (L4),
  26\[
  27F(xy) + F(x/y) = P\bigl(F(x), F(y)\bigr),
  28\]
  29holds for the derived cost `F(r) := C(r, 1)`, with a polynomial combiner
  30of degree at most two. This is exactly what
  31`LogicAsFunctionalEquation.RouteIndependence` provides.
  32
  33The headline result is therefore: a `MultiplicativeRecognizer` (a
  34recognizer onto the positive reals, equipped with a `SatisfiesLawsOfLogic`
  35operator) automatically satisfies (L4) in its multiplicative form. The
  36substantive hypothesis becomes a derived theorem under the
  37multiplicative-structure assumption.
  38
  39## Honest scope
  40
  41This module derives (L4) for the *specific* multiplicative-event-space
  42carrier, with a continuous Law-of-Logic-satisfying cost. The abstract
  43"every recognizer satisfies (L4)" claim is false: the equality-induced
  44cost on `(ℝ_{>0}, ·)` refutes it. What this module proves is the
  45honest conditional: with the right cost on the right carrier, (L4) is
  46automatic.
  47-/
  48
  49namespace IndisputableMonolith
  50namespace Foundation
  51namespace MultiplicativeRecognizerL4
  52
  53open LogicAsFunctionalEquation
  54open RecognizerInducesLogic
  55open PrimitiveDistinction
  56
  57/-! ## The Multiplicative Recognizer -/
  58
  59/-- A **multiplicative recognizer** is a recognizer whose event space is the
  60positive reals `ℝ_{>0}`, equipped with a continuous comparison operator
  61satisfying the Law of Logic. The structure pairs the geometric recognizer
  62data with the cost-functional data needed to derive (L4) automatically. -/
  63structure MultiplicativeRecognizer (𝒞 : Type*) where
  64  /-- The underlying geometric recognizer onto positive reals. -/
  65  recognizer : Recognizer 𝒞 {x : ℝ // 0 < x}
  66  /-- The continuous comparison operator on positive reals. -/
  67  comparator : ComparisonOperator
  68  /-- The comparator satisfies the Law of Logic (all four Aristotelian
  69      conditions plus scale invariance and non-triviality). -/
  70  laws : SatisfiesLawsOfLogic comparator
  71
  72namespace MultiplicativeRecognizer
  73
  74variable {𝒞 : Type*}
  75
  76/-- The cost function induced by a multiplicative recognizer: the derived
  77cost of its comparator on positive ratios. -/
  78noncomputable def cost (m : MultiplicativeRecognizer 𝒞) : ℝ → ℝ :=
  79  derivedCost m.comparator
  80
  81@[simp] theorem cost_def (m : MultiplicativeRecognizer 𝒞) (r : ℝ) :
  82    m.cost r = m.comparator r 1 := rfl
  83
  84/-! ## L4 in d'Alembert (Multiplicative) Form -/
  85
  86/-- The **multiplicative form of (L4)**: there exists a combiner `P` such
  87that the cost of the product comparison plus the cost of the quotient
  88comparison equals `P` evaluated on the component costs. This is the
  89d'Alembert form of route-independence on positive ratios. -/
  90def MultiplicativeL4 (m : MultiplicativeRecognizer 𝒞) : Prop :=
  91  ∃ P : ℝ → ℝ → ℝ,
  92    ∀ x y : ℝ, 0 < x → 0 < y →
  93      m.cost (x * y) + m.cost (x / y) = P (m.cost x) (m.cost y)
  94
  95/-- A polynomial-degree-2 form of (L4): the combiner is a polynomial of
  96total degree at most two. This is the form the d'Alembert Inevitability
  97Theorem produces. -/
  98def MultiplicativeL4Polynomial (m : MultiplicativeRecognizer 𝒞) : Prop :=
  99  ∃ P : ℝ → ℝ → ℝ,
 100    (∃ a b c d e f : ℝ, ∀ u v, P u v = a + b*u + c*v + d*u*v + e*u^2 + f*v^2) ∧
 101    (∀ u v, P u v = P v u) ∧
 102    (∀ x y : ℝ, 0 < x → 0 < y →
 103      m.cost (x * y) + m.cost (x / y) = P (m.cost x) (m.cost y))
 104
 105/-! ## The Derivation Theorem -/
 106
 107/-- **L4 is automatic in the polynomial form for any multiplicative recognizer.**
 108
 109The route-independence field of `SatisfiesLawsOfLogic` already provides the
 110polynomial-degree-2 combiner satisfying the multiplicative L4. -/
 111theorem multiplicativeRecognizer_satisfies_L4_polynomial
 112    (m : MultiplicativeRecognizer 𝒞) :
 113    MultiplicativeL4Polynomial m := by
 114  obtain ⟨P, hpoly, hsymm, hroute⟩ := m.laws.route_independence
 115  refine ⟨P, hpoly, hsymm, ?_⟩
 116  intro x y hx hy
 117  exact hroute x y hx hy
 118
 119/-- **L4 is automatic in the abstract form for any multiplicative recognizer.**
 120
 121The polynomial form trivially gives the existence form. -/
 122theorem multiplicativeRecognizer_satisfies_L4
 123    (m : MultiplicativeRecognizer 𝒞) :
 124    MultiplicativeL4 m := by
 125  obtain ⟨P, _, _, hroute⟩ := multiplicativeRecognizer_satisfies_L4_polynomial m
 126  exact ⟨P, hroute⟩
 127
 128/-- **The (L4) substantive hypothesis is derivable in the multiplicative case.**
 129
 130This is the headline theorem: the route-independence condition that the
 131companion paper exposed as a hypothesis (`RecognizerComposition`) is in
 132fact a theorem under the multiplicative-event-space structure. -/
 133theorem L4_derivable_on_multiplicative_event_space
 134    (m : MultiplicativeRecognizer 𝒞) :
 135    ∃ P : ℝ → ℝ → ℝ,
 136      ∀ x y : ℝ, 0 < x → 0 < y →
 137        m.cost (x * y) + m.cost (x / y) = P (m.cost x) (m.cost y) :=
 138  multiplicativeRecognizer_satisfies_L4 m
 139
 140/-! ## Companion: The Three Definitional Conditions
 141
 142The multiplicative recognizer also satisfies the three definitional
 143Aristotelian conditions (L1), (L2), and (L3) on its derived cost. These
 144follow directly from the comparator's `SatisfiesLawsOfLogic` certificate.
 145-/
 146
 147/-- **(L1) Identity.** The derived cost vanishes at the multiplicative
 148identity. -/
 149theorem multiplicative_identity (m : MultiplicativeRecognizer 𝒞) :
 150    m.cost 1 = 0 := by
 151  show m.comparator 1 1 = 0
 152  exact m.laws.identity 1 (by norm_num)
 153
 154/-- **(L2) Reciprocal symmetry.** The derived cost is symmetric under
 155reciprocation, a consequence of non-contradiction plus scale invariance. -/
 156theorem multiplicative_reciprocal_symmetry
 157    (m : MultiplicativeRecognizer 𝒞) :
 158    ∀ x : ℝ, 0 < x → m.cost x = m.cost (x⁻¹) := by
 159  intro x hx
 160  show m.comparator x 1 = m.comparator (x⁻¹) 1
 161  -- C(x, 1) = C(1, x) (non-contradiction) = C(x⁻¹, 1) (scale by x⁻¹)
 162  have hsymm : m.comparator x 1 = m.comparator 1 x :=
 163    m.laws.non_contradiction x 1 hx (by norm_num)
 164  have hxinv : (0 : ℝ) < x⁻¹ := inv_pos.mpr hx
 165  have hscale : m.comparator (x⁻¹ * x) (x⁻¹ * 1) = m.comparator x 1 :=
 166    m.laws.scale_invariant x 1 (x⁻¹) hx (by norm_num) hxinv
 167  -- (x⁻¹ * x) = 1 and (x⁻¹ * 1) = x⁻¹
 168  have hxx : x⁻¹ * x = 1 := inv_mul_cancel₀ (ne_of_gt hx)
 169  rw [hxx, mul_one] at hscale
 170  -- so C(1, x⁻¹) = C(x, 1)
 171  -- chain: C(x, 1) = C(1, x) (above), and C(1, x⁻¹) = C(x, 1) gives
 172  -- C(1, x) and C(1, x⁻¹) both equal C(x, 1)... use non-contradiction on x⁻¹
 173  have hsymm2 : m.comparator (x⁻¹) 1 = m.comparator 1 (x⁻¹) :=
 174    m.laws.non_contradiction (x⁻¹) 1 hxinv (by norm_num)
 175  rw [hsymm2, ← hscale]
 176
 177/-! ## Headline Certificate -/
 178
 179/-- **L4-from-Multiplicative-Recognizer Certificate.**
 180
 181(L4) Composition Consistency, in its multiplicative d'Alembert form, is
 182not a hypothesis on a recognizer; it is a derived theorem whenever the
 183recognizer's event space is the positive reals under multiplication and
 184the comparator satisfies the Law of Logic. -/
 185structure L4DerivableCert (𝒞 : Type*) where
 186  l4_from_recognizer :
 187    ∀ m : MultiplicativeRecognizer 𝒞,
 188      ∃ P : ℝ → ℝ → ℝ,
 189        ∀ x y : ℝ, 0 < x → 0 < y →
 190          m.cost (x * y) + m.cost (x / y) = P (m.cost x) (m.cost y)
 191  l4_polynomial_form :
 192    ∀ m : MultiplicativeRecognizer 𝒞,
 193      MultiplicativeL4Polynomial m
 194  identity_at_one :
 195    ∀ m : MultiplicativeRecognizer 𝒞, m.cost 1 = 0
 196  reciprocal_symmetry :
 197    ∀ m : MultiplicativeRecognizer 𝒞,
 198      ∀ x : ℝ, 0 < x → m.cost x = m.cost (x⁻¹)
 199
 200def l4DerivableCert (𝒞 : Type*) : L4DerivableCert 𝒞 where
 201  l4_from_recognizer := fun m => L4_derivable_on_multiplicative_event_space m
 202  l4_polynomial_form := fun m => multiplicativeRecognizer_satisfies_L4_polynomial m
 203  identity_at_one := fun m => multiplicative_identity m
 204  reciprocal_symmetry := fun m => multiplicative_reciprocal_symmetry m
 205
 206theorem l4DerivableCert_inhabited (𝒞 : Type*) :
 207    Nonempty (L4DerivableCert 𝒞) :=
 208  ⟨l4DerivableCert 𝒞⟩
 209
 210end MultiplicativeRecognizer
 211
 212/-! ## Summary
 213
 214The substantive (L4) Composition Consistency condition is no longer an
 215assumed hypothesis on a recognizer. Whenever:
 216
 217* the recognizer's event space is the positive reals under multiplication,
 218* the comparator on that space satisfies the Law of Logic in operator form,
 219
 220then the route-independence field of `SatisfiesLawsOfLogic` directly
 221supplies a polynomial-degree-2 combiner realising (L4). The geometric
 222primitive (recognizer) plus the cost-functional primitive (Law of Logic
 223on positive ratios) jointly force the d'Alembert composition law.
 224
 225This closes the L4 frontier identified by
 226`RecognizerInducesLogic.RecognizerComposition` for the multiplicative case.
 227The substantive content was always in the comparator's compositional
 228structure, not in the recognizer's set-theoretic shape.
 229-/
 230
 231end MultiplicativeRecognizerL4
 232end Foundation
 233end IndisputableMonolith
 234

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