Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions LeanPool/CatalyticRegisters/DigitSumDichotomy.lean
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace Catalytic

@[expose] public section

/-! ## 1. Literal 2-Register Passive-Output Model over `𝔽_p` (Vinciguerra Def. 2.2) -/
/-! ## 1. Passive-output instructions and formal polynomial semantics over `𝔽_p` -/

/--
A primitive instruction of a passive-output 2-register program over `𝔽_p`
Expand Down Expand Up @@ -965,8 +965,9 @@ theorem char_p_two_access_unbounded_degree (p m : Nat) (hp : IsPrime p) :
have := hp.1; omega
· simp [hdm] at hne

/-- **Corollary T1b (Exact `𝔽_2` Saturation — `x^3` is Uncomputable in 2 Registers for ALL `t`):**
Over `𝔽_2`, `x^3 ∉ RP^{pass}_{𝔽_2}(2, t)` for EVERY `t : Nat`! -/
/-- **Corollary T1b (Exact `𝔽_2` Saturation — formal `x^3` is impossible in two registers):**
Over `𝔽_2`, `x^3 ∉ RP^{pass}_{𝔽_2}(2, t)` as a formal polynomial for every `t : Nat`.
As a function on `𝔽_2`, `x^3` agrees with `x`. -/
theorem char_2_two_reg_x3_impossible (t : Nat) : ¬ InRPPass2 2 t (monomial 3) := by
intro hmem
have hs3 : digitSum 2 3 = 2 := by
Expand Down
22 changes: 11 additions & 11 deletions LeanPool/CatalyticRegisters/ExtensionFieldSeparation.lean
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ public import LeanPool.CatalyticRegisters.PrimeFieldTools
/-!
# Theorem T1e: Sharpness of the Prime-Field Hypothesis over `𝔽_4`

Theorem `T1` (`Catalytic.DigitSumDichotomy`) proves that over every **prime field** `𝔽_p`,
`f ∈ RP^{pass}_{𝔽_p}(2, t)` iff every monomial degree `d ≥ 2` in `f` satisfies
`s_p(d) ≤ min (p - 1) (t - 1)`. In particular, over `𝔽_2` (`p = 2`), BOTH `x^3` (`s_2(3) = 2`)
and `x^5` (`s_2(5) = 2`) are impossible for every `t`.
Theorem `T1` (`Catalytic.DigitSumDichotomy`) proves that over every **prime field** `𝔽_p`
and for each access budget `t ≥ 1`, `f ∈ RP^{pass}_{𝔽_p}(2, t)` exactly when every monomial
degree `d ≥ 2` in `f` satisfies `s_p(d) ≤ min (p - 1) (t - 1)`. Over `𝔽_2`, `x^3` and `x^5`
are impossible as formal polynomial outputs at any budget.

This module constructs the finite extension field `𝔽_4 = 𝔽_2[ω] / (ω^2 + ω + 1)` as a
concrete 4-element `Char2CRing` and formalizes the literal Vinciguerra Def. 2.2 passive-output
2-register model over `𝔽_4[O, R, x]`, proving **Theorem T1e (Extension-Field Separation)**:
concrete four-element `Char2CRing`. It uses the passive-output instruction set of
Vinciguerra's Definition 2.2 with formal polynomial identities in `𝔽_4[O, R, x]`.
**Theorem T1e (Extension-Field Separation)** gives:
1. `x^5 ∈ RP^{pass}_{𝔽_4}(2, 3)` AND `x^5 ∉ RP^{pass}_{𝔽_4}(2, 2)` (exact `t_min = 3`, via `ω^2 u^5 + ω (u + x)^5 + (u + ω x)^5 = x^5`),
2. `x^3 ∈ RP^{pass}_{𝔽_4}(2, 4)` AND `x^3 ∉ RP^{pass}_{𝔽_4}(2, 3)` (exact `t_min = 4`, via `u^3 + (u + x)^3 + (u + ω x)^3 + (u + ω^2 x)^3 = x^3`),
3. `∀ t : Nat, x^7 ∉ RP^{pass}_{𝔽_4}(2, t)` (because `α^7 = α` for every `α ∈ 𝔽_4`, so any clean
program necessarily has `[x^7] ΔO = [R^6 x] ΔO = 0`).

This proves inside Lean 4.35 (with zero Mathlib and zero extra axioms) that the prime-field
restriction in Theorem `T1` is sharp while extension fields still exhibit absolute impossibility
barriers.
The prime-field restriction in Theorem `T1` is sharp. The exclusion of `x^7` over `𝔽_4`
is about formal polynomials. As a function on `𝔽_4`, `x^7` agrees with `x`.
-/

namespace Catalytic
Expand Down Expand Up @@ -103,10 +103,10 @@ theorem GF4.z_pow_succ (n : Nat) : GF4.pow .z (n + 1) = .z := rfl
theorem GF4.pow7_eq_self (a : GF4) : GF4.pow a 7 = a := by
cases a <;> rfl

/-! ## 2. Literal 2-Register Passive-Output Model over `𝔽_4[O, R, x]` -/
/-! ## 2. Formal 2-Register Passive-Output Model over `𝔽_4[O, R, x]` -/

/--
Literal Vinciguerra Def. 2.2 passive-output 2-register instruction over `𝔽_4`
Passive-output 2-register instruction over `𝔽_4` from Vinciguerra's Definition 2.2
(identical instruction set to `Pass2Instr` in `Catalytic.DigitSumDichotomy`):
* `addOut poly`: `O ← O + ∑_k poly[k] * R^k` (0 input accesses)
* `addWorkConst c`: `R ← R + c` (0 input accesses)
Expand Down
4 changes: 2 additions & 2 deletions LeanPool/CatalyticRegisters/ThreeRegisterBreakthrough.lean
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Catalytic

universe u

/-- **Theorem T3a (`x^7 ∈ RP^{pass}_R(3, 5)` whenever `576` is invertible, i.e. `char ≠ 2, 3`).** -/
/-- **Theorem T3a (`x^7 ∈ RP^{pass}_R(3, 5)` whenever `576` is a unit in `R`).** -/
theorem three_reg_5call_x7 {R : Type u} [CRing R]
(inv576 : R) (hinv : inv576 * CRing.intCast 576 = 1) :
Pass3Prog.accesses (Pass3Prog.scaleOut inv576 prog5Power7) = 5 ∧
Expand All @@ -30,7 +30,7 @@ theorem three_reg_5call_x7 {R : Type u} [CRing R]
⟨by rw [Pass3Prog.scaleOut_accesses]; exact prog5_x7_accesses,
fun x o u v => exec3Poly_certifies_monic prog5Power7 7 576 prog5_x7_cert inv576 hinv x o u v⟩

/-- **Theorem T3b (`x^9 ∈ RP^{pass}_R(3, 6)` whenever `382500000` is invertible, i.e. `char ∉ {2,3,5,17}`).** -/
/-- **Theorem T3b (`x^9 ∈ RP^{pass}_R(3, 6)` whenever `382500000` is a unit in `R`).** -/
theorem three_reg_6call_x9 {R : Type u} [CRing R]
(invD : R) (hinv : invD * CRing.intCast 382500000 = 1) :
Pass3Prog.accesses (Pass3Prog.scaleOut invD prog6Power9) = 6 ∧
Expand Down
13 changes: 7 additions & 6 deletions LeanPool/projects/catalytic-registers.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
slug: catalytic-registers
title: Passive catalytic register programs over finite fields and commutative rings
summary: Characterizes polynomials computable with two passive catalytic
registers over a prime field using digit sums of their formal exponents.
summary: Characterizes formal polynomial identities computable with two
passive catalytic registers and prime-field constants using base-p digit sums.
It verifies explicit three-register powering programs, composes them into
a four-register construction, and proves exact costs and clean restoration
for a balanced multilinear product program with a sufficiently large pool of
Expand All @@ -25,14 +25,15 @@ main_declarations:
main_results:
- declaration: Catalytic.rp_pass_two_iff
informal: For a prime p and input-access budget t ≥ 1, a formal polynomial
over the prime field is computable by a clean passive two-register program
exactly when each exponent at least two with nonzero coefficient has
over the prime field is computable as a formal identity by a clean passive
two-register program with prime-field constants exactly when each exponent
at least two with nonzero coefficient has
base-p digit sum at most min(p − 1, t − 1).
- declaration: Catalytic.four_reg_powering_x13
informal: For N ≥ 1, under the stated invertibility conditions on the
certificate coefficient and two factorials, the radix-13 construction
computes the Nth power with four registers. For ℓ the number of base-13
digits of N minus one, three times the access count is less than 104 · 8^ℓ.
computes the Nth power with four registers. Let ℓ be one less than the
number of base-13 digits of N. Three times the access count is less than 104 · 8^ℓ.
- declaration: Catalytic.balancedProdProg_clean
informal: With sign +1, the balanced product program adds the product of
2^k inputs to its target and restores every other register. The work
Expand Down
Loading