October 2026 · Preprint

The PPT² conjecture through a qutrit: diagonal-unitary twirls when the coherence matrix has rank at most two

Abstract

The PPT2 conjecture asserts that composites of PPT (completely positive and completely copositive) maps are entanglement breaking. We test it on composites through a qutrit, Ψ ∘ Φ with Φ: Md → M3 and Ψ: M3 → Md, by twirling their Choi matrix W over the local diagonal unitaries D ⊗ D̄: the twirl is separable exactly when no D ⊗ D̄-invariant entanglement witness detects W. Our main result is that for every d the twirl is separable when the coherence matrix of W, its compression to the span of the vectors |ii⟩, has rank at most 2. In some cases the proof uses the theorem that composites of PPT maps through a qubit are entanglement breaking (the qubit theorem); given it, invariant witnesses cannot exhibit a counterexample at coherence rank at most 2. A peeling operation, which splits an entanglement-breaking part off one factor, extends the result to higher coherence rank whenever repeated peeling and removal of zero rows reach rank at most 2 or outer dimension at most 3. At d = 4 and coherence rank 3 the four matrices of the Gram form satisfy one linear relation; when it has a zero coefficient, the twirl is separable, and the proof uses a rigidity theorem for rank-four PPT entangled states of two qutrits.

In plain words

This paper concerns Christandl’s PPT-squared conjecture, that two PPT quantum operations applied in turn leave no entanglement, with a three-level system between the operations. The paper averages the combined operation over random phases, a step that keeps only part of the operation’s data, and proves that the averaged operation leaves no entanglement whenever a small table of that data, the coherence matrix, has rank at most two. Averaging can remove entanglement, so this result is weaker than the conjecture itself. Part of the proof uses K. Henry’s 2026 proof for a two-level middle system.

A 16 by 16 grid of grey squares divided into 4 by 4 blocks. Sixteen magenta squares sit at the crossings of rows and columns 1, 6, 11 and 16, and the remaining twelve squares of the main diagonal are teal.
Illustration of the twirl in the paper for outer dimension d = 4. The grid stands for the 16 × 16 Choi matrix W of a composite Ψ ∘ Φ of PPT maps through a qutrit, with rows and columns in the order of the product basis |11⟩, |12⟩, …, |44⟩ and with thin lines between the blocks of equal first index. Averaging over the local diagonal unitaries D ⊗ D̄ keeps only the coloured entries: the 16 entries between the vectors |ii⟩ (magenta), which form the coherence matrix, and the rest of the diagonal (teal). The paper proves that the twirl is separable whenever the coherence matrix has rank at most 2, for every d, using the qubit theorem in some cases.

Formal statement and axioms

Each main result as stated in Lean, copied verbatim from the published package, with the axioms that the proof rests on. Lean v4.35.0-rc3, Mathlib c55e6e786f49. The package.

TwirlCert.T13.finrank_face_rhoT_k

Computational fact †13 (Theorem 7.10(a)): kernel-only

theorem finrank_face_rhoT_k : Module.finrank ℝ (face rhoTC) = 1
Definitions used in the statement
def face (ρ : Matrix (m × n) (m × n) ℂ) : Submodule ℝ (Matrix (m × n) (m × n) ℂ) where
  carrier := {X | X.IsHermitian ∧ LinearMap.range X.mulVecLin ≤ LinearMap.range ρ.mulVecLin ∧
    LinearMap.range (ptA X).mulVecLin ≤ LinearMap.range (ptA ρ).mulVecLin}
  add_mem' := by
    rintro X Y ⟨hX, hX1, hX2⟩ ⟨hY, hY1, hY2⟩
    refine ⟨hX.add hY, ?_, ?_⟩
    · rintro _ ⟨v, rfl⟩
      simp only [Matrix.mulVecLin_apply, Matrix.add_mulVec]
      exact Submodule.add_mem _ (hX1 ⟨v, rfl⟩) (hY1 ⟨v, rfl⟩)
    · rintro _ ⟨v, rfl⟩
      simp only [Matrix.mulVecLin_apply, ptA_add, Matrix.add_mulVec]
      exact Submodule.add_mem _ (hX2 ⟨v, rfl⟩) (hY2 ⟨v, rfl⟩)
  zero_mem' := by
    refine ⟨Matrix.isHermitian_zero, ?_, ?_⟩
    · rintro _ ⟨v, rfl⟩
      simp only [Matrix.mulVecLin_apply, Matrix.zero_mulVec]
      exact Submodule.zero_mem _
    · rintro _ ⟨v, rfl⟩
      have : ptA (0 : Matrix (m × n) (m × n) ℂ) = 0 := by ext x y; rfl
      simp only [Matrix.mulVecLin_apply, this, Matrix.zero_mulVec]
      exact Submodule.zero_mem _
  smul_mem' := by
    rintro c X ⟨hX, hX1, hX2⟩
    have hc : (c • X) = (c : ℂ) • X := by ext i j; simp
    refine ⟨?_, ?_, ?_⟩
    · rw [hc]
      unfold Matrix.IsHermitian
      rw [Matrix.conjTranspose_smul, hX.eq]
      congr 1
      exact Complex.conj_ofReal c
    · rintro _ ⟨v, rfl⟩
      simp only [Matrix.mulVecLin_apply, hc, Matrix.smul_mulVec]
      exact Submodule.smul_mem _ _ (hX1 ⟨v, rfl⟩)
    · rintro _ ⟨v, rfl⟩
      simp only [Matrix.mulVecLin_apply, hc, ptA_smul, Matrix.smul_mulVec]
      exact Submodule.smul_mem _ _ (hX2 ⟨v, rfl⟩)
noncomputable abbrev rhoTC : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℂ := rhoT.map (Rat.castHom ℂ)
def ptA {R : Type*} (M : Matrix (m × n) (m × n) R) : Matrix (m × n) (m × n) R :=
  Matrix.of fun x y => M (y.1, x.2) (x.1, y.2)
def rhoT : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℚ := (1 / 4 : ℚ) • (1 - ∑ k, projT k)
def projT (k : Fin 5) : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℚ :=
  (1 / (tw k ⬝ᵥ tw k)) • vecMulVec (tw k) (tw k)
def tw (k : Fin 5) : Fin 3 × Fin 3 → ℚ := fun x => tu k x.1 * tv k x.2
def tu : Fin 5 → Fin 3 → ℚ := ![![1, 0, 0], ![1, -1, 0], ![0, 0, 1], ![0, 1, -1], ![1, 1, 1]]
def tv : Fin 5 → Fin 3 → ℚ := ![![1, -1, 0], ![0, 0, 1], ![0, 1, -1], ![1, 0, 0], ![1, 1, 1]]

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T13/KFace.lean:L69-L69.

Axioms, as Lean reports them. Recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L812.

AXREPORT KERNEL TwirlCert.T13.finrank_face_rhoT_k : [propext, Classical.choice, Quot.sound]

TwirlCert.T13.cycle3_k

Computational fact †13 (Theorem 7.10(b), d = 3): kernel-only

theorem cycle3_k : A3 0 2 * A3 2 1 * A3 1 0 = 4586699 / 27648 ∧ |B3 0 2 * B3 2 1 * B3 1 0| = 1159140625 / 2985984 ∧
    (4586699 / 27648 : ℚ) < 1159140625 / 2985984
Definitions used in the statement
def A3 : Matrix (Fin 3) (Fin 3) ℚ :=
  !![1321/96, 9895/324, 389/36; 907/96, 7463/648, 833/36; 183/32, 13/8, 91/4]
def B3 : Matrix (Fin 3) (Fin 3) ℚ :=
  !![1321/96, 10025/864, -625/96; 10025/864, 7463/648, -185/36; -625/96, -185/36, 91/4]

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T13/K.lean:L70-L71.

Axioms, as Lean reports them. Recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L774.

AXREPORT KERNEL TwirlCert.T13.cycle3_k : [propext, Classical.choice, Quot.sound]

TwirlCert.T13.cycle4_k

Computational fact †13 (Theorem 7.10(b), d = 4): kernel-only

theorem cycle4_k : A4 0 2 * A4 2 1 * A4 1 0 = 4586699 / 27648 ∧ |B4 0 2 * B4 2 1 * B4 1 0| = 1159140625 / 2985984 ∧
    (4586699 / 27648 : ℚ) < 1159140625 / 2985984
Definitions used in the statement
def A4 : Matrix (Fin 4) (Fin 4) ℚ :=
  !![1321/96, 9895/324, 389/36, 4951/1296; 907/96, 7463/648, 833/36, 3805/1296;
     183/32, 13/8, 91/4, 31/16; 363/32, 419/24, 79/4, 145/48]
def B4 : Matrix (Fin 4) (Fin 4) ℚ :=
  !![1321/96, 10025/864, -625/96, 1501/576; 10025/864, 7463/648, -185/36, 391/432;
     -625/96, -185/36, 91/4, 5/3; 1501/576, 391/432, 5/3, 145/48]

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T13/K.lean:L72-L73.

Axioms, as Lean reports them. Recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L777.

AXREPORT KERNEL TwirlCert.T13.cycle4_k : [propext, Classical.choice, Quot.sound]
17 more formal statements

TwirlCert.TCS.trB_rho4_rank_k

The outer local ranks stated after Theorem 7.10 (d = 4): kernel-only

theorem trB_rho4_rank_k : (trB (rho4.map (Rat.castHom ℂ))).rank = 3
Definitions used in the statement
def rho4 := filt X4 Yf
def filt {d : ℕ} (F : Matrix (Fin d) (Fin 3) ℚ) (G : Matrix (Fin 3) (Fin 3) ℚ) :
    Matrix (Fin d × Fin 3) (Fin d × Fin 3) ℚ :=
  (F ⊗ₖ G) * rhoT * (F ⊗ₖ G)ᵀ
def X4 : Matrix (Fin 4) (Fin 3) ℚ := !![2, 1, -1; 0, 1, -2; 2, -1, 2; 1, 1, 1]
def Yf : Matrix (Fin 3) (Fin 3) ℚ := !![1, -1, 1; -1, 0, -1; -1, 2, 1]
def rhoT : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℚ := (1 / 4 : ℚ) • (1 - ∑ k, projT k)
def projT (k : Fin 5) : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℚ :=
  (1 / (tw k ⬝ᵥ tw k)) • vecMulVec (tw k) (tw k)
def tw (k : Fin 5) : Fin 3 × Fin 3 → ℚ := fun x => tu k x.1 * tv k x.2
def tu : Fin 5 → Fin 3 → ℚ := ![![1, 0, 0], ![1, -1, 0], ![0, 0, 1], ![0, 1, -1], ![1, 1, 1]]
def tv : Fin 5 → Fin 3 → ℚ := ![![1, -1, 0], ![0, 0, 1], ![0, 1, -1], ![1, 0, 0], ![1, 1, 1]]

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/TCS/K.lean:L25-L25.

Axioms, as Lean reports them. Recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L3916.

AXREPORT KERNEL TwirlCert.TCS.trB_rho4_rank_k : [propext, Classical.choice, Quot.sound]

TwirlCert.T14b.KFspec_d3

Computational fact †14, interval part (Theorem 7.11, d = 3): with compiled code

theorem KFspec_d3 (k s : Fin 4 → Fin 3 × Fin 3 → ℂ) (hk : IsSpecKraus JPhi3 k) (hs : IsSpecKraus JPsi3 s) :
    ratioN JPhi3 JPsi3 k s 0 2 ∈ Set.Ico (1.2880251913 : ℝ) 1.2880251914 ∧
    ratioN JPhi3 JPsi3 k s 1 2 ∈ Set.Ico (1.3796978034 : ℝ) 1.3796978035
Definitions used in the statement
structure IsSpecKraus (J : Matrix ι ι ℂ) (k : Fin r → ι → ℂ) : Prop where
  sum_eq : J = ∑ p, vecMulVec (k p) (star (k p))
  orth : ∀ p q, p ≠ q → ip (k p) (k q) = 0
  ne_zero : ∀ p, k p ≠ 0
noncomputable def JPhi3 : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℂ := JPhi3Q.map gq
noncomputable def JPsi3 : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℂ := JPsi3Q.map gq
noncomputable def ratioN {d r r' : ℕ} (J K : Matrix (Fin d × Fin 3) (Fin d × Fin 3) ℂ) (k : Fin r → Fin d × Fin 3 → ℂ)
    (s : Fin r' → Fin d × Fin 3 → ℂ) (i j : Fin d) : ℝ :=
  Nval k s i j / Real.sqrt ((Acoef J K i j).re * (Acoef J K j i).re)
abbrev GQ := QuadraticAlgebra ℚ (-1) 0
def JPhi3Q : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) GQ := (filtXI ⊗ₖ filtYI) * rhoT * (filtXI ⊗ₖ filtYI)ᵀ
noncomputable def gq : GQ →+* ℂ :=
  (QuadraticAlgebra.lift (A := ℂ) ⟨Complex.I, I_mul_I_gq⟩ : GQ →ₐ[ℚ] ℂ).toRingHom
def JPsi3Q : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) GQ := (filtZI ⊗ₖ filtY2I) * rhoT * (filtZI ⊗ₖ filtY2I)ᵀ
noncomputable def Nval {m n : Type*} [Fintype n] {r r' : ℕ} (k : Fin r → m × n → ℂ) (s : Fin r' → m × n → ℂ)
    (i j : m) : ℝ :=
  ∑ p, ∑ q, ‖ip (bv (k p) i) (bv (s q) i)‖ * ‖ip (bv (k p) j) (bv (s q) j)‖
def Acoef {R : Type*} [CommRing R] (J K : Matrix (Fin d × Fin n) (Fin d × Fin n) R) (i j : Fin d) : R :=
  ∑ x, ∑ y, J (i, x) (i, y) * K (j, y) (j, x)
def filtXI : Matrix (Fin 3) (Fin 3) GQ := !![2, 1, -1; 0, 1, -2; 2, -1, 2]
def filtYI : Matrix (Fin 3) (Fin 3) GQ := !![1, -1, 1; -1, 0, -1; -1, 2, 1]
def rhoT : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) GQ := (1 / 4 : ℚ) • (1 - projSum tilesU)
def filtZI : Matrix (Fin 3) (Fin 3) GQ := !![2, 0, 1; 2, -1, 0; 2, 2, 2]
def filtY2I : Matrix (Fin 3) (Fin 3) GQ := !![-2, -2, -2; 2, 1, 0; 0, 0, -2]
def ip (x y : ι → ℂ) : ℂ := ∑ i, star (x i) * y i
def bv (x : m × n → ℂ) (a : m) : n → ℂ := fun i => x (a, i)
def projSum {ι : Type*} [Fintype ι] {K : ℕ} (u : Fin K → ι → GQ) : Matrix ι ι GQ :=
  ∑ k, (nsqQ (u k))⁻¹ • vecMulVec (u k) (star (u k))
def tilesU : Fin 5 → Fin 3 × Fin 3 → GQ :=
  ![kvec (e3 0) (e3 0 - e3 1), kvec (e3 0 - e3 1) (e3 2), kvec (e3 2) (e3 1 - e3 2), kvec (e3 1 - e3 2) (e3 0),
    kvec one3 one3]
def nsqQ (x : ι → GQ) : ℚ := ∑ i, nq (x i)
def kvec {m n : Type*} (x : m → GQ) (y : n → GQ) : m × n → GQ := fun p => x p.1 * y p.2
def e3 (i : Fin 3) : Fin 3 → GQ := fun j => if i = j then 1 else 0
def one3 : Fin 3 → GQ := fun _ => 1
def nq (z : GQ) : ℚ := z.re * z.re + z.im * z.im

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T14b/KFspec.lean:L55-L57.

Axioms, as Lean reports them: propext, Classical.choice, Quot.sound and 5 more, for example TwirlCert.T14b.D3.chk13._native.native_decide.ax_1_1, TwirlCert.T14b.D3.chk23._native.native_decide.ax_1_1 and TwirlCert.T14b.D3.chkJ._native.native_decide.ax_1_1. Each of these 5 axioms comes from a check that runs as compiled code (native_decide). The full report is recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L1241-L1246.

TwirlCert.T14b.KFspec_d4

Computational fact †14, interval part (Theorem 7.11, d = 4): with compiled code

theorem KFspec_d4 (k s : Fin 4 → Fin 4 × Fin 3 → ℂ) (hk : IsSpecKraus JPhi4 k) (hs : IsSpecKraus JPsi4 s) :
    ratioN JPhi4 JPsi4 k s 0 2 ∈ Set.Ico (1.2927712568 : ℝ) 1.2927712569 ∧
    ratioN JPhi4 JPsi4 k s 1 2 ∈ Set.Ico (1.4323694730 : ℝ) 1.4323694731
Definitions used in the statement
structure IsSpecKraus (J : Matrix ι ι ℂ) (k : Fin r → ι → ℂ) : Prop where
  sum_eq : J = ∑ p, vecMulVec (k p) (star (k p))
  orth : ∀ p q, p ≠ q → ip (k p) (k q) = 0
  ne_zero : ∀ p, k p ≠ 0
noncomputable def JPhi4 : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) ℂ := JPhi4Q.map gq
noncomputable def JPsi4 : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) ℂ := JPsi4Q.map gq
noncomputable def ratioN {d r r' : ℕ} (J K : Matrix (Fin d × Fin 3) (Fin d × Fin 3) ℂ) (k : Fin r → Fin d × Fin 3 → ℂ)
    (s : Fin r' → Fin d × Fin 3 → ℂ) (i j : Fin d) : ℝ :=
  Nval k s i j / Real.sqrt ((Acoef J K i j).re * (Acoef J K j i).re)
abbrev GQ := QuadraticAlgebra ℚ (-1) 0
def JPhi4Q : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) GQ := (filtXI4 ⊗ₖ filtYI) * rhoT * (filtXI4 ⊗ₖ filtYI)ᵀ
noncomputable def gq : GQ →+* ℂ :=
  (QuadraticAlgebra.lift (A := ℂ) ⟨Complex.I, I_mul_I_gq⟩ : GQ →ₐ[ℚ] ℂ).toRingHom
def JPsi4Q : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) GQ := (filtZI4 ⊗ₖ filtY2I) * rhoT * (filtZI4 ⊗ₖ filtY2I)ᵀ
noncomputable def Nval {m n : Type*} [Fintype n] {r r' : ℕ} (k : Fin r → m × n → ℂ) (s : Fin r' → m × n → ℂ)
    (i j : m) : ℝ :=
  ∑ p, ∑ q, ‖ip (bv (k p) i) (bv (s q) i)‖ * ‖ip (bv (k p) j) (bv (s q) j)‖
def Acoef {R : Type*} [CommRing R] (J K : Matrix (Fin d × Fin n) (Fin d × Fin n) R) (i j : Fin d) : R :=
  ∑ x, ∑ y, J (i, x) (i, y) * K (j, y) (j, x)
def filtXI4 : Matrix (Fin 4) (Fin 3) GQ := !![2, 1, -1; 0, 1, -2; 2, -1, 2; 1, 1, 1]
def filtYI : Matrix (Fin 3) (Fin 3) GQ := !![1, -1, 1; -1, 0, -1; -1, 2, 1]
def rhoT : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) GQ := (1 / 4 : ℚ) • (1 - projSum tilesU)
def filtZI4 : Matrix (Fin 4) (Fin 3) GQ := !![2, 0, 1; 2, -1, 0; 2, 2, 2; 1, 0, 1]
def filtY2I : Matrix (Fin 3) (Fin 3) GQ := !![-2, -2, -2; 2, 1, 0; 0, 0, -2]
def ip (x y : ι → ℂ) : ℂ := ∑ i, star (x i) * y i
def bv (x : m × n → ℂ) (a : m) : n → ℂ := fun i => x (a, i)
def projSum {ι : Type*} [Fintype ι] {K : ℕ} (u : Fin K → ι → GQ) : Matrix ι ι GQ :=
  ∑ k, (nsqQ (u k))⁻¹ • vecMulVec (u k) (star (u k))
def tilesU : Fin 5 → Fin 3 × Fin 3 → GQ :=
  ![kvec (e3 0) (e3 0 - e3 1), kvec (e3 0 - e3 1) (e3 2), kvec (e3 2) (e3 1 - e3 2), kvec (e3 1 - e3 2) (e3 0),
    kvec one3 one3]
def nsqQ (x : ι → GQ) : ℚ := ∑ i, nq (x i)
def kvec {m n : Type*} (x : m → GQ) (y : n → GQ) : m × n → GQ := fun p => x p.1 * y p.2
def e3 (i : Fin 3) : Fin 3 → GQ := fun j => if i = j then 1 else 0
def one3 : Fin 3 → GQ := fun _ => 1
def nq (z : GQ) : ℚ := z.re * z.re + z.im * z.im

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T14b/KFspec.lean:L76-L78.

Axioms, as Lean reports them: propext, Classical.choice, Quot.sound and 5 more, for example TwirlCert.T14b.D4.chk13._native.native_decide.ax_1_1, TwirlCert.T14b.D4.chk23._native.native_decide.ax_1_1 and TwirlCert.T14b.D4.chkJ._native.native_decide.ax_1_1. Each of these 5 axioms comes from a check that runs as compiled code (native_decide). The full report is recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L1247-L1252.

TwirlCert.T14b.KFspec_upb

Computational fact †14, interval part (Theorem 7.11, the pair M4 → M3 → M4 with full local ranks): with compiled code

theorem KFspec_upb (k s : Fin 6 → Fin 4 × Fin 3 → ℂ) (hk : IsSpecKraus JPhiU k) (hs : IsSpecKraus JPsiU s) :
    ratioN JPhiU JPsiU k s 0 1 ∈ Set.Ico (21.270550181 : ℝ) 21.270550182
Definitions used in the statement
structure IsSpecKraus (J : Matrix ι ι ℂ) (k : Fin r → ι → ℂ) : Prop where
  sum_eq : J = ∑ p, vecMulVec (k p) (star (k p))
  orth : ∀ p q, p ≠ q → ip (k p) (k q) = 0
  ne_zero : ∀ p, k p ≠ 0
noncomputable def JPhiU : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) ℂ := JPhiUQ.map gq
noncomputable def JPsiU : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) ℂ := JPsiUQ.map gq
noncomputable def ratioN {d r r' : ℕ} (J K : Matrix (Fin d × Fin 3) (Fin d × Fin 3) ℂ) (k : Fin r → Fin d × Fin 3 → ℂ)
    (s : Fin r' → Fin d × Fin 3 → ℂ) (i j : Fin d) : ℝ :=
  Nval k s i j / Real.sqrt ((Acoef J K i j).re * (Acoef J K j i).re)
abbrev GQ := QuadraticAlgebra ℚ (-1) 0
def JPhiUQ : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) GQ :=
  (sqMat 4 UPBData.filtX ⊗ₖ sqMat 3 UPBData.filtY) * rhoU * (sqMat 4 UPBData.filtX ⊗ₖ sqMat 3 UPBData.filtY)ᴴ
noncomputable def gq : GQ →+* ℂ :=
  (QuadraticAlgebra.lift (A := ℂ) ⟨Complex.I, I_mul_I_gq⟩ : GQ →ₐ[ℚ] ℂ).toRingHom
def JPsiUQ : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) GQ :=
  (sqMat 4 UPBData.filtZ ⊗ₖ sqMat 3 UPBData.filtY2) * rhoU * (sqMat 4 UPBData.filtZ ⊗ₖ sqMat 3 UPBData.filtY2)ᴴ
noncomputable def Nval {m n : Type*} [Fintype n] {r r' : ℕ} (k : Fin r → m × n → ℂ) (s : Fin r' → m × n → ℂ)
    (i j : m) : ℝ :=
  ∑ p, ∑ q, ‖ip (bv (k p) i) (bv (s q) i)‖ * ‖ip (bv (k p) j) (bv (s q) j)‖
def Acoef {R : Type*} [CommRing R] (J K : Matrix (Fin d × Fin n) (Fin d × Fin n) R) (i j : Fin d) : R :=
  ∑ x, ∑ y, J (i, x) (i, y) * K (j, y) (j, x)
def sqMat (k : ℕ) (t : Array (Array GQ)) : Matrix (Fin k) (Fin k) GQ := Matrix.of fun i j => (t[i.val]!)[j.val]!
def rhoU : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) GQ := (1 / 6 : ℚ) • (1 - projSum upbU)
def ip (x y : ι → ℂ) : ℂ := ∑ i, star (x i) * y i
def bv (x : m × n → ℂ) (a : m) : n → ℂ := fun i => x (a, i)
def projSum {ι : Type*} [Fintype ι] {K : ℕ} (u : Fin K → ι → GQ) : Matrix ι ι GQ :=
  ∑ k, (nsqQ (u k))⁻¹ • vecMulVec (u k) (star (u k))
def upbU (k : Fin 6) : Fin 4 × Fin 3 → GQ :=
  kvec (fun a => (UPBData.upbA[k.val]!)[a.val]!) (fun i => (UPBData.upbB[k.val]!)[i.val]!)
def nsqQ (x : ι → GQ) : ℚ := ∑ i, nq (x i)
def kvec {m n : Type*} (x : m → GQ) (y : n → GQ) : m × n → GQ := fun p => x p.1 * y p.2
def nq (z : GQ) : ℚ := z.re * z.re + z.im * z.im

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T14b/KFspec.lean:L97-L98.

Axioms, as Lean reports them. Recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L1287-L1291.

AXREPORT NATIVE TwirlCert.T14b.KFspec_upb : [propext, Classical.choice, Quot.sound, TwirlCert.T14b.UPB.chk12._native.native_decide.ax_1_1, TwirlCert.T14b.UPB.chkJ._native.native_decide.ax_1_1, TwirlCert.T14b.UPB.chkK._native.native_decide.ax_1_1, TwirlCert.T14b.UPB.chkTheta._native.native_decide.ax_1_1]
AXNATIVE TwirlCert.T14b.KFspec_upb TwirlCert.T14b.UPB.chk12._native.native_decide.ax_1_1 : decide     (TwirlCert.T14b.ratioChk (TwirlCert.T14b.mkJTh TwirlCert.T14b.UPB.FX (RowsA.Gap5.tblP TwirlCert.T14b.rhoU))         (TwirlCert.T14b.mkJTh TwirlCert.T14b.UPB.FZ (RowsA.Gap5.tblP TwirlCert.T14b.rhoU)) TwirlCert.T14b.UPB.lJ         TwirlCert.T14b.UPB.vJ TwirlCert.T14b.UPB.lK TwirlCert.T14b.UPB.vK 0 1 (21270550181 / 10 ^ 9)         (21270550182 / 10 ^ 9) =       true) =   true
AXNATIVE TwirlCert.T14b.KFspec_upb TwirlCert.T14b.UPB.chkJ._native.native_decide.ax_1_1 : decide     (TwirlCert.T14b.approxChk (TwirlCert.T14b.mkJTh TwirlCert.T14b.UPB.FX (RowsA.Gap5.tblP TwirlCert.T14b.rhoU))         TwirlCert.T14b.UPB.lJ TwirlCert.T14b.UPB.vJ =       true) =   true
AXNATIVE TwirlCert.T14b.KFspec_upb TwirlCert.T14b.UPB.chkK._native.native_decide.ax_1_1 : decide     (TwirlCert.T14b.approxChk (TwirlCert.T14b.mkJTh TwirlCert.T14b.UPB.FZ (RowsA.Gap5.tblP TwirlCert.T14b.rhoU))         TwirlCert.T14b.UPB.lK TwirlCert.T14b.UPB.vK =       true) =   true
AXNATIVE TwirlCert.T14b.KFspec_upb TwirlCert.T14b.UPB.chkTheta._native.native_decide.ax_1_1 : decide (TwirlCert.T14b.thetaChk TwirlCert.T14b.UPB.vJ TwirlCert.T14b.UPB.vK = true) = true

TwirlCert.T14a.finrank_face_rhoU

Computational fact †14, exact part (proof of Theorem 7.11): with compiled code

theorem finrank_face_rhoU : Module.finrank ℝ (face rhoUC) = 1
Definitions used in the statement
def face (ρ : Matrix (m × n) (m × n) ℂ) : Submodule ℝ (Matrix (m × n) (m × n) ℂ) where
  carrier := {X | X.IsHermitian ∧ LinearMap.range X.mulVecLin ≤ LinearMap.range ρ.mulVecLin ∧
    LinearMap.range (ptA X).mulVecLin ≤ LinearMap.range (ptA ρ).mulVecLin}
  add_mem' := by
    rintro X Y ⟨hX, hX1, hX2⟩ ⟨hY, hY1, hY2⟩
    refine ⟨hX.add hY, ?_, ?_⟩
    · rintro _ ⟨v, rfl⟩
      simp only [Matrix.mulVecLin_apply, Matrix.add_mulVec]
      exact Submodule.add_mem _ (hX1 ⟨v, rfl⟩) (hY1 ⟨v, rfl⟩)
    · rintro _ ⟨v, rfl⟩
      simp only [Matrix.mulVecLin_apply, ptA_add, Matrix.add_mulVec]
      exact Submodule.add_mem _ (hX2 ⟨v, rfl⟩) (hY2 ⟨v, rfl⟩)
  zero_mem' := by
    refine ⟨Matrix.isHermitian_zero, ?_, ?_⟩
    · rintro _ ⟨v, rfl⟩
      simp only [Matrix.mulVecLin_apply, Matrix.zero_mulVec]
      exact Submodule.zero_mem _
    · rintro _ ⟨v, rfl⟩
      have : ptA (0 : Matrix (m × n) (m × n) ℂ) = 0 := by ext x y; rfl
      simp only [Matrix.mulVecLin_apply, this, Matrix.zero_mulVec]
      exact Submodule.zero_mem _
  smul_mem' := by
    rintro c X ⟨hX, hX1, hX2⟩
    have hc : (c • X) = (c : ℂ) • X := by ext i j; simp
    refine ⟨?_, ?_, ?_⟩
    · rw [hc]
      unfold Matrix.IsHermitian
      rw [Matrix.conjTranspose_smul, hX.eq]
      congr 1
      exact Complex.conj_ofReal c
    · rintro _ ⟨v, rfl⟩
      simp only [Matrix.mulVecLin_apply, hc, Matrix.smul_mulVec]
      exact Submodule.smul_mem _ _ (hX1 ⟨v, rfl⟩)
    · rintro _ ⟨v, rfl⟩
      simp only [Matrix.mulVecLin_apply, hc, ptA_smul, Matrix.smul_mulVec]
      exact Submodule.smul_mem _ _ (hX2 ⟨v, rfl⟩)
noncomputable def rhoUC : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) ℂ := T14b.rhoU.map QI.toC
def ptA {R : Type*} (M : Matrix (m × n) (m × n) R) : Matrix (m × n) (m × n) R :=
  Matrix.of fun x y => M (y.1, x.2) (x.1, y.2)
abbrev GQ := QuadraticAlgebra ℚ (-1) 0
def rhoU : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) GQ := (1 / 6 : ℚ) • (1 - projSum upbU)
abbrev QI := QuadraticAlgebra ℚ (-1) 0
noncomputable def toC : QI →+* ℂ :=
  (QuadraticAlgebra.lift (A := ℂ) ⟨Complex.I, I_mul_I⟩ : QI →ₐ[ℚ] ℂ).toRingHom
def projSum {ι : Type*} [Fintype ι] {K : ℕ} (u : Fin K → ι → GQ) : Matrix ι ι GQ :=
  ∑ k, (nsqQ (u k))⁻¹ • vecMulVec (u k) (star (u k))
def upbU (k : Fin 6) : Fin 4 × Fin 3 → GQ :=
  kvec (fun a => (UPBData.upbA[k.val]!)[a.val]!) (fun i => (UPBData.upbB[k.val]!)[i.val]!)
def nsqQ (x : ι → GQ) : ℚ := ∑ i, nq (x i)
def kvec {m n : Type*} (x : m → GQ) (y : n → GQ) : m × n → GQ := fun p => x p.1 * y p.2
def nq (z : GQ) : ℚ := z.re * z.re + z.im * z.im

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/WP7/T14a/FaceU.lean:L215-L215.

Axioms, as Lean reports them: propext, Classical.choice, Quot.sound and 5 more, for example TwirlCert.T14a.face_modp_chk._native.native_decide.ax_1_1, TwirlCert.T14a.kernel0_chk._native.native_decide.ax_1_1 and TwirlCert.T14a.kernel1_chk._native.native_decide.ax_1_1. Each of these 5 axioms comes from a check that runs as compiled code (native_decide). The full report is recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L1064-L1069.

TwirlCert.T14a.K.rhoU_entangled

The entanglement of ρ_U, which the proof of Theorem 7.11 cites from the literature: kernel-only

theorem rhoU_entangled : ¬ Sep.IsSeparable rhoUC
Definitions used in the statement
def IsSeparable (Z : Matrix (m × k) (m × k) ℂ) : Prop := Z ∈ separableCone m k
noncomputable def rhoUC : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) ℂ := T14b.rhoU.map QI.toC
noncomputable def separableCone (m k : Type*) : PointedCone ℝ (Matrix (m × k) (m × k) ℂ) :=
  PointedCone.hull ℝ {Z | ∃ (a : m → ℂ) (b : k → ℂ), a ≠ 0 ∧ b ≠ 0 ∧ Z = proj a ⊗ₖ proj b}
abbrev GQ := QuadraticAlgebra ℚ (-1) 0
def rhoU : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) GQ := (1 / 6 : ℚ) • (1 - projSum upbU)
abbrev QI := QuadraticAlgebra ℚ (-1) 0
noncomputable def toC : QI →+* ℂ :=
  (QuadraticAlgebra.lift (A := ℂ) ⟨Complex.I, I_mul_I⟩ : QI →ₐ[ℚ] ℂ).toRingHom
def proj (x : m → ℂ) : Matrix m m ℂ := vecMulVec x (star x)
def projSum {ι : Type*} [Fintype ι] {K : ℕ} (u : Fin K → ι → GQ) : Matrix ι ι GQ :=
  ∑ k, (nsqQ (u k))⁻¹ • vecMulVec (u k) (star (u k))
def upbU (k : Fin 6) : Fin 4 × Fin 3 → GQ :=
  kvec (fun a => (UPBData.upbA[k.val]!)[a.val]!) (fun i => (UPBData.upbB[k.val]!)[i.val]!)
def nsqQ (x : ι → GQ) : ℚ := ∑ i, nq (x i)
def kvec {m n : Type*} (x : m → GQ) (y : n → GQ) : m × n → GQ := fun p => x p.1 * y p.2
def nq (z : GQ) : ℚ := z.re * z.re + z.im * z.im

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/WP7K/T14a/KEntangled.lean:L73-L73.

Axioms, as Lean reports them. Recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L950.

AXREPORT KERNEL TwirlCert.T14a.K.rhoU_entangled : [propext, Classical.choice, Quot.sound]

TwirlCert.T15.twirl_ppt_k

Computational fact †15 (Proposition 7.12(b)): kernel-only

theorem twirl_ppt_k : ∀ i j : Fin 4, i ≠ j → coefB rho sig i j ^ 2 ≤ coefA rho sig i j * coefA rho sig j i
Definitions used in the statement
def coefB {R : Type*} [CommRing R] [Fintype n] (ρ σ : Matrix (m × n) (m × n) R) (i j : m) : R :=
  Matrix.trace (blk ρ i j * blk σ j i)
def rho := filt Xf Yf
def sig := filt Zf Y2f
def coefA {R : Type*} [CommRing R] [Fintype n] (ρ σ : Matrix (m × n) (m × n) R) (i j : m) : R :=
  Matrix.trace (blk ρ i i * blk σ j j)
def blk {R : Type*} (M : Matrix (m × n) (m × n) R) (a b : m) : Matrix n n R :=
  Matrix.of fun i j => M (a, i) (b, j)
def filt {d : ℕ} (F : Matrix (Fin d) (Fin 3) ℚ) (G : Matrix (Fin 3) (Fin 3) ℚ) :
    Matrix (Fin d × Fin 3) (Fin d × Fin 3) ℚ :=
  (F ⊗ₖ G) * rhoT * (F ⊗ₖ G)ᵀ
def Xf : Matrix (Fin 4) (Fin 3) ℚ :=
  !![183/100, -73/100, 11/25; -117/100, 13/20, 0; 121/100, -13/50, 19/50; 101/100, -13/20, -1/50]
def Yf : Matrix (Fin 3) (Fin 3) ℚ := !![151/100, 57/100, 71/100; -1/25, 91/50, -7/100; 32/25, 17/25, 7/10]
def Zf : Matrix (Fin 4) (Fin 3) ℚ :=
  !![123/100, 2/5, 1/10; -6/25, 33/25, -14/25; 1/20, -9/25, 42/25; -113/100, 49/50, -7/50]
def Y2f : Matrix (Fin 3) (Fin 3) ℚ := !![58/25, 41/50, 9/100; 23/100, 18/25, 61/100; -22/25, 23/100, 109/100]
def rhoT : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℚ := (1 / 4 : ℚ) • (1 - ∑ k, projT k)
def projT (k : Fin 5) : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℚ :=
  (1 / (tw k ⬝ᵥ tw k)) • vecMulVec (tw k) (tw k)
def tw (k : Fin 5) : Fin 3 × Fin 3 → ℚ := fun x => tu k x.1 * tv k x.2
def tu : Fin 5 → Fin 3 → ℚ := ![![1, 0, 0], ![1, -1, 0], ![0, 0, 1], ![0, 1, -1], ![1, 1, 1]]
def tv : Fin 5 → Fin 3 → ℚ := ![![1, -1, 0], ![0, 0, 1], ![0, 1, -1], ![1, 0, 0], ![1, 1, 1]]

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T15/K.lean:L22-L22.

Axioms, as Lean reports them. Recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L1458.

AXREPORT KERNEL TwirlCert.T15.twirl_ppt_k : [propext, Classical.choice, Quot.sound]

TwirlCert.T12.KV.finrank_Sig

Computational fact †12 (Theorem 5.30, for the Tiles basis): kernel-only

theorem finrank_Sig : finrank ℂ (calSig V) = 3
Definitions used in the statement
def calSig {r : Type*} [Fintype r] (V : Matrix (Fin 3 × Fin 3) r ℂ) : Submodule ℂ (Matrix (Fin 3) r ℂ) where
  carrier := {Z | ∀ v : Fin 3 → ℂ, (fun x : Fin 3 × Fin 3 => ((Z * (Vblk V x.1)ᴴ) *ᵥ v) x.2) ∈
    LinearMap.range (ptA (V * Vᴴ)).mulVecLin}
  add_mem' := by
    intro Z Z' hZ hZ' v
    have : (fun x : Fin 3 × Fin 3 => (((Z + Z') * (Vblk V x.1)ᴴ) *ᵥ v) x.2) =
        (fun x : Fin 3 × Fin 3 => ((Z * (Vblk V x.1)ᴴ) *ᵥ v) x.2) +
          (fun x : Fin 3 × Fin 3 => ((Z' * (Vblk V x.1)ᴴ) *ᵥ v) x.2) := by
      ext x; simp [Matrix.add_mul, Matrix.add_mulVec]
    rw [Set.mem_ofPred_eq] at *
    rw [this]
    exact Submodule.add_mem _ (hZ v) (hZ' v)
  zero_mem' := by
    intro v
    have : (fun x : Fin 3 × Fin 3 => (((0 : Matrix (Fin 3) r ℂ) * (Vblk V x.1)ᴴ) *ᵥ v) x.2) = 0 := by
      ext x; simp
    rw [this]
    exact Submodule.zero_mem _
  smul_mem' := by
    intro c Z hZ v
    have : (fun x : Fin 3 × Fin 3 => (((c • Z) * (Vblk V x.1)ᴴ) *ᵥ v) x.2) =
        c • (fun x : Fin 3 × Fin 3 => ((Z * (Vblk V x.1)ᴴ) *ᵥ v) x.2) := by
      ext x; simp [Matrix.smul_mul, Matrix.smul_mulVec]
    rw [Set.mem_ofPred_eq] at *
    rw [this]
    exact Submodule.smul_mem _ c (hZ v)
noncomputable def V : Matrix (Fin 3 × Fin 3) (Fin 4) ℂ := W.map (Rat.castHom ℂ) * Ds
def ptA {R : Type*} (M : Matrix (m × n) (m × n) R) : Matrix (m × n) (m × n) R :=
  Matrix.of fun x y => M (y.1, x.2) (x.1, y.2)
def Vblk {R : Type*} {r : Type*} (V : Matrix (Fin 3 × Fin 3) r R) (a : Fin 3) : Matrix (Fin 3) r R :=
  Matrix.of fun i l => V (a, i) l
def W : Matrix (Fin 3 × Fin 3) (Fin 4) ℚ := Matrix.of fun x l => (WT[l.val]!)[(finProdFinEquiv x).val]!
noncomputable def Ds : Matrix (Fin 4) (Fin 4) ℂ := diagonal fun l => ((Real.sqrt (dW l) : ℝ) : ℂ)
def WT : Array (Array ℚ) :=
  gsArr ([0, 2, 3, 4].map fun j => Array.ofFn (n := 9) fun r => (PiT[r.val]!)[j]!)
def dW (l : Fin 4) : ℚ := ((fun x => W x l) ⬝ᵥ (fun x => W x l))⁻¹
def gsArr (cols : List (Array ℚ)) : Array (Array ℚ) := Id.run do
  let mut ws : Array (Array ℚ) := #[]
  for v in cols do
    let mut u := v
    for w in ws do
      let c := ((List.range 9).foldl (fun s r => s + w[r]! * v[r]!) 0) /
        ((List.range 9).foldl (fun s r => s + w[r]! * w[r]!) 0)
      u := Array.ofFn (n := 9) fun r => u[r.val]! - c * w[r.val]!
    ws := ws.push u
  return ws
def PiT : Array (Array ℚ) := tblP PiF
def PiF : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℚ :=
  1 - ∑ k : Fin 5, (pv k.castSucc ⬝ᵥ pv k.castSucc)⁻¹ • vecMulVec (pv k.castSucc) (pv k.castSucc)
def pv (m : Fin 6) : Fin 3 × Fin 3 → ℚ := fun x => uv m x.1 * wv m x.2
def uv (m : Fin 6) : Fin 3 → ℚ := if h : m.val < 5 then aT ⟨m.val, h⟩ else ![2, -1, 2]
def wv (m : Fin 6) : Fin 3 → ℚ := if h : m.val < 5 then bT ⟨m.val, h⟩ else ![2, -1, 2]
def aT : Fin 5 → Fin 3 → ℚ := ![![1, 0, 0], ![1, -1, 0], ![0, 0, 1], ![0, 1, -1], ![1, 1, 1]]
def bT : Fin 5 → Fin 3 → ℚ := ![![1, -1, 0], ![0, 0, 1], ![0, 1, -1], ![1, 0, 0], ![1, 1, 1]]
def tblP {α : Type*} {a b c d : ℕ} (M : Matrix (Fin a × Fin b) (Fin c × Fin d) α) : Array (Array α) :=
  Array.ofFn fun r : Fin (a * b) => Array.ofFn fun s : Fin (c * d) =>
    M (finProdFinEquiv.symm r) (finProdFinEquiv.symm s)

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T12/KSPi.lean:L122-L122.

Axioms, as Lean reports them. Recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L457 (the same line: zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T12/AXIOMS_K.txt:L94).

AXREPORT KERNEL TwirlCert.T12.KV.finrank_Sig : [propext, Classical.choice, Quot.sound]

TwirlCert.T12.KV.finrank_SS

Computational fact †12 (Corollary 5.35 and Lemma 5.37, for the Tiles basis): kernel-only

theorem finrank_SS : finrank ℂ (calS K K') = 6
Definitions used in the statement
def calS (R R' : Submodule ℂ (Fin 3 × Fin 3 → ℂ)) : Submodule ℂ (Matrix (Fin 3 × Fin 3) (Fin 3) ℂ) where
  carrier := {J | LinearMap.range J.mulVecLin ≤ R ∧ LinearMap.range (sharp J).mulVecLin ≤ R'}
  add_mem' := by
    rintro J J' ⟨h1, h2⟩ ⟨h1', h2'⟩
    refine ⟨?_, ?_⟩
    · rintro _ ⟨v, rfl⟩
      simp only [Matrix.mulVecLin_apply, Matrix.add_mulVec]
      exact R.add_mem (h1 ⟨v, rfl⟩) (h1' ⟨v, rfl⟩)
    · rintro _ ⟨v, rfl⟩
      have : sharp (J + J') = sharp J + sharp J' := by ext x k; simp [sharp]
      simp only [Matrix.mulVecLin_apply, this, Matrix.add_mulVec]
      exact R'.add_mem (h2 ⟨v, rfl⟩) (h2' ⟨v, rfl⟩)
  zero_mem' := by
    refine ⟨?_, ?_⟩
    · rintro _ ⟨v, rfl⟩
      simp only [Matrix.mulVecLin_apply, Matrix.zero_mulVec]
      exact R.zero_mem
    · rintro _ ⟨v, rfl⟩
      have : sharp (0 : Matrix (Fin 3 × Fin 3) (Fin 3) ℂ) = 0 := by ext x k; simp [sharp]
      simp only [Matrix.mulVecLin_apply, this, Matrix.zero_mulVec]
      exact R'.zero_mem
  smul_mem' := by
    rintro c J ⟨h1, h2⟩
    refine ⟨?_, ?_⟩
    · rintro _ ⟨v, rfl⟩
      simp only [Matrix.mulVecLin_apply, Matrix.smul_mulVec]
      exact R.smul_mem c (h1 ⟨v, rfl⟩)
    · rintro _ ⟨v, rfl⟩
      have : sharp (c • J) = star c • sharp J := by ext x k; simp [sharp]
      simp only [Matrix.mulVecLin_apply, this, Matrix.smul_mulVec]
      exact R'.smul_mem (star c) (h2 ⟨v, rfl⟩)
noncomputable def K : Submodule ℂ (Fin 3 × Fin 3 → ℂ) := LinearMap.ker PiC.mulVecLin
noncomputable def K' : Submodule ℂ (Fin 3 × Fin 3 → ℂ) := LinearMap.ker (ptA PiC).mulVecLin
def sharp (J : Matrix (Fin 3 × Fin 3) (Fin 3) ℂ) : Matrix (Fin 3 × Fin 3) (Fin 3) ℂ :=
  Matrix.of fun x k => star (J (x.1, k) x.2)
noncomputable def PiC : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℂ := PiQ.map (Rat.castHom ℂ)
def ptA {R : Type*} (M : Matrix (m × n) (m × n) R) : Matrix (m × n) (m × n) R :=
  Matrix.of fun x y => M (y.1, x.2) (x.1, y.2)
def PiQ : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℚ := lookP PiT
def PiT : Array (Array ℚ) := tblP PiF
def PiF : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℚ :=
  1 - ∑ k : Fin 5, (pv k.castSucc ⬝ᵥ pv k.castSucc)⁻¹ • vecMulVec (pv k.castSucc) (pv k.castSucc)
def pv (m : Fin 6) : Fin 3 × Fin 3 → ℚ := fun x => uv m x.1 * wv m x.2
def uv (m : Fin 6) : Fin 3 → ℚ := if h : m.val < 5 then aT ⟨m.val, h⟩ else ![2, -1, 2]
def wv (m : Fin 6) : Fin 3 → ℚ := if h : m.val < 5 then bT ⟨m.val, h⟩ else ![2, -1, 2]
def aT : Fin 5 → Fin 3 → ℚ := ![![1, 0, 0], ![1, -1, 0], ![0, 0, 1], ![0, 1, -1], ![1, 1, 1]]
def bT : Fin 5 → Fin 3 → ℚ := ![![1, -1, 0], ![0, 0, 1], ![0, 1, -1], ![1, 0, 0], ![1, 1, 1]]
def tblP {α : Type*} {a b c d : ℕ} (M : Matrix (Fin a × Fin b) (Fin c × Fin d) α) : Array (Array α) :=
  Array.ofFn fun r : Fin (a * b) => Array.ofFn fun s : Fin (c * d) =>
    M (finProdFinEquiv.symm r) (finProdFinEquiv.symm s)
def lookP {α : Type*} [Inhabited α] {a b c d : ℕ} (t : Array (Array α)) :
    Matrix (Fin a × Fin b) (Fin c × Fin d) α :=
  Matrix.of fun x y => (t[(finProdFinEquiv x).val]!)[(finProdFinEquiv y).val]!

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T12/KSS.lean:L121-L121.

Axioms, as Lean reports them. Recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L456 (the same line: zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T12/AXIOMS_K.txt:L93).

AXREPORT KERNEL TwirlCert.T12.KV.finrank_SS : [propext, Classical.choice, Quot.sound]

TwirlCert.T12.KV.finrank_LL

Computational fact †12 (Lemma 5.38, for the Tiles basis): kernel-only

theorem finrank_LL : finrank ℝ calL = 6
Definitions used in the statement
def calL : Submodule ℝ (Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℂ) where
  carrier := {X | X.IsHermitian ∧ LinearMap.range X.mulVecLin ≤ K ∧ LinearMap.range (ptA X).mulVecLin ≤ K'}
  add_mem' := by
    rintro X Y ⟨hX, hX1, hX2⟩ ⟨hY, hY1, hY2⟩
    refine ⟨hX.add hY, ?_, ?_⟩
    · rintro _ ⟨v, rfl⟩
      simp only [Matrix.mulVecLin_apply, Matrix.add_mulVec]
      exact K.add_mem (hX1 ⟨v, rfl⟩) (hY1 ⟨v, rfl⟩)
    · rintro _ ⟨v, rfl⟩
      simp only [Matrix.mulVecLin_apply, ptA_add, Matrix.add_mulVec]
      exact K'.add_mem (hX2 ⟨v, rfl⟩) (hY2 ⟨v, rfl⟩)
  zero_mem' := by
    refine ⟨Matrix.isHermitian_zero, ?_, ?_⟩
    · rintro _ ⟨v, rfl⟩
      simp only [Matrix.mulVecLin_apply, Matrix.zero_mulVec]
      exact K.zero_mem
    · rintro _ ⟨v, rfl⟩
      have : ptA (0 : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℂ) = 0 := by ext x y; rfl
      simp only [Matrix.mulVecLin_apply, this, Matrix.zero_mulVec]
      exact K'.zero_mem
  smul_mem' := by
    rintro c X ⟨hX, hX1, hX2⟩
    have hc : (c • X) = (c : ℂ) • X := by ext i j; simp
    refine ⟨?_, ?_, ?_⟩
    · rw [hc]
      unfold Matrix.IsHermitian
      rw [Matrix.conjTranspose_smul, hX.eq]
      congr 1
      exact Complex.conj_ofReal c
    · rintro _ ⟨v, rfl⟩
      simp only [Matrix.mulVecLin_apply, hc, Matrix.smul_mulVec]
      exact K.smul_mem _ (hX1 ⟨v, rfl⟩)
    · rintro _ ⟨v, rfl⟩
      simp only [Matrix.mulVecLin_apply, hc, ptA_smul, Matrix.smul_mulVec]
      exact K'.smul_mem _ (hX2 ⟨v, rfl⟩)
noncomputable def K : Submodule ℂ (Fin 3 × Fin 3 → ℂ) := LinearMap.ker PiC.mulVecLin
def ptA {R : Type*} (M : Matrix (m × n) (m × n) R) : Matrix (m × n) (m × n) R :=
  Matrix.of fun x y => M (y.1, x.2) (x.1, y.2)
noncomputable def K' : Submodule ℂ (Fin 3 × Fin 3 → ℂ) := LinearMap.ker (ptA PiC).mulVecLin
noncomputable def PiC : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℂ := PiQ.map (Rat.castHom ℂ)
def PiQ : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℚ := lookP PiT
def PiT : Array (Array ℚ) := tblP PiF
def PiF : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℚ :=
  1 - ∑ k : Fin 5, (pv k.castSucc ⬝ᵥ pv k.castSucc)⁻¹ • vecMulVec (pv k.castSucc) (pv k.castSucc)
def pv (m : Fin 6) : Fin 3 × Fin 3 → ℚ := fun x => uv m x.1 * wv m x.2
def uv (m : Fin 6) : Fin 3 → ℚ := if h : m.val < 5 then aT ⟨m.val, h⟩ else ![2, -1, 2]
def wv (m : Fin 6) : Fin 3 → ℚ := if h : m.val < 5 then bT ⟨m.val, h⟩ else ![2, -1, 2]
def aT : Fin 5 → Fin 3 → ℚ := ![![1, 0, 0], ![1, -1, 0], ![0, 0, 1], ![0, 1, -1], ![1, 1, 1]]
def bT : Fin 5 → Fin 3 → ℚ := ![![1, -1, 0], ![0, 0, 1], ![0, 1, -1], ![1, 0, 0], ![1, 1, 1]]
def tblP {α : Type*} {a b c d : ℕ} (M : Matrix (Fin a × Fin b) (Fin c × Fin d) α) : Array (Array α) :=
  Array.ofFn fun r : Fin (a * b) => Array.ofFn fun s : Fin (c * d) =>
    M (finProdFinEquiv.symm r) (finProdFinEquiv.symm s)
def lookP {α : Type*} [Inhabited α] {a b c d : ℕ} (t : Array (Array α)) :
    Matrix (Fin a × Fin b) (Fin c × Fin d) α :=
  Matrix.of fun x y => (t[(finProdFinEquiv x).val]!)[(finProdFinEquiv y).val]!

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T12/KLL.lean:L174-L174.

Axioms, as Lean reports them. Recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L455 (the same line: zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T12/AXIOMS_K.txt:L92).

AXREPORT KERNEL TwirlCert.T12.KV.finrank_LL : [propext, Classical.choice, Quot.sound]

TwirlCert.T11.B_dim_k

Computational fact †11 (Remark 5.11): kernel-only

theorem B_dim_k : Module.finrank ℂ (Rsol (cC xB) (cC yB)) = 6
Definitions used in the statement
def Rsol (x y : Fin r → Fin 3 → ℂ) : Submodule ℂ (Fin r → Fin 3 → ℂ) where
  carrier := {h | ∀ v, Rexpr x y h v ∈ S x y}
  zero_mem' v := by
    have : Rexpr x y 0 v = 0 := by ext p; simp [Rexpr, tv]
    show Rexpr x y 0 v ∈ S x y
    rw [this]; exact Submodule.zero_mem _
  add_mem' {h g} hh hg v := by
    show Rexpr x y (h + g) v ∈ S x y
    rw [Rexpr_add]; exact Submodule.add_mem _ (hh v) (hg v)
  smul_mem' c h hh v := by
    show Rexpr x y (c • h) v ∈ S x y
    rw [Rexpr_smul]; exact Submodule.smul_mem _ c (hh v)
noncomputable def cC {r : ℕ} (x : Fin r → Fin 3 → QI) : Fin r → Fin 3 → ℂ := fun k i => QI.toC (x k i)
def xB : Fin 5 → Fin 3 → QI := ![![1, 0, 0], ![0, 1, 0], ![0, 0, 1], ![1, 1, 1], ![1, 2, 3]]
def yB : Fin 5 → Fin 3 → QI := ![![1, 0, 0], ![0, 1, 0], ![0, 0, 1], ![1, 1, 1], ![1, 3, -2]]
def S (x y : Fin r → Fin 3 → ℂ) : Submodule ℂ (Fin 3 × Fin 3 → ℂ) :=
  Submodule.span ℂ (Set.range fun m => tv (cv (x m)) (y m))
def Rexpr (x y : Fin r → Fin 3 → ℂ) (h : Fin r → Fin 3 → ℂ) (v : Fin 3 → ℂ) : Fin 3 × Fin 3 → ℂ :=
  ∑ k, ip (y k) v • tv (cv (x k)) (h k)
abbrev QI := QuadraticAlgebra ℚ (-1) 0
noncomputable def toC : QI →+* ℂ :=
  (QuadraticAlgebra.lift (A := ℂ) ⟨Complex.I, I_mul_I⟩ : QI →ₐ[ℚ] ℂ).toRingHom
def tv {R : Type*} [Mul R] (u w : Fin 3 → R) : Fin 3 × Fin 3 → R := fun p => u p.1 * w p.2
def cv {R : Type*} [Star R] (u : Fin 3 → R) : Fin 3 → R := fun a => star (u a)
def ip (y v : Fin 3 → ℂ) : ℂ := ∑ i, star (y i) * v i

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T11/KBT.lean:L55-L55.

Axioms, as Lean reports them. Recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L145.

AXREPORT KERNEL TwirlCert.T11.B_dim_k : [propext, Classical.choice, Quot.sound]

TwirlCert.T17.K.ex87_AB_trunc

Computational fact †17 (Example 8.7), for Ψ = Φ_X*: kernel-only

theorem ex87_AB_trunc :
    (Matrix.of (coefA rhoXC rhoXC))ᵀ = Matrix.of (coefA rhoXC rhoXC) ∧
    (∀ i j, (coefA rhoXC rhoXC i j).im = 0 ∧ (coefB rhoXC rhoXC i j).im = 0 ∧ 0 < (coefB rhoXC rhoXC i j).re) ∧
    (∀ i j, i ≠ j → (coefB rhoXC rhoXC i j).re ≤ (coefA rhoXC rhoXC i j).re) ∧
    (Matrix.of (coefB rhoXC rhoXC)).PosDef ∧
    (-5.353797 : ℝ) ≤ oneMB (Matrix.of (coefB rhoXC rhoXC)) ∧ oneMB (Matrix.of (coefB rhoXC rhoXC)) < -5.353796
Definitions used in the statement
def coefA {R : Type*} [CommRing R] [Fintype n] (ρ σ : Matrix (m × n) (m × n) R) (i j : m) : R :=
  Matrix.trace (blk ρ i i * blk σ j j)
noncomputable def rhoXC : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) ℂ := rhoXQ.map QI.toC
def coefB {R : Type*} [CommRing R] [Fintype n] (ρ σ : Matrix (m × n) (m × n) R) (i j : m) : R :=
  Matrix.trace (blk ρ i j * blk σ j i)
noncomputable def oneMB (B : Matrix (Fin 4) (Fin 4) ℂ) : ℝ :=
  ∑ a, (B a a).re - ∑ a, ∑ b, if a = b then 0 else ‖B a b‖
def blk {R : Type*} (M : Matrix (m × n) (m × n) R) (a b : m) : Matrix n n R :=
  Matrix.of fun i j => M (a, i) (b, j)
abbrev QI := QuadraticAlgebra ℚ (-1) 0
def rhoXQ : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) QI := FX * T14b.rhoU * FXᴴ
noncomputable def toC : QI →+* ℂ :=
  (QuadraticAlgebra.lift (A := ℂ) ⟨Complex.I, I_mul_I⟩ : QI →ₐ[ℚ] ℂ).toRingHom
abbrev GQ := QuadraticAlgebra ℚ (-1) 0
def FX : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) QI := X17 ⊗ₖ (1 : Matrix (Fin 3) (Fin 3) QI)
def rhoU : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) GQ := (1 / 6 : ℚ) • (1 - projSum upbU)
def X17 : Matrix (Fin 4) (Fin 4) QI := 1 + Matrix.of fun _ _ => 1
def projSum {ι : Type*} [Fintype ι] {K : ℕ} (u : Fin K → ι → GQ) : Matrix ι ι GQ :=
  ∑ k, (nsqQ (u k))⁻¹ • vecMulVec (u k) (star (u k))
def upbU (k : Fin 6) : Fin 4 × Fin 3 → GQ :=
  kvec (fun a => (UPBData.upbA[k.val]!)[a.val]!) (fun i => (UPBData.upbB[k.val]!)[i.val]!)
def nsqQ (x : ι → GQ) : ℚ := ∑ i, nq (x i)
def kvec {m n : Type*} (x : m → GQ) (y : n → GQ) : m × n → GQ := fun p => x p.1 * y p.2
def nq (z : GQ) : ℚ := z.re * z.re + z.im * z.im

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/WP7b/T17/KTrunc.lean:L19-L24.

Axioms, as Lean reports them. Recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L1481.

AXREPORT KERNEL TwirlCert.T17.K.ex87_AB_trunc : [propext, Classical.choice, Quot.sound]

TwirlCert.T19.ExA.peel_only_stop

Computational fact †19 (Remark 3.5), example (A): with compiled code

theorem peel_only_stop (s : Gram 6 6 9) (h : Reach s0.toC s) :
    (s = s0.toC ∧ (cohB s0.toC).rank = 6 ∧ (nzRows s0).length = 6) ∨
      (s = s1.toC ∧ (cohB s1.toC).rank = 4 ∧ (nzRows s1).length = 4)
Definitions used in the statement
structure Gram (d p q : ℕ) where
  G : Fin d → Matrix (Fin 3) (Fin p) ℂ
  H : Fin d → Matrix (Fin 3) (Fin q) ℂ
inductive Reach {d p q : ℕ} (s0 : Gram d p q) : Gram d p q → Prop
  | refl : Reach s0 s0
  | step {s s' : Gram d p q} : Reach s0 s → PeelStep s s' → Reach s0 s'
def s0 : GramQ 6 6 9 := ⟨lookFam s0GT, lookFam s0HT⟩
noncomputable def cohB {d p q : ℕ} (s : Gram d p q) : Matrix (Fin d) (Fin d) ℂ :=
  Matrix.of fun i k => ((coh s i)ᴴ * coh s k).trace
def nzRows {d p q : ℕ} (s : GramQ d p q) : List (Fin d) := (List.finRange d).filter fun a => cohBQ s a a != 0
def s1 : GramQ 6 6 9 := ⟨lookFam s1GT, s0.H⟩
structure GramQ (d p q : ℕ) where
  G : Fin d → Matrix (Fin 3) (Fin p) QI
  H : Fin d → Matrix (Fin 3) (Fin q) QI
def lookFam {d r : ℕ} (A : Array (Array (Array QI))) : Fin d → Matrix (Fin 3) (Fin r) QI :=
  fun a => look (A[a.val]!)
def s0GT : Array (Array (Array QI)) := matFam (famQ exAG 6 6)
def s0HT : Array (Array (Array QI)) := matFam (famQ exAH 6 9)
def coh {d p q : ℕ} (s : Gram d p q) (a : Fin d) : Matrix (Fin p) (Fin q) ℂ := (s.G a)ᴴ * s.H a
abbrev QI := QuadraticAlgebra ℚ (-1) 0
def cohBQ {d p q : ℕ} (s : GramQ d p q) : Matrix (Fin d) (Fin d) QI :=
  look (tbl (Matrix.of fun i k => (((s.G i)ᴴ * s.H i)ᴴ * ((s.G k)ᴴ * s.H k)).trace))
def s1GT : Array (Array (Array QI)) := remT s0.G 0
def matFam {d r : ℕ} (X : Fin d → Matrix (Fin 3) (Fin r) QI) : Array (Array (Array QI)) :=
  Array.ofFn fun a => tbl (X a)
def famQ (L : List (List (List (Int × Int)))) (d r : ℕ) : Fin d → Matrix (Fin 3) (Fin r) QI :=
  fun a => Matrix.of fun i j => gq (((L.getD a.val []).getD i.val []).getD j.val (0, 0))
def remT {d r : ℕ} (X : Fin d → Matrix (Fin 3) (Fin r) QI) (c : Fin d) : Array (Array (Array QI)) :=
  let PT := projT (X c)
  Array.ofFn fun a : Fin d => tbl (X a * (1 - (look PT : Matrix (Fin r) (Fin r) QI)))
def gq (z : Int × Int) : QI := ⟨z.1, z.2⟩
def projT {r : ℕ} (X : Matrix (Fin 3) (Fin r) QI) : Array (Array QI) :=
  let QT := projCoefT X
  tbl (Xᴴ * ((look QT : Matrix (Fin 3) (Fin 3) QI) * X))
def projCoefT {r : ℕ} (X : Matrix (Fin 3) (Fin r) QI) : Array (Array QI) := Id.run do
  let mut ws : Array (Array QI) := #[]
  let mut als : Array (Array QI) := #[]
  for k in [0:3] do
    let ck : Array QI := Array.ofFn (n := r) fun j => star (X (Fin.ofNat 3 k) j)
    let mut w := ck
    let mut al : Array QI := Array.ofFn (n := 3) fun i => if i.val = k then 1 else 0
    for l in [0:ws.size] do
      let wl := ws[l]!
      let nl := (List.range r).foldl (fun t j => t + star (wl[j]!) * wl[j]!) 0
      let cf := ((List.range r).foldl (fun t j => t + star (wl[j]!) * ck[j]!) 0) * qiInv nl
      w := Array.ofFn (n := r) fun j => w[j.val]! - cf * wl[j.val]!
      al := Array.ofFn (n := 3) fun i => al[i.val]! - cf * (als[l]!)[i.val]!
    if w.any (· ≠ 0) then
      ws := ws.push w
      als := als.push al
  let mut Q : Array (Array QI) := Array.replicate 3 (Array.replicate 3 0)
  for l in [0:ws.size] do
    let wl := ws[l]!
    let al := als[l]!
    let nl := (List.range r).foldl (fun t j => t + star (wl[j]!) * wl[j]!) 0
    let inv := qiInv nl
    Q := Array.ofFn (n := 3) fun i => Array.ofFn (n := 3) fun i' =>
      (Q[i.val]!)[i'.val]! + al[i.val]! * star (al[i'.val]!) * inv
  return Q
def qiInv (z : QI) : QI :=
  let n := z.re * z.re + z.im * z.im
  ⟨z.re / n, -z.im / n⟩
def tbl {α : Type*} {m n : ℕ} (M : Matrix (Fin m) (Fin n) α) : Array (Array α) :=
  Array.ofFn fun i => Array.ofFn fun j => M i j
def look {α : Type*} [Inhabited α] {m n : ℕ} (t : Array (Array α)) : Matrix (Fin m) (Fin n) α :=
  Matrix.of fun i j => (t[i.val]!)[j.val]!

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T19/ExA.lean:L105-L107.

Axioms, as Lean reports them. Recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L1821-L1826 (the same line: zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T19/AXIOMS.txt:L138).

AXREPORT NATIVE TwirlCert.T19.ExA.peel_only_stop : [propext, Classical.choice, Quot.sound, TwirlCert.T19.ExA.closed01._native.native_decide.ax_1_1, TwirlCert.T19.ExA.s0_rank._native.native_decide.ax_1_1, TwirlCert.T19.ExA.s0_rows._native.native_decide.ax_1_1, TwirlCert.T19.ExA.s1_rank._native.native_decide.ax_1_1, TwirlCert.T19.ExA.s1_rows._native.native_decide.ax_1_1]
AXNATIVE TwirlCert.T19.ExA.peel_only_stop TwirlCert.T19.ExA.closed01._native.native_decide.ax_1_1 : decide (TwirlCert.T19.closedQ [TwirlCert.T19.ExA.s0, TwirlCert.T19.ExA.s1] = true) = true
AXNATIVE TwirlCert.T19.ExA.peel_only_stop TwirlCert.T19.ExA.s0_rank._native.native_decide.ax_1_1 : decide (TwirlCert.rankCheck (TwirlCert.T19.cohBQ TwirlCert.T19.ExA.s0) 6 = true) = true
AXNATIVE TwirlCert.T19.ExA.peel_only_stop TwirlCert.T19.ExA.s0_rows._native.native_decide.ax_1_1 : decide (TwirlCert.T19.nzRows TwirlCert.T19.ExA.s0 = [0, 1, 2, 3, 4, 5]) = true
AXNATIVE TwirlCert.T19.ExA.peel_only_stop TwirlCert.T19.ExA.s1_rank._native.native_decide.ax_1_1 : decide (TwirlCert.rankCheck (TwirlCert.T19.cohBQ TwirlCert.T19.ExA.s1) 4 = true) = true
AXNATIVE TwirlCert.T19.ExA.peel_only_stop TwirlCert.T19.ExA.s1_rows._native.native_decide.ax_1_1 : decide (TwirlCert.T19.nzRows TwirlCert.T19.ExA.s1 = [2, 3, 4, 5]) = true

TwirlCert.T20.KMain.eigs_absB1

Computational fact †20 (Lemma 8.9 and Corollary 8.10): kernel-only

theorem eigs_absB1 : Multiset.map KMain.absB1R_herm.eigenvalues Finset.univ.val = {e1, e2, e3, e4}
Definitions used in the statement
noncomputable def absB1R : Matrix (Fin 4) (Fin 4) ℝ := (absQ B1).map (Rat.castHom ℝ)
noncomputable def e1 : ℝ := (8 + Real.sqrt 10) / 5
noncomputable def e2 : ℝ := (8 - Real.sqrt 10) / 5
noncomputable def e3 : ℝ := (2 + Real.sqrt 5) / 5
noncomputable def e4 : ℝ := (2 - Real.sqrt 5) / 5
def absQ {n : Type*} (M : Matrix n n ℚ) : Matrix n n ℚ := M.map abs
def B1 : Matrix (Fin 4) (Fin 4) ℚ := Matrix.of fun i j => q ((B1Data.getD i.val []).getD j.val (0, 1))
def q (p : Int × Nat) : ℚ := (p.1 : ℚ) / (p.2 : ℚ)

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T20/KMain.lean:L62-L62.

Axioms, as Lean reports them. Recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L2699 (the same line: zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T20/AXIOMS_K.txt:L76).

AXREPORT KERNEL TwirlCert.T20.KMain.eigs_absB1 : [propext, Classical.choice, Quot.sound]

TwirlCert.T21.KA.absB_not_psd

Computational fact †21 (Corollary 8.11), the first composite: kernel-only

theorem absB_not_psd : ¬ ((absQ B).map (Rat.castHom ℂ)).PosSemidef
Definitions used in the statement
def absQ {n : Type*} (M : Matrix n n ℚ) : Matrix n n ℚ := M.map abs
def B : Matrix (Fin 4) (Fin 4) ℚ := Matrix.of (coefB JPhi JPsi)
def coefB {R : Type*} [CommRing R] [Fintype n] (ρ σ : Matrix (m × n) (m × n) R) (i j : m) : R :=
  Matrix.trace (blk ρ i j * blk σ j i)
def JPhi : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) ℚ := Matrix.of fun x y => (G x.1 * (G y.1)ᴴ) x.2 y.2
def JPsi : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) ℚ := Matrix.of fun x y => (H * G x.1 * (H * G y.1)ᴴ) x.2 y.2
def blk {R : Type*} (M : Matrix (m × n) (m × n) R) (a b : m) : Matrix n n R :=
  Matrix.of fun i j => M (a, i) (b, j)
def G (a : Fin 4) : Matrix (Fin 3) (Fin 3) ℚ := diagonal (phi a)
def H : Matrix (Fin 3) (Fin 3) ℚ := Matrix.of fun i j => q ((HaData.getD i.val []).getD j.val (0, 1))
def phi (a : Fin 4) (k : Fin 3) : ℚ := q ((phiData.getD a.val []).getD k.val (0, 1))
def q (p : ℤ × ℕ) : ℚ := (p.1 : ℚ) / (p.2 : ℚ)

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T21/KA.lean:L29-L29.

Axioms, as Lean reports them. Recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L2939 (the same line: zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T21/AXIOMS_K.txt:L15).

AXREPORT KERNEL TwirlCert.T21.KA.absB_not_psd : [propext, Classical.choice, Quot.sound]

TwirlCert.T22x.K.no_peel_pair

Computational fact †22, exact part (Corollary 8.12, the pair (δ, δ′) = (1/400, 1/200) near Example 8.7): kernel-only

theorem no_peel_pair {κ κ' : Type} [Fintype κ] [Fintype κ'] (G : Fin 4 → Matrix (Fin 3) κ ℂ)
    (H : Fin 4 → Matrix (Fin 3) κ' ℂ) (hG : ∀ a b, blk rhoPC a b = G a * (G b)ᴴ)
    (hH : ∀ a b, blk sigPC a b = H a * (H b)ᴴ) : ∀ c, ¬ Peels G c ∧ ¬ Peels H c
Definitions used in the statement
def blk {R : Type*} (M : Matrix (m × n) (m × n) R) (a b : m) : Matrix n n R :=
  Matrix.of fun i j => M (a, i) (b, j)
noncomputable def rhoPC : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) ℂ := rhoPQ.map QI.toC
noncomputable def sigPC : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) ℂ := sigPQ.map QI.toC
def Peels (H : Fin 4 → Matrix (Fin 3) κ ℂ) (c : Fin 4) : Prop :=
  (∀ y, (ntil H c y)ᴴ * ntil H c y = ntil H c y * (ntil H c y)ᴴ) ∧
    ∀ x y, ntil H c x * ntil H c y = ntil H c y * ntil H c x
abbrev QI := QuadraticAlgebra ℚ (-1) 0
def rhoPQ : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) QI := rhoXQ + (1 / 400 : ℚ) • 1
noncomputable def toC : QI →+* ℂ :=
  (QuadraticAlgebra.lift (A := ℂ) ⟨Complex.I, I_mul_I⟩ : QI →ₐ[ℚ] ℂ).toRingHom
def sigPQ : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) QI := rhoXQ + (1 / 200 : ℚ) • 1
noncomputable def ntil (H : Fin 4 → Matrix (Fin 3) κ ℂ) (c y : Fin 4) : Matrix κ κ ℂ :=
  (H c)ᴴ * (H c * (H c)ᴴ)⁻¹ * H y * (H c)ᴴ * (H c * (H c)ᴴ)⁻¹ * H c
def rhoXQ : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) QI := FX * T14b.rhoU * FXᴴ
abbrev GQ := QuadraticAlgebra ℚ (-1) 0
def FX : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) QI := X17 ⊗ₖ (1 : Matrix (Fin 3) (Fin 3) QI)
def rhoU : Matrix (Fin 4 × Fin 3) (Fin 4 × Fin 3) GQ := (1 / 6 : ℚ) • (1 - projSum upbU)
def X17 : Matrix (Fin 4) (Fin 4) QI := 1 + Matrix.of fun _ _ => 1
def projSum {ι : Type*} [Fintype ι] {K : ℕ} (u : Fin K → ι → GQ) : Matrix ι ι GQ :=
  ∑ k, (nsqQ (u k))⁻¹ • vecMulVec (u k) (star (u k))
def upbU (k : Fin 6) : Fin 4 × Fin 3 → GQ :=
  kvec (fun a => (UPBData.upbA[k.val]!)[a.val]!) (fun i => (UPBData.upbB[k.val]!)[i.val]!)
def nsqQ (x : ι → GQ) : ℚ := ∑ i, nq (x i)
def kvec {m n : Type*} (x : m → GQ) (y : n → GQ) : m × n → GQ := fun p => x p.1 * y p.2
def nq (z : GQ) : ℚ := z.re * z.re + z.im * z.im

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/WP7K/T22x/KPeel.lean:L38-L40.

Axioms, as Lean reports them. Recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L3033.

AXREPORT KERNEL TwirlCert.T22x.K.no_peel_pair : [propext, Classical.choice, Quot.sound]

TwirlCert.T23x.K.trace_ZX

Computational fact †23, exact part (the example of Section 8.4): kernel-only

theorem trace_ZX (κ δ : ℝ) :
    (Z.map (Rat.castHom ℝ) * XAB (κ • A.map (Rat.castHom ℝ)) (Bδ δ)).trace = 3 * (κ - 1 + δ)
Definitions used in the statement
def Z : Matrix (Fin 4 × Fin 4) (Fin 4 × Fin 4) ℚ := Matrix.of fun x y =>
  if h : x.1.val < 3 ∧ x.2.val < 3 ∧ y.1.val < 3 ∧ y.2.val < 3 then
    Z3 (⟨x.1.val, h.1⟩, ⟨x.2.val, h.2.1⟩) (⟨y.1.val, h.2.2.1⟩, ⟨y.2.val, h.2.2.2⟩)
  else 0
def XAB {d : ℕ} {R : Type*} [Zero R] (A B : Matrix (Fin d) (Fin d) R) :
    Matrix (Fin d × Fin d) (Fin d × Fin d) R :=
  Matrix.of fun x y => if x.1 = x.2 ∧ y.1 = y.2 then B x.1 y.1 else if x = y then A x.1 x.2 else 0
def A : Matrix (Fin 4) (Fin 4) ℚ := !![0, 1, 4, 2; 4, 0, 1, 2; 1, 4, 0, 2; 2, 2, 2, 0]
noncomputable def Bδ (δ : ℝ) : Matrix (Fin 4) (Fin 4) ℝ := Jm.map (Rat.castHom ℝ) + δ • 1
def Z3 : Matrix (Fin 3 × Fin 3) (Fin 3 × Fin 3) ℚ := Matrix.of fun x y => tau31 (Matrix.single x.1 y.1 1) x.2 y.2
def Jm : Matrix (Fin 4) (Fin 4) ℚ := Matrix.of fun _ _ => 1
def tau31 (Y : Matrix (Fin 3) (Fin 3) ℚ) : Matrix (Fin 3) (Fin 3) ℚ := 2 • eps Y + eps (Sh * Y * Shᴴ) - Y
def eps (Y : Matrix (Fin 3) (Fin 3) ℚ) : Matrix (Fin 3) (Fin 3) ℚ := diagonal fun i => Y i i
def Sh : Matrix (Fin 3) (Fin 3) ℚ := Matrix.of fun i j => if i = j + 1 then 1 else 0

Source: Zenodo record 23713731, ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T23x/KMain.lean:L70-L71.

Axioms, as Lean reports them. Recorded in zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/AXIOMS_ALL.txt:L3217 (the same line: zenodo:23713731/ppt2-twirl-deposit-v5-lean.tar.gz/ppt2-twirl-deposit/lean/rows_a/RowsA/Twirl/T23x/AXIOMS_K.txt:L17).

AXREPORT KERNEL TwirlCert.T23x.K.trace_ZX : [propext, Classical.choice, Quot.sound]