Skip to content
1 change: 1 addition & 0 deletions .github/workflows/mathcan-proof-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
lake env lean MathCan/TOEMultipletKinetics.lean | tee -a mathcan-axioms.txt
lake env lean MathCan/TOETripletJordan.lean | tee -a mathcan-axioms.txt
lake env lean MathCan/FiniteHorizonGap.lean | tee -a mathcan-axioms.txt
lake env lean MathCan/DeletionMemory.lean | tee -a mathcan-axioms.txt
if grep -Eq 'sorryAx|ofReduceBool' mathcan-axioms.txt; then
echo 'Admitted proof or native reduction axiom detected.'
exit 1
Expand Down
1 change: 1 addition & 0 deletions MathCan.lean
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ import MathCan.TOETensorConstraints
import MathCan.TOEMultipletKinetics
import MathCan.TOETripletJordan
import MathCan.FiniteHorizonGap
import MathCan.DeletionMemory
93 changes: 93 additions & 0 deletions MathCan/DeletionMemory.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import Init

/-!
# DMB-01: finite deletion deck witness and terminal decoding obstruction

A small kernel-checked bridge for the deletion-memory campaign in
Compactification Theory PR #112. These lemmas do not formalize the
OpenAI #122 superpolynomial trace lower bound or the OpenAI #140
Gaussian streaming theorem.

Words are represented by bit values at positions 0..3; the test words
0110 and 1001 correspond to natural numbers 6 and 9. A deletion mask
retains bit positions where its bit is true. All 16 masks are enumerated.
-/

namespace MathCan.DeletionMemory

set_option maxRecDepth 8192
set_option maxHeartbeats 800000

/-- A deterministic terminal decoder cannot correctly decode two
different inputs if their terminal compressed states collide. -/
theorem correct_decoder_separates
{Source Memory : Type}
(encode : Source → Memory) (decode : Memory → Source)
{x y : Source}
(hx : decode (encode x) = x)
(hy : decode (encode y) = y)
(hxy : x ≠ y) : encode x ≠ encode y := by
intro h
apply hxy
calc
x = decode (encode x) := hx.symm
_ = decode (encode y) := congrArg decode h
_ = y := hy

/-- Exact ordinary deletion trace of a four-position word.
The mask is hidden; only the resulting ordered bits remain. -/
def trace4 (source mask : Nat) : List Bool :=
((List.range 4).filter fun i => mask.testBit i).map fun i => source.testBit i

/-- Number of deletion masks leading to the observed trace. -/
def deckCount4 (source : Nat) (trace : List Bool) : Nat :=
((List.range 16).filter fun mask => trace4 source mask == trace).length

/-- The seven distinct binary strings of length at most two. -/
def shortTraces : List (List Bool) :=
[[], [false], [true], [false,false], [false,true],
[true,false], [true,true]]

/-- The eight possible three-bit traces. -/
def threeTraces : List (List Bool) :=
[[false,false,false], [false,false,true],
[false,true,false], [false,true,true],
[true,false,false], [true,false,true],
[true,true,false], [true,true,true]]

/-- The two four-bit strings have equal deletion-deck multiplicities
for EVERY trace of length at most two. -/
theorem short_decks_identical :
∀ t ∈ shortTraces, deckCount4 6 t = deckCount4 9 t := by
decide

/-- All length-three trace supports of the two sources are disjoint. -/
theorem three_decks_disjoint :
∀ t ∈ threeTraces, deckCount4 6 t = 0 ∨ deckCount4 9 t = 0 := by
decide

/-- There are four masks retaining exactly three out of four bits. -/
theorem three_deck_mass_count_left :
((threeTraces.map (deckCount4 6)).sum) = 4 := by
decide

theorem three_deck_mass_count_right :
((threeTraces.map (deckCount4 9)).sum) = 4 := by
decide

/-- There is one four-bit unredacted trace per source. -/
theorem full_trace_count_left :
deckCount4 6 [false,true,true,false] = 1 := by decide

theorem full_trace_count_right :
deckCount4 9 [true,false,false,true] = 1 := by decide

#print axioms correct_decoder_separates
#print axioms short_decks_identical
#print axioms three_decks_disjoint
#print axioms three_deck_mass_count_left
#print axioms three_deck_mass_count_right
#print axioms full_trace_count_left
#print axioms full_trace_count_right

end MathCan.DeletionMemory
18 changes: 18 additions & 0 deletions research/compactification/DMB01_FORMAL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# DMB-01: deletion memory barrier, Lean bridge

Research companion to [Compactification Theory PR #112](https://github.com/MoralityLabAI/Compactification-Theory/pull/112).

OpenAI Math #122 addresses worst-case deletion trace reconstruction. OpenAI Math #140 addresses Gaussian streaming memory/precision. The primary theory note combines their constraints with new finite-state cardinality, data-processing, deletion-deck and angular-cap arguments.

This MathCan file checks *finite discrete* pieces in Lean 4 / Init:

- A correct deterministic terminal decoder must assign distinct states to two distinct source words.
- All seven possible deletion traces of length <=2 have identical counts for 0110 and 1001, with positions 0..3 counted by deletion masks.
- All eight length-three trace supports of those two words are disjoint.
- Each source has four length-three deletion-mask paths and one fully retained trace.

The source channel probability at deletion q=4/5 is computed independently in exact Fraction Python. The probability theorem TV=17/625 and m-fold Le Cam bounds are paper proofs with finite rational checks, not Lean theorems here.

The new Lean lemmas use ordinary decide reduction, without sorry or native_decide. CI builds MathCan and prints all transitive axioms.

This file deliberately does not claim that the original asymptotic OpenAI math theorems have been kernel-verified by this project.
Loading