IndisputableMonolith.Information.ErrorCorrectionCodesFromJCost
IndisputableMonolith/Information/ErrorCorrectionCodesFromJCost.lean · 61 lines · 7 declarations
show as:
view math explainer →
1import Mathlib
2import IndisputableMonolith.Constants
3
4/-!
5# Error-Correction Codes from J-Cost — B16 Information Theory Depth
6
7Five canonical ECC families (= configDim D = 5):
8 repetition, Hamming, BCH/Reed-Solomon, LDPC, polar.
9
10Each family has a threshold rate (Shannon capacity fraction) on the
11φ-ladder: adjacent-family threshold ratio = 1/φ (deeper family = closer
12to capacity).
13
14Maximum achievable rate = 1 (Shannon limit). Any rate r < 1 decodable
15iff J(1/(1 - r)) < canonical band J(φ) ∈ (0.11, 0.13).
16
17Lean status: 0 sorry, 0 axiom.
18-/
19
20namespace IndisputableMonolith.Information.ErrorCorrectionCodesFromJCost
21open Constants
22
23inductive ECCFamily where
24 | repetition
25 | hamming
26 | bchReedSolomon
27 | ldpc
28 | polar
29 deriving DecidableEq, Repr, BEq, Fintype
30
31theorem eccFamily_count : Fintype.card ECCFamily = 5 := by decide
32
33/-- Decoding threshold gap 1 - r on the φ-ladder: deeper family = smaller gap. -/
34noncomputable def thresholdGap (k : ℕ) : ℝ := 1 / phi ^ k
35
36theorem thresholdGap_pos (k : ℕ) : 0 < thresholdGap k := by
37 unfold thresholdGap
38 exact div_pos one_pos (pow_pos phi_pos k)
39
40theorem thresholdGap_strictDecr (k : ℕ) :
41 thresholdGap (k + 1) < thresholdGap k := by
42 unfold thresholdGap
43 have hpos_k : (0 : ℝ) < phi ^ k := pow_pos phi_pos k
44 have h_growth : phi ^ k < phi ^ (k + 1) := by
45 rw [pow_succ]
46 have h1 : 1 < phi := one_lt_phi
47 nlinarith
48 exact one_div_lt_one_div_of_lt hpos_k h_growth
49
50structure ECCCert where
51 five_families : Fintype.card ECCFamily = 5
52 threshold_always_pos : ∀ k, 0 < thresholdGap k
53 threshold_strictly_decreasing : ∀ k, thresholdGap (k + 1) < thresholdGap k
54
55noncomputable def eccCert : ECCCert where
56 five_families := eccFamily_count
57 threshold_always_pos := thresholdGap_pos
58 threshold_strictly_decreasing := thresholdGap_strictDecr
59
60end IndisputableMonolith.Information.ErrorCorrectionCodesFromJCost
61