Skip to content

Instantly share code, notes, and snippets.

@afflom
Created July 15, 2025 22:27
Show Gist options
  • Save afflom/61b2c2f9c62fadf40df5abdd6edeabc6 to your computer and use it in GitHub Desktop.
Save afflom/61b2c2f9c62fadf40df5abdd6edeabc6 to your computer and use it in GitHub Desktop.
Modular Structural Arithmetic

Modular Structural Arithmetic (MSA)

1. Language and Signature

1.1 Extended Signature

MSA extends the language L_SA of Structural Arithmetic with:

New Functions:

  • mod_p(x): reduction of x modulo p
  • ρ_p(x): modular role function under modulus p

New Relations:

  • ≡_p: congruence modulo p
  • ~_p: structural equivalence modulo p
  • ⊳_p: modular preservation relation

New Predicates:

  • SP(p): p is a structural-preserving modulus
  • DP(p): p is a doubling-preserving modulus
  • RP(p): p is a role-preserving modulus

2. Axioms of Modular Structural Arithmetic

2.1 Basic Modular Axioms (extending SA)

All axioms SA1-SA19 of Structural Arithmetic, plus:

MSA1: ∀x,y,p [(x ≡_p y) ↔ ∃k (x = y + kp)]

MSA2: ∀x,p [0 ≤ mod_p(x) < p]

MSA3: ∀x,y,p [(x ≡_p y) → (δ(x) ≡_p δ(y))] (Doubling respects congruence)

2.2 Structural Preservation Axioms

MSA4 (Doubling Preservation): DP(p) ↔ [mod_p(γ) ≠ 0 ∧ mod_p(δ(γ)) = δ(mod_p(γ)) ∧ mod_p(δ(μ)) = δ(mod_p(μ))]

MSA5 (Role Preservation): RP(p) ↔ [mod_p(γ) ≠ mod_p(μ) ∧ mod_p(μ) ≠ mod_p(ε) ∧ mod_p(γ) ≠ mod_p(ε)]

MSA6 (Structural Preservation): SP(p) ↔ [DP(p) ∧ RP(p)]

2.3 Special Moduli Axioms

MSA7 (The 11-Theorem): DP(11) ∧ mod_11(γ) = 2 ∧ mod_11(μ) = 4 ∧ mod_11(ε) = 8

MSA8 (The 7-Vanishing): mod_7(γ + μ + ε) = 0 ∧ mod_7(γ) = 3 ∧ mod_7(μ) = 6 ∧ mod_7(ε) = 5

MSA9 (Prime Characterization): ∀p [Prime(p) ∧ p > 3 → (DP(p) ↔ (p ≡ 1 (mod 12) ∨ p ≡ 11 (mod 12)))]

2.4 Modular Role Axioms

MSA10: ∀x,p [Gen_p(x) ↔ ∃y (Gen(y) ∧ x ≡_p y)]

MSA11: ∀x,p [Med_p(x) ↔ ∃y (Med(y) ∧ x ≡_p y)]

MSA12: ∀x,p [Man_p(x) ↔ ∃y (Man(y) ∧ x ≡_p y)]

2.5 Resonance Axioms

MSA13 (Modular Resonance): ∀x,p [mod_p(x) ~_p mod_p(δ(x)) → ∃k < p (δ^k(mod_p(x)) ≡_p mod_p(x))]

MSA14 (Resonance Period): ∀p [SP(p) → ∃r > 0 (∀x δ^r(x) ≡_p x ∧ ∀s < r ∃y δ^s(y) ≢_p y)]

2.6 Modular Induction Schema

MSA15: For any formula φ(x,p): [φ(γ,p) ∧ SP(p) ∧ (∀x)(Gen(x) ∧ φ(x,p) → φ(δ(x),p))] → (∀x)(x ∈ Struct → φ(mod_p(x),p))

3. Inference Rules

3.1 Inherited Rules

All inference rules from SA apply.

3.2 Modular-Specific Rules

Modular Modus Ponens: From x ≡_p y and φ(x), infer φ(y) when φ preserves congruence

Modular Role Transfer: From Gen(x) and SP(p), infer Gen_p(mod_p(x))

Chinese Remainder: From x ≡_p a and x ≡_q b where gcd(p,q) = 1, infer unique x mod pq

4. Key Theorems

Theorem M1: Classification of Doubling-Preserving Primes

Statement: A prime p > 3 preserves doubling iff p ≡ ±1 (mod 12).

Proof: For p to preserve doubling, we need:

  • 2 × 24 ≡ 48 (mod p)
  • 2 × 48 ≡ 96 (mod p)

This is automatic unless p | 48 or p | 96. Since p is prime > 3, we need p ∤ 48. The primes not dividing 48 are exactly those with p ≡ ±1 (mod 12). ∎

Theorem M2: The Vanishing Sum Theorem

Statement: γ + μ + ε ≡ 0 (mod p) iff p | 168.

Proof: γ + μ + ε = 24 + 48 + 96 = 168. Therefore γ + μ + ε ≡ 0 (mod p) iff 168 ≡ 0 (mod p) iff p | 168. Since 168 = 2³ × 3 × 7, the divisors are products of {2, 3, 7}. ∎

Theorem M3: Modular Cascade Periodicity

Statement: For any SP(p), the modular doubling cascade starting from any x has period dividing p-1.

Proof: In the multiplicative group (ℤ/pℤ)*, doubling corresponds to squaring. By Lagrange's theorem, the order of any element divides |group| = p-1. Therefore the cascade must return to its starting point within p-1 steps. ∎

Theorem M4: The 11-Cascade Theorem

Statement: The cascade (2, 4, 8, 5, 10, 9, 7, 3, 6, 1) has maximal period 10 in ℤ/11ℤ.

Proof: Starting with 2:

  • 2 × 2 ≡ 4 (mod 11)
  • 4 × 2 ≡ 8 (mod 11)
  • 8 × 2 ≡ 16 ≡ 5 (mod 11)
  • 5 × 2 ≡ 10 (mod 11)
  • 10 × 2 ≡ 20 ≡ 9 (mod 11)
  • 9 × 2 ≡ 18 ≡ 7 (mod 11)
  • 7 × 2 ≡ 14 ≡ 3 (mod 11)
  • 3 × 2 ≡ 6 (mod 11)
  • 6 × 2 ≡ 12 ≡ 1 (mod 11)
  • 1 × 2 ≡ 2 (mod 11)

Period = 10 = p-1, which is maximal. ∎

Theorem M5: Structural Equivalence Classes

Statement: For SP(p), the number of distinct structural equivalence classes mod p is at most 3.

Proof: By MSA5, SP(p) implies the three values mod_p(γ), mod_p(μ), mod_p(ε) are distinct. By MSA10-12, every structural number mod p falls into one of these three classes. Therefore there are exactly 3 structural equivalence classes when p is structural-preserving. ∎

5. Models and Semantics

5.1 Standard Model

The standard model M_MSA extends M_SA with:

  • Domain: ℕ × {set of primes}
  • mod_p interpreted as standard modular reduction
  • Congruence relations interpreted standardly

5.2 Quotient Models

For each prime p, we get a quotient model M_SA/p where:

  • Domain: ℤ/pℤ
  • Operations inherited from M_SA via modular reduction
  • Structural roles assigned via MSA10-12

6. Relationship to Other Systems

6.1 MSA as Extension of SA

MSA is a conservative extension of SA:

  • Every SA theorem remains true in MSA
  • MSA adds modular reasoning without changing SA's base theory

6.2 Connection to Group Theory

For each SP(p), we get a group action:

  • G = ⟨δ⟩ acts on ℤ/pℤ
  • Orbits correspond to structural classes
  • Stabilizers reveal resonance structure

6.3 Number-Theoretic Connections

MSA connects to:

  • Quadratic residues (via doubling)
  • Primitive roots (via maximal periods)
  • Artin's conjecture (density of good moduli)

7. Decidability of MSA

7.1 MSA₀: The Decidable Fragment

Restrict MSA to:

  • Bounded moduli (p ≤ N)
  • No unbounded quantification over primes
  • Only doubling operation (no general multiplication)

Theorem: MSA₀ is decidable via reduction to finite model checking.

7.2 Full MSA

Full MSA inherits undecidability from SA due to unrestricted multiplication. However, many modular questions are decidable:

  • "Is p doubling-preserving?" - YES (check finite conditions)
  • "What is the period mod p?" - YES (compute until cycle)
  • "∀p SP(p) → φ(p)" - Generally NO (quantifies over all primes)

8. Applications

8.1 Computational

  • Optimized modular arithmetic: Use SP(p) for efficient structural computations
  • Hash functions: Moduli preserving structural properties give good distribution
  • Parallel algorithms: Period lengths determine work distribution

8.2 Theoretical

  • Classification of primes: By their structural preservation properties
  • Modular forms: Connection via resonance periods
  • Algebraic number theory: Structural behavior in extensions

9. Open Questions

  1. Density of SP primes: What fraction of primes are structural-preserving?
  2. Higher cascades: Do longer cascades have modular preservation?
  3. Composite moduli: When do composite numbers preserve structure?
  4. Galois connections: Relationship between field extensions and structural preservation?

10. Conclusion

Modular Structural Arithmetic provides a rich framework for understanding how structural properties behave under modular reduction. The interplay between the doubling cascade and modular arithmetic reveals deep connections to group theory, number theory, and computational applications.

Key insights:

  • Modulus 11 perfectly preserves doubling structure
  • Modulus 7 reveals sum relationships
  • Different moduli act as "lenses" revealing different structural properties
  • The theory connects abstract structural properties to concrete computational optimizations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment