Supplied finite complex matrix models
DefinitionAPFG3QuantumComplex tensor matrices, density partial traces, phases, Schmidt vectors, pure products, valid effects, explicit separable mixture/Bell orbit and complexdiagonal comparison models. These are stipulated finiteQM primitives, not APF derivations.
import Definitions.Def_APFG3Models
import Mathlib.LinearAlgebra.UnitaryGroup
import Mathlib.Analysis.Complex.Circle
import Mathlib.Analysis.Complex.Order
import Mathlib.LinearAlgebra.Matrix.Kronecker
set_option autoImplicit false
noncomputable section
namespace APFG3
open scoped BigOperators ComplexOrder
abbrev CVec (n : ℕ) := Fin n → ℂ
abbrev CMat (n : ℕ) := Matrix (Fin n) (Fin n) ℂ
abbrev Joint (n m : ℕ) := Matrix (Fin n × Fin m) (Fin n × Fin m) ℂ
def tensor {n m : ℕ} (a : CMat n) (b : CMat m) : Joint n m :=
fun i j => a i.1 j.1 * b i.2 j.2
def pureDensity {I : Type*} (v : I → ℂ) : Matrix I I ℂ := fun i j => v i * star (v j)
def reducedA {n m : ℕ} (ρ : Joint n m) : CMat n := fun i j => ∑ k, ρ (i,k) (j,k)
def reducedB {n m : ℕ} (ρ : Joint n m) : CMat m := fun i j => ∑ k, ρ (k,i) (k,j)
def conjugate {I : Type*} [Fintype I] (u ρ : Matrix I I ℂ) : Matrix I I ℂ := u*ρ*u.conjTranspose
def unitaryMatrix {n : ℕ} (u : CMat n) : Prop := u*u.conjTranspose=1 ∧ u.conjTranspose*u=1
def localA {n m : ℕ} (u : CMat n) (ρ : Joint n m) : Joint n m := conjugate (tensor u (1:CMat m)) ρ
def diagonalWeights {n : ℕ} (w : Vec n) : CMat n := Matrix.diagonal (fun i => (w i:ℂ))
def phaseMatrix {n : ℕ} (z : Fin n → Circle) : CMat n := Matrix.diagonal (fun i => (z i:ℂ))
def schmidt {n : ℕ} (w : Vec n) : Fin n × Fin n → ℂ :=
fun i => if i.1=i.2 then (Real.sqrt (w i.1):ℂ) else 0
def productVector {n m : ℕ} (v : Fin n × Fin m → ℂ) : Prop :=
∃ a : CVec n, ∃ b : CVec m, ∀ i j, v (i,j) = a i*b j
def normalizedVector {I : Type*} [Fintype I] (v : I → ℂ) : Prop := ∑ i, Complex.normSq (v i) = 1
def effect {I : Type*} [Fintype I] [DecidableEq I] (e : Matrix I I ℂ) : Prop :=
e.PosSemidef ∧ (1-e).PosSemidef
def sigmaPlus : CMat 2 := !![4/5,2/5;2/5,1/5]
def sigmaMinus : CMat 2 := !![4/5,-2/5;-2/5,1/5]
def ket0 : CVec 2 := ![1,0]
def ket1 : CVec 2 := ![0,1]
def pauliX : CMat 2 := !![0,1;1,0]
def pauliZ : CMat 2 := !![1,0;0,-1]
def mixedSeparable : Joint 2 2 := (1/2:ℂ) •
(tensor sigmaPlus (pureDensity ket0)+tensor sigmaMinus (pureDensity ket1))
def mixedAfter : Joint 2 2 := localA pauliZ mixedSeparable
def bell : Fin 2 × Fin 2 → ℂ := schmidt ![1/2,1/2]
def bellOrbit : Set (Joint 2 2) := {ρ | ∃ u : Matrix.unitaryGroup (Fin 2) ℂ,
ρ = localA (u : CMat 2) (pureDensity bell)}
def complexDiagonalState (h : Fin 4) : Matrix Pair4 Pair4 ℂ :=
Matrix.diagonal (fun x => (c4Prep h x.1 x.2 : ℂ))
def complexDiagonalEffect (a b : ℝ) (j : Fin 4) : Matrix Pair4 Pair4 ℂ :=
Matrix.diagonal (fun x => (c4Value a b (x.1-x.2-j) : ℂ))
end APFG3
Read-back
What the Lean code literally says, in plain math · Exact runtime model identifier unavailable; independent reviewer RV-spine (01a082f2-417c-79c1-9069-c35844067fde).
Defines finite complex coordinate and joint matrices, tensor product, pure outer-product density, partial traces, unitary conjugation and local A action. Supplies diagonal weights, phase matrices, positive-root diagonal Schmidt vectors, product-vector and normalization predicates, positive effects bounded by identity, explicit pure2x2 sigma states and their separable mixture/local-Z image, Bell state/unitary orbit, and complex diagonal C4 states/effects. No theorem axioms or assumed conclusions. Independent code-first reading by RV-spine. Earlier written-source exposure and required personal paper/code consultation disclosed; this is not fully blind. Open theorem proofs remain sorry. Source-equivalence scope is governed by SOURCE_EQUIVALENCE_REVIEW.json, including G3-04 limits.