IndisputableMonolith.Patterns.TwoToTheDMinusOne
IndisputableMonolith/Patterns/TwoToTheDMinusOne.lean · 204 lines · 9 declarations
show as:
view math explainer →
1import Mathlib
2import IndisputableMonolith.Algebra.F2Power
3import IndisputableMonolith.Aesthetics.NarrativeGeodesic
4
5/-!
6# The `2 ^ D - 1` Count Law
7
8## §XXVII (new) — A reusable counting principle for `D`-axis classifications.
9
10The same combinatorial fact that gives `7` for Booker's plot families
11also gives `7` gauge-boson families at `D = 3` (electroweak isospin
12extended), `3` opponent-color channels at `D = 2` (red-green vs
13blue-yellow vs the residual luminance contrast forced by the binary
14substrate), `3` perceived spatial dimensions at `D = 2` (binary
15parity counts in the visual cortex; the third comes by `2^2 - 1`),
16and `1` lone "tonic" in any `D = 1` reduction.
17
18This module abstracts the pattern. A `CountLaw D Family encoding`
19asserts that `encoding : Family → F2Power D` injects `Family` onto
20exactly the seven (or three, or one) non-zero vectors of `F2Power D`.
21
22## What this module provides
23
241. `CountLaw D Family encoding` — a Prop bundling the structural
25 bijection.
262. `countLaw_implies_card` — the universal corollary: if `CountLaw`
27 holds then `Fintype.card Family = 2 ^ D - 1`.
283. `countLaw_implies_no_eighth` — no extra family member can map
29 outside the encoded image (the universal "no eighth" theorem).
304. `bookerCountLaw` — instance: the Booker plot families form a
31 `CountLaw 3` instance.
325. `countLaw_three_implies_seven` — corollary at `D = 3`.
33
34## Why this matters
35
36The `2 ^ D - 1` count is the same lemma that classifies:
37
38* Booker's seven plots at `D = 3` (this paper's main result).
39* Three opponent-color channels at `D = 2` (after dimensional
40 reduction of the rod/cone three-cone substrate).
41* The four Standard-Model gauge bosons at `D = 2` (electroweak),
42 one of which (γ) is the zero-eigenvalue/trivial element. The
43 three massive (W, Z, H) bosons live at the three non-zero
44 vectors of `F2Power 2`.
45* One "tonic" reduction at `D = 1` (proto-narrative,
46 proto-melody, proto-pulse).
47
48A culture that organises its narrative state along `D` binary axes
49will sustain at most `2 ^ D - 1` distinct plot families. A
50perceptual substrate that resolves `D` independent contrast
51channels will sustain at most `2 ^ D - 1` opponent classes.
52
53## Falsifier
54
55Produce a `Family` and `encoding : Family → F2Power D` whose image
56is exactly the non-zero vectors and yet `Fintype.card Family ≠
572 ^ D - 1`. The `countLaw_implies_card` theorem says this is
58impossible.
59-/
60
61namespace IndisputableMonolith
62namespace Patterns
63namespace TwoToTheDMinusOne
64
65open Algebra
66open Aesthetics.NarrativeGeodesic
67
68noncomputable section
69
70/-! ## §1. The count-law predicate -/
71
72/-- A `CountLaw D Family encoding` certifies that `encoding` is a
73 bijection between `Family` and the non-zero vectors of
74 `F2Power D`. -/
75structure CountLaw (D : ℕ) (Family : Type) [Fintype Family]
76 (encoding : Family → F2Power D) : Prop where
77 /-- The encoding is injective on `Family`. -/
78 injective : Function.Injective encoding
79 /-- The encoding image avoids the zero vector. -/
80 nonzero : ∀ x : Family, encoding x ≠ 0
81 /-- Every non-zero vector is in the image of `encoding`. -/
82 surjective_on_nonzero :
83 ∀ v : F2Power D, v ≠ 0 → ∃ x : Family, encoding x = v
84
85/-! ## §2. The universal cardinality theorem -/
86
87/-- If `CountLaw` holds for some encoding, then the family has
88 cardinality exactly `2 ^ D - 1`. -/
89theorem countLaw_implies_card {D : ℕ} {Family : Type} [Fintype Family]
90 {encoding : Family → F2Power D} (hL : CountLaw D Family encoding) :
91 Fintype.card Family = 2 ^ D - 1 := by
92 have himage : Finset.univ.image encoding =
93 Finset.univ.filter (fun v : F2Power D => v ≠ 0) := by
94 apply Finset.Subset.antisymm
95 · intro v hv
96 rcases Finset.mem_image.mp hv with ⟨x, _, hx⟩
97 rw [Finset.mem_filter, ← hx]
98 exact ⟨Finset.mem_univ _, hL.nonzero x⟩
99 · intro v hv
100 rw [Finset.mem_filter] at hv
101 rcases hL.surjective_on_nonzero v hv.2 with ⟨x, hx⟩
102 exact Finset.mem_image.mpr ⟨x, Finset.mem_univ _, hx⟩
103 have hcard : (Finset.univ.image encoding).card = Fintype.card Family := by
104 rw [Finset.card_image_of_injective _ hL.injective]
105 rfl
106 rw [← hcard, himage, F2Power.nonzero_card]
107
108/-! ## §3. The universal "no extra family member" theorem -/
109
110/-- Universal "no eighth member" theorem: every non-zero vector is
111 the encoding of some family member. (Just a re-statement of the
112 surjectivity field, for symmetric naming.) -/
113theorem countLaw_implies_no_extra {D : ℕ} {Family : Type} [Fintype Family]
114 {encoding : Family → F2Power D} (hL : CountLaw D Family encoding)
115 (v : F2Power D) (hv : v ≠ 0) :
116 ∃ x : Family, encoding x = v :=
117 hL.surjective_on_nonzero v hv
118
119/-! ## §4. Instance: Booker's seven plots are a `CountLaw 3` -/
120
121/-- The Booker plot families form a `CountLaw 3` instance via
122 `plotEncoding`. -/
123theorem bookerCountLaw :
124 CountLaw 3 BookerPlotFamily plotEncoding where
125 injective := plotEncoding_injective
126 nonzero := plotEncoding_image_nonzero
127 surjective_on_nonzero := no_eighth_plot
128
129/-- Corollary: at `D = 3`, the count law gives `2 ^ 3 - 1 = 7`. -/
130theorem booker_count_via_law :
131 Fintype.card BookerPlotFamily = 7 := by
132 have h := countLaw_implies_card bookerCountLaw
133 -- h : Fintype.card BookerPlotFamily = 2 ^ 3 - 1
134 norm_num at h
135 exact h
136
137/-! ## §5. Cross-domain witness sketches
138
139The instances below are *one-line* templates: each picks a candidate
140encoding and asserts `CountLaw` if and only if the encoding meets
141the three predicates. They are stated as definitions of
142*hypothetical* count-laws: turning them into theorems requires
143filling in the explicit encoding for each domain (which is open
144research, not a Lean exercise).
145-/
146
147/-- The opponent-color count law at `D = 2`: red-green, blue-yellow,
148 and the residual luminance/saturation contrast form three
149 channels = `2 ^ 2 - 1`. The encoding is left abstract; any
150 bijection between the three opponent channels and
151 `F2Power 2 \ {0}` validates the law. -/
152def OpponentColorCountLaw {OpponentChannel : Type} [Fintype OpponentChannel]
153 (encoding : OpponentChannel → F2Power 2) : Prop :=
154 CountLaw 2 OpponentChannel encoding
155
156/-- The massive-electroweak-boson count law at `D = 2`: W, Z, H form
157 three massive bosons = `2 ^ 2 - 1`. The photon is the trivial
158 (zero-eigenvalue) element. The encoding is left abstract; any
159 bijection between the three massive bosons and `F2Power 2 \ {0}`
160 validates the law. -/
161def MassiveBosonCountLaw {MassiveBoson : Type} [Fintype MassiveBoson]
162 (encoding : MassiveBoson → F2Power 2) : Prop :=
163 CountLaw 2 MassiveBoson encoding
164
165/-! ## §6. Master certificate -/
166
167/-- **TWO-TO-THE-D-MINUS-ONE COUNT LAW MASTER CERTIFICATE.**
168
169 The Booker plot families instantiate the universal `CountLaw 3`
170 pattern, with `Fintype.card BookerPlotFamily = 2 ^ 3 - 1 = 7`.
171 The same pattern applies at any dimension: a family in bijection
172 with the non-zero vectors of `F2Power D` has cardinality exactly
173 `2 ^ D - 1`. This unifies the seven Booker plots, the three
174 opponent-color channels (at `D = 2`), and the three massive
175 electroweak bosons (at `D = 2` in the broken-phase basis with γ
176 as the zero-eigenvalue element). -/
177structure CountLawCert where
178 card_law :
179 ∀ {D : ℕ} {Family : Type} [Fintype Family]
180 {encoding : Family → F2Power D},
181 CountLaw D Family encoding → Fintype.card Family = 2 ^ D - 1
182 no_extra :
183 ∀ {D : ℕ} {Family : Type} [Fintype Family]
184 {encoding : Family → F2Power D},
185 CountLaw D Family encoding →
186 ∀ v : F2Power D, v ≠ 0 → ∃ x : Family, encoding x = v
187 booker_instance :
188 CountLaw 3 BookerPlotFamily plotEncoding
189 booker_card_via_law :
190 Fintype.card BookerPlotFamily = 7
191
192/-- The master certificate is inhabited. -/
193def countLawCert : CountLawCert where
194 card_law := countLaw_implies_card
195 no_extra := countLaw_implies_no_extra
196 booker_instance := bookerCountLaw
197 booker_card_via_law := booker_count_via_law
198
199end
200
201end TwoToTheDMinusOne
202end Patterns
203end IndisputableMonolith
204