Skip to content

Instantly share code, notes, and snippets.

View afflom's full-sized avatar

Alex Flom afflom

View GitHub Profile
@afflom
afflom / COC-Spec-v3.md
Created June 16, 2025 16:44
UOR + COC

Below is a single, self‑contained specification—the UOR–COC Unified Framework for Integer Factorisation. It subsumes every remark, correction and request you have made so far:

* all earlier axioms that could be proved are now lemmas; * every symbol is typed and every map total; * algorithmic and proof paths are disjoint (soundness by construction); * complexity claims are coupled with precise recurrences; * all floating‑point constants are replaced by exact algebraic values in proofs.

@afflom
afflom / COC-Spec-v2.md
Created June 16, 2025 07:54
Coherence Object Calculus V2 (More defined)

0 Meta‑conventions

  •  = natural numbers 0,1,2,…; ℕ⁺ = positive naturals.
  • Fin n = type of natural numbers < n; elements written ⟨k, k<n⟩.
  • Vec α n = length‑n vectors over type α.
  • multiset α = finite bags (commutative lists) over α.
  • Type universes are implicit; all functions are total unless marked partial.
  • All real constants are exact rationals or algebraic numbers inside proofs; floating‑point is confined to executable code.

@afflom
afflom / coc-example.py
Created June 15, 2025 20:43
Coherence Object Calculus Example in Python
# Computational demonstration of two foundational lemmas in Coherent Object Calculus (COC)
# 1. channel_decomposition_bijective for n up to 1,000,000
# 2. resonance_well_defined for all v in 0..255
# --- Helper definitions mirrored from the spec -------------------------------
def channel_decompose(n: int):
"""Return the base‑256 little‑endian byte list of a positive integer n (n>0)."""
if n <= 0:
raise ValueError("n must be positive")
@afflom
afflom / coherence-object-calculus.md
Created June 15, 2025 20:22
Coherence Object Calculus (COC) Spec

Formal Specification of Coherent Object Calculus (COC)

1. Type System and Basic Definitions

-- Core Types
Type M : Manifold(8)                    -- 8-dimensional smooth manifold
Type Point : M → Type                   -- Points in the manifold
Type TangentSpace : Point → VectorSpace(ℝ, 8)  -- Tangent space at a point
Type CliffordAlgebra : VectorSpace → Type      -- Clifford algebra construction
#!/usr/bin/env python3
"""
Pure UOR — execution + integrity + NTT spectral (lossless full-complex)
=====================================================================
This script implements:
- A dynamic prime cache
- Data and exec opcodes with per-chunk checksum (exp⁶)
- Block framing via prime⁷ headers
- Forward & inverse Number-Theoretic Transform (NTT) mod 13 as a spectral operator
- Automatic inversion ensuring lossless round-trip

Universal Object Reference (UOR) Model Framework

Overview

The models/ directory contains the complete definition of the Universal Object Reference (UOR) framework - a comprehensive model-driven architecture that implements a universal computational substrate based on mathematical principles of prime decomposition and observer invariance.

This repository is exclusively defined in JSON and serves as the canonical source of truth for all UOR models. No scripts or executable code are authorized within this repository - it is a pure definition space where models are defined declaratively and then externally processed.

Core Principles

Universal Object Reference (UOR) Model

The UOR Model provides a meta-mathematical framework for defining and manipulating ontologies using the principles of prime decomposition, observer invariance, and coherence. This document details the model's architecture, implementation, and usage patterns.

Core Principles

The UOR Model embodies the essential principles of the UOR Framework:

  1. Prime Decomposition: Objects are represented through their decomposition into irreducible elements
  2. Observer Invariance: Representations remain consistent across different perspectives
@afflom
afflom / prime-math-lib-spec.md
Created March 31, 2025 04:36
The Prime Framework JavaScript Math Library Specification

Prime Math Library Specification

Introduction

The Prime Math Library is a JavaScript library that implements the Prime Framework for numbers. It provides a comprehensive system for representing and manipulating integers in a base-independent way, ensuring unique, factorization-based representations and geometric consistency. The library introduces Universal Numbers – integers encoded by their complete digit expansions across all bases – and supports operations on these numbers while preserving their intrinsic prime factor structure. It is designed to resemble standard JavaScript math interfaces (like Math and BigInt) in usability, but with far greater precision and structural insight. The specification below details each component of the library, ensuring no ambiguity for implementors and full compliance with Prime Framework principles.

Universal Number Representation

Universal Numbers are the cornerstone of the library. Each natural number ( N ) is represented in a *universal coo

@afflom
afflom / 512-spectral-pivot.md
Last active April 1, 2025 13:49
512-Bit Universal Digest Spectral Conversion System

512 Spectral Adaptive Pivot Coordinate System Specification

Introduction and Overview

The 512 Spectral Adaptive Pivot Coordinate System is a formally defined method for encoding arbitrary-length binary data as a fixed-size 512-bit universal digest and decoding it back to the original data. It leverages the Prime Framework’s intrinsic number representation to achieve lossless compression up to a theoretical 10^10:1 ratio. The system is spectral in that it operates in the prime-factor coordinate domain (treating prime factors as basis frequencies), and adaptive pivot in that it dynamically selects prime “pivot” bases to efficiently map data into the digest. All aspects of this coordinate system are defined using only the Prime Framework’s axioms and constructs (no external number theory), ensuring mathematical rigor and consistency with the framework’s universal number notation.

Key goals and features:

  • Universal Coordinate Mapping: The encoding uses the Prime Framework’s *Un
@afflom
afflom / uhcg.md
Created March 28, 2025 04:20
Universal Hash Codec - Geometric

Universal Hash Codec (UHC) – Geometric Specification

Introduction and Overview

The Universal Hash Codec (UHC) is a formal scheme for encoding natural numbers as unique geometric objects, based on the Universal Object Reference (UOR) framework and the Prime Framework’s intrinsic number embedding. In UOR, each number is represented as a multi-vector in an algebraic fiber, embedding all its possible representations (its universal coordinate tuple) concurrently (4-operator.pdf). The UHC extends this idea by defining a geometric hash function that maps any number to a point on a high-dimensional manifold, using multiple metrics (Euclidean, hyperbolic, and elliptical) to shape the space. Crucially, this mapping is lossless – it can be inverted to recover the original number exactly, preserving referential invariance, base-independence, and intrinsic identity (core UOR