Skip to content

Commit 4e93b73

Browse files
hyperpolymathclaude
andcommitted
proofs(quantum): WIP bit-rot repair (scope, omega->lia, axiom ordering)
Not yet compiling — banking progress (long thread, timeout-prone): - QME: omega->lia (x3); qubit_dim lia-pow guarded (unfold+simpl); hadamard entries forced %R (C_scope captured real `/`); (k>=..)%nat - QuantumCNO: declared `Parameter Cexp`; removed 4 axioms now PROVED in CNO.Complex (Cmult_1_l/assoc, Cconj_RtoC/mult); moved global_phase axiom after its gate def; `exists (-θ)%R` Remaining: QME:167 (apply_matrix_2), QuantumCNO:194 (Cexp_add rewrite shape) — see PROOF-STATUS-2026-05-18.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f2217ee commit 4e93b73

2 files changed

Lines changed: 29 additions & 24 deletions

File tree

proofs/coq/quantum/QuantumCNO.v

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Axiom temperature_positive : temperature > 0.
4242

4343
(** Dimension of Hilbert space (2^n for n qubits) *)
4444
Parameter dim : nat.
45-
Axiom dim_positive : dim > 0.
45+
Axiom dim_positive : (dim > 0)%nat.
4646

4747
(** Complex vector representing quantum state *)
4848
Definition QuantumState : Type := nat -> C.
@@ -130,6 +130,12 @@ Axiom CNOT_gate_unitary : is_unitary CNOT_gate.
130130

131131
(** ** Quantum State Equality *)
132132

133+
(** Complex exponential. The quantum proofs use it abstractly via the
134+
axioms below (Cexp_zero/neg/add, Cconj_Cexp). Declared as a parameter
135+
so it is in scope before first use. Recorded as an assumption in
136+
PROOF-STATUS-2026-05-18.md (post-T0 axiom audit). *)
137+
Parameter Cexp : C -> C.
138+
133139
(** Two quantum states are equal up to global phase *)
134140
Definition quantum_state_eq (ψ φ : QuantumState) : Prop :=
135141
exists θ : R, forall n, ψ n = Cexp (RtoC θ) * φ n.
@@ -149,24 +155,15 @@ Axiom Cexp_neg : forall x : R, Cexp (RtoC (-x)) = Cinv (Cexp (RtoC x)).
149155
(** e^x × e^y = e^{x+y} *)
150156
Axiom Cexp_add : forall x y : R, Cexp (RtoC x) * Cexp (RtoC y) = Cexp (RtoC (x + y)).
151157

152-
(** 1 × z = z *)
153-
Axiom Cmult_1_l : forall z : C, C1 * z = z.
154-
155-
(** Complex multiplication associativity *)
156-
Axiom Cmult_assoc : forall a b c : C, a * (b * c) = (a * b) * c.
158+
(* Cmult_1_l, Cmult_assoc, Cconj_RtoC, Cconj_mult are now PROVED lemmas
159+
in CNO.Complex — no longer axioms (strengthens the development and
160+
removes the redeclaration clash). *)
157161

158162
(** Complex conjugate of exponential: (e^x)* = e^{x*} *)
159163
Axiom Cconj_Cexp : forall x : C, Cconj (Cexp x) = Cexp (Cconj x).
160164

161-
(** Conjugate of real is identity: (r)* = r *)
162-
Axiom Cconj_RtoC : forall r : R, Cconj (RtoC r) = RtoC r.
163-
164-
(** (a × b)* = a* × b* *)
165-
Axiom Cconj_mult : forall a b : C, Cconj (a * b) = Cconj a * Cconj b.
166-
167-
(** Global phase gates are unitary (standard quantum mechanics result) *)
168-
Axiom global_phase_unitary :
169-
forall θ : R, is_unitary (global_phase_gate θ).
165+
(* `global_phase_unitary` axiom moved below, after `global_phase_gate`
166+
is defined (it referenced the gate before its definition). *)
170167

171168
(** Reflexivity, symmetry, transitivity *)
172169
Lemma quantum_state_eq_refl : forall ψ, ψ =q= ψ.
@@ -184,7 +181,7 @@ Qed.
184181
Lemma quantum_state_eq_sym : forall ψ φ, ψ =q= φ -> φ =q= ψ.
185182
Proof.
186183
intros ψ φ [θ H].
187-
exists (-θ).
184+
exists (-θ)%R.
188185
intros n.
189186
(* ψ_n = e^θ × φ_n, so φ_n = e^{-θ} × ψ_n *)
190187
specialize (H n).
@@ -257,6 +254,11 @@ Qed.
257254
Definition global_phase_gate (θ : R) : QuantumGate :=
258255
fun ψ n => Cexp (RtoC θ) * ψ n.
259256

257+
(** Global phase gates are unitary (standard QM result). Assumption —
258+
see PROOF-STATUS-2026-05-18.md (post-T0 axiom audit). *)
259+
Axiom global_phase_unitary :
260+
forall θ : R, is_unitary (global_phase_gate θ).
261+
260262
Theorem global_phase_is_cno :
261263
forall θ : R, is_quantum_CNO (global_phase_gate θ).
262264
Proof.

proofs/coq/quantum/QuantumMechanicsExact.v

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Definition qubit_dim (n : nat) : nat := 2 ^ n.
5555
(** A quantum state is a vector in C^(2^n) *)
5656
(** We represent it as a function from basis indices to complex amplitudes *)
5757
Definition QuantumState (n : nat) : Type :=
58-
{ψ : nat -> C | forall k, k >= qubit_dim n -> ψ k = C0}.
58+
{ψ : nat -> C | forall k, (k >= qubit_dim n)%nat -> ψ k = C0}.
5959

6060
(** Extract the amplitude function *)
6161
Definition amplitude {n : nat} (ψ : QuantumState n) : nat -> C :=
@@ -87,14 +87,16 @@ Definition is_normalized {n : nat} (ψ : QuantumState n) : Prop :=
8787
Definition ket_0 : QuantumState 1.
8888
Proof.
8989
exists (fun k => match k with 0 => C1 | _ => C0 end).
90-
intros k Hk. destruct k. omega. destruct k. omega. reflexivity.
90+
intros k Hk. unfold qubit_dim in Hk; simpl in Hk.
91+
destruct k as [|[|k]]; [ lia | lia | reflexivity ].
9192
Defined.
9293

9394
(** |1⟩ = (0, 1) *)
9495
Definition ket_1 : QuantumState 1.
9596
Proof.
9697
exists (fun k => match k with 1 => C1 | _ => C0 end).
97-
intros k Hk. destruct k. omega. destruct k. omega. reflexivity.
98+
intros k Hk. unfold qubit_dim in Hk; simpl in Hk.
99+
destruct k as [|[|k]]; [ lia | lia | reflexivity ].
98100
Defined.
99101

100102
(** ** Pauli Matrices (Exact 2x2 Matrices) *)
@@ -148,10 +150,10 @@ Definition identity_2 : Matrix2 :=
148150
[1 -1] *)
149151
Definition hadamard : Matrix2 :=
150152
fun i j => match i, j with
151-
| 0, 0 => (1 / sqrt 2, 0)
152-
| 0, 1 => (1 / sqrt 2, 0)
153-
| 1, 0 => (1 / sqrt 2, 0)
154-
| 1, 1 => (-1 / sqrt 2, 0)
153+
| 0, 0 => ((1 / sqrt 2)%R, 0%R)
154+
| 0, 1 => ((1 / sqrt 2)%R, 0%R)
155+
| 1, 0 => ((1 / sqrt 2)%R, 0%R)
156+
| 1, 1 => ((-1 / sqrt 2)%R, 0%R)
155157
| _, _ => C0
156158
end.
157159

@@ -168,7 +170,8 @@ Proof.
168170
(Cmult (M 1 1) (amplitude ψ 1))
169171
| _ => C0
170172
end).
171-
intros k Hk. destruct k. omega. destruct k. omega.
173+
intros k Hk. unfold qubit_dim in Hk; simpl in Hk.
174+
destruct k as [|[|k]]; [ lia | lia | ].
172175
simpl. reflexivity.
173176
Defined.
174177

0 commit comments

Comments
 (0)