Skip to content

Commit fdc2ae6

Browse files
hyperpolymathclaude
andcommitted
fix(proof-suite): wrap free Parameters in Sections for S3 + S5
S3_second_law.v: four Parameters (State, state_eq_dec, kernel, log2) were global axioms outside any section. Wrapped in Section S3Proof. and converted to Variable — coqc exit 0 confirmed. S5_shannon_source_coding.v: three Parameters (Symbol, symbol_eq_dec, log2) likewise outside any section. Wrapped in Section S5Proof. and converted to Variable — coqc exit 0 confirmed. S1/S2/E3/E5 already have Parameters inside named sections (Mechanics/Electrostatics/BeamMechanics/Carriers) — exempt per panic-attack ProofDrift Section Carrier rule. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c030966 commit fdc2ae6

2 files changed

Lines changed: 21 additions & 7 deletions

File tree

proofs/canonical-proof-suite/S3_second_law.v

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,13 @@ Open Scope Q_scope.
6464
§1 Finite state alphabet
6565
==================================================================== *)
6666

67-
Parameter State : Type.
68-
Parameter state_eq_dec : forall x y : State, {x = y} + {x <> y}.
67+
(* All abstract types and functions are section variables so no global
68+
Parameter axioms are introduced — every theorem is automatically
69+
universally quantified over them when the section closes. *)
70+
Section S3Proof.
71+
72+
Variable State : Type.
73+
Variable state_eq_dec : forall x y : State, {x = y} + {x <> y}.
6974

7075
Lemma state_eq_dec_refl : forall x : State,
7176
exists p : x = x, state_eq_dec x x = left p.
@@ -106,7 +111,7 @@ Definition distribution_prob (d : Distribution) (s : State) : Q :=
106111
We represent it as a function State -> State -> Q for simplicity;
107112
row-stochasticity is a separate hypothesis. *)
108113

109-
Parameter kernel : State -> State -> Q.
114+
Variable kernel : State -> State -> Q.
110115

111116
(* Detailed balance against a stationary distribution pi:
112117
pi(i) * P(j | i) = pi(j) * P(i | j). *)
@@ -128,7 +133,7 @@ Definition kernel_rows_sum_to_one (support_list : list State) : Prop :=
128133

129134
(* Abstract log2 parameter — see module header for the deferred
130135
real-valued layer. *)
131-
Parameter log2 : Q -> Q.
136+
Variable log2 : Q -> Q.
132137

133138
Definition entropy_term (p : Q) : Q := - (p * log2 p).
134139

@@ -288,3 +293,5 @@ Proof. intro d. unfold h_functional. reflexivity. Qed.
288293
End of scaffold. The headline symbol is intentionally not declared
289294
here; see the module header for the deferred work.
290295
==================================================================== *)
296+
297+
End S3Proof.

proofs/canonical-proof-suite/S5_shannon_source_coding.v

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,13 @@ Open Scope Q_scope.
8181
byte-alphabets, or any other finite type.
8282
==================================================================== *)
8383

84-
Parameter Symbol : Type.
85-
Parameter symbol_eq_dec : forall x y : Symbol, {x = y} + {x <> y}.
84+
(* Section variables avoid global Parameter axioms — each theorem is
85+
universally quantified over Symbol, symbol_eq_dec, and log2
86+
automatically when the section closes. *)
87+
Section S5Proof.
88+
89+
Variable Symbol : Type.
90+
Variable symbol_eq_dec : forall x y : Symbol, {x = y} + {x <> y}.
8691

8792
(* The decider on a symbol with itself takes the left branch. We
8893
state this in the existential form because the proof term carried
@@ -185,7 +190,7 @@ Definition expected_length (c : PrefixCode) (d : Distribution) : Q :=
185190
snd sp * nat_to_Q (code_length c (fst sp)))
186191
(support d)).
187192

188-
Parameter log2 : Q -> Q.
193+
Variable log2 : Q -> Q.
189194

190195
Definition entropy_term (p : Q) : Q := - (p * log2 p).
191196

@@ -415,3 +420,5 @@ Qed.
415420
resulting per-symbol bound into the theorem above to recover
416421
the unconditional Shannon source-coding inequality
417422
E[|c|] >= H(d). *)
423+
424+
End S5Proof.

0 commit comments

Comments
 (0)