Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definitions for Degradability of Fermionic Gaussian Channels

Definition
QAlgorithms_Papers_Independent_Advance50_P19

by Gohan · Oct 29, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

The objects the formalized statements of Degradability of Fermionic Gaussian Channels (arXiv:1604.01954) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • Major: PDF p.1: two Majorana directions per fermionic mode.
  • CARSystem: PDF p.1: an irreducible CAR representation, on the actual 2^n-dimensional Fock space. No chosen vacuum orbit restricts the allowed parity sector.
  • monomial: PDF p.1: ordered product; the empty Majorana monomial is the identity.
  • totalFermionParity: PDF pp.1,8,11: total parity, with a harmless fixed overall sign convention.
  • IsFermionicState: PDF pp.1,8,11: physical fermionic densities commute with total parity; coherent superpositions across opposite total parity are excluded.
  • majoranaContraction: PDF p.1: two-point Majorana contraction.
  • wick: PDF p.1, Wick's rule: pair the first operator with position j+1, with sign (-1)^j, and recurse. Sufficient fuel is the list length; the zero contraction of every odd list is part of the definition.
  • IsGaussianState: PDF p.1: normalized, parity-preserving Gaussian states, including pure occupied modes and mixtures. Wick's rule is required on every monomial.
  • fermionicCovariance: PDF p.1, Eq.(1): real covariance matrix, with the paper's +i/2 convention.
  • fermionicNoiseContraction: PDF p.2, Eq.(3): contractions of the independent Gaussian noise in the Heisenberg expansion, C_ij = (I-AA^T)_ij - i B_ij. The real symmetric part is necessary even when B=0; it enforces the output CAR.
  • gaussianObservable: PDF p.2, Eq.(3), canonical full CAR extension: expand each output Majorana into system plus independent Gaussian noise; move system factors left with the fermionic sign, and contract the noise by Wick's rule. This gives an actual observable, rather than an unspecified covariance-only map.
  • HasFermionicGaussianAction: PDF p.2, Eq.(3): canonical Gaussian action on the FULL operator algebra. Testing all X and all monomials specifies every matrix entry, including the odd operator sector; Gaussian-state spanning is not assumed for that sector.
  • IsFGC: PDF p.2, Eqs.(3-4): a genuine CPTP fermionic Gaussian channel, not a free affine action on covariance matrices. B is real skew symmetric.
  • HasReceiverDilation: PDF pp.2,7: both partial traces use this SAME pure-environment isometry. The environment is a Hilbert-space register, not a freely chosen second channel.
  • Degrades: PDF pp.2,7: arbitrary CPTP postprocessing, with equality on all operators.
  • ChannelDegradable: PDF pp.2,7: ordinary channel degradability for some pure Stinespring dilation. The accepted fixed-dilation predicate supplies unrestricted CPTP postprocessing. A nonzero finite environment can always be indexed by Fin(e+1).
  • ChannelAntidegradable: PDF pp.2,8: ordinary channel antidegradability uses the accepted reversed postprocessing arrow.
  • normalizedChoiDensity: PDF p.9: normalized ordinary Choi density. Its rank is independent of the reference basis and of the Gaussian choice of maximally entangled vector.
  • choiModeRank: PDF p.9: mode rank is log_2 of the ACTUAL ordinary Choi rank. S9 asserts separately that that rank is exactly a power of two; it is not defined by the desired kernel formula. On a zero map this total auxiliary returns 0.
  • nullityC: Complex kernel dimension, including empty matrices.
  • nullityR: Real kernel dimension, including empty matrices.
  • fermionicCPMatrix: PDF p.2, Eq.(4): complete-positivity matrix, with the source's -iB sign.
  • choiCovariance: PDF pp.2,9: canonical Gaussian Choi covariance. The Choi density itself is independently constructed as normalizedChoiDensity T.
  • normalizedNoise: PDF pp.2-3,9: normalized noise, using the spectral Moore--Penrose inverse square root, with zero inverse on the kernel. Complex matrices merely provide Mathlib's Hermitian functional calculus; the resulting entries are real.
  • IsPhaseOrthogonal: PDF pp.2,7,9: all local phase changes may be orthogonal, including parity-normalizing reflections; no unsupported SO requirement is imposed.
  • ImplementsCAR: PDF pp.1-3,9: actual unitary implementation of a real phase-space operation. The Heisenberg action fixes the covariance transformation sign.
  • attenuation: PDF p.4: one-mode attenuation, in a Fock basis whose target pure state has covariance J. Both Kraus operators are specified on the full qubit algebra.
  • capacityObjective: PDF p.4: the one-parameter coherent-information objective.
  • copyDensity: PDF p.12: n=2^N independent copies, ordered by copy then original mode. Since rho is even, the product density is the graded Fock product as well as the displayed ordinary matrix product.
  • copyMajorana: PDF pp.11-12: the CAR operator of direction r in copy j, with the Jordan--Wigner parity strings of all PRECEDING copies. Ordinary qubit swaps are never substituted for this Fock identification.
  • sylvesterCoefficient: PDF p.12: entries of H_2 tensor ... tensor H_2 divided by sqrt(2^N). Bits are read in the same order for rows and columns, so reversing the tensor order has no effect. N=0 gives the one by one identity.
  • IsGaussificationMixer: PDF p.12: the ACTUAL mixer, specified by its action on the copied CAR operators. The identical real mixer is applied to both Majoranas of every original mode; hence it is passive and local for every original party split. No convergence or Gaussian optimality assumption is hidden in this predicate.
  • insertFermionicCopy: Fill in the retained copy and all spectator occupations for a partial trace.
  • mixedCopyMarginal: PDF p.12: the actual reduced state of copy j after applying U to the independent product input. Evenness makes this contiguous-copy partial trace the fermionic marginal, without discarding Fock regrouping signs.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Channel
import Definitions.Def_QAlgorithms_Defs_Information
import Definitions.Def_QAlgorithms_Defs_Measurement
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P67
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P62
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P80
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P34

/-!
Greplova--Giedke, arXiv:1604.01954v2. Page numbers are PDF pages.
Accepted finite-channel primitives and paper-local CAR definitions fix the full
linear Gaussian extension, including odd Majorana monomials. Physical states are normalized, positive and parity invariant.
Degrading maps are arbitrary CPTP maps on the full matrix algebra.
S1(i) includes the missing Z >= 0 clause; S2 corrects n by n to 2n by 2n.
Deferred nodes and reasons are recorded in the unit's HARD.md and GAPS.json.
Compilation and independent moderation are pending the batch handoff.
-/

noncomputable section

open scoped BigOperators Matrix ComplexConjugate ComplexOrder

namespace QAlgorithms.Papers.Independent.Advance50.P19

open QAlgorithms.Papers.Independent.Information100.P67
  (IsIsometry receiverChannel complementaryChannel)

open QAlgorithms.Papers.Independent.Information100.P62 (tensorChannel)

open QAlgorithms.Papers.Independent.Information100.P80 (quantumCapacity)

attribute [local instance] Classical.propDecidable Classical.decEq

/-- PDF p.1: two Majorana directions per fermionic mode. -/
abbrev Major (n : ℕ) := Fin (2 * n)

/-- PDF p.1: an irreducible CAR representation, on the actual 2^n-dimensional
Fock space. No chosen vacuum orbit restricts the allowed parity sector. -/
structure CARSystem (n : ℕ) where
  majorana : Major n → Matrix (Qubits n) (Qubits n) ℂ
  hermitian : ∀ i, (majorana i).IsHermitian
  anticommutation : ∀ i j,
    majorana i * majorana j + majorana j * majorana i =
      ((if i = j then 2 else 0) : ℂ) • (1 : Matrix (Qubits n) (Qubits n) ℂ)

/-- PDF p.1: ordered product; the empty Majorana monomial is the identity. -/
def monomial {n : ℕ} (s : CARSystem n) (l : List (Major n)) :
    Matrix (Qubits n) (Qubits n) ℂ :=
  (l.map s.majorana).prod

/-- PDF pp.1,8,11: total parity, with a harmless fixed overall sign convention. -/
def totalFermionParity {n : ℕ} (s : CARSystem n) : Matrix (Qubits n) (Qubits n) ℂ :=
  (Complex.I ^ n) • monomial s (List.finRange (2 * n))

/-- PDF pp.1,8,11: physical fermionic densities commute with total parity;
coherent superpositions across opposite total parity are excluded. -/
def IsFermionicState {n : ℕ} (s : CARSystem n)
    (rho : Matrix (Qubits n) (Qubits n) ℂ) : Prop :=
  IsDensityMatrix rho ∧ rho * totalFermionParity s = totalFermionParity s * rho

/-- PDF p.1: two-point Majorana contraction. -/
def majoranaContraction {n : ℕ} (s : CARSystem n)
    (rho : Matrix (Qubits n) (Qubits n) ℂ) (i j : Major n) : ℂ :=
  (rho * (s.majorana i * s.majorana j)).trace

/-- PDF p.1, Wick's rule: pair the first operator with position j+1,
with sign (-1)^j, and recurse. Sufficient fuel is the list length; the zero
contraction of every odd list is part of the definition. -/
def wick {I : Type*} (C : I → I → ℂ) : ℕ → List I → ℂ
  | 0, [] => 1
  | 0, _ :: _ => 0
  | _ + 1, [] => 1
  | fuel + 1, i :: tail =>
      ∑ j : Fin tail.length,
        (-1 : ℂ) ^ j.val * C i (tail.get j) * wick C fuel (tail.eraseIdx j.val)

/-- PDF p.1: normalized, parity-preserving Gaussian states, including pure
occupied modes and mixtures. Wick's rule is required on every monomial. -/
def IsGaussianState {n : ℕ} (s : CARSystem n)
    (rho : Matrix (Qubits n) (Qubits n) ℂ) : Prop :=
  IsFermionicState s rho ∧ ∀ l : List (Major n),
    (rho * monomial s l).trace = wick (majoranaContraction s rho) l.length l

/-- PDF p.1, Eq.(1): real covariance matrix, with the paper's +i/2 convention. -/
def fermionicCovariance {n : ℕ} (s : CARSystem n)
    (rho : Matrix (Qubits n) (Qubits n) ℂ) : Matrix (Major n) (Major n) ℝ :=
  fun i j => ((Complex.I / 2) *
    (rho * (s.majorana i * s.majorana j - s.majorana j * s.majorana i)).trace).re

/-- PDF p.2, Eq.(3): contractions of the independent Gaussian noise in the
Heisenberg expansion, C_ij = (I-AA^T)_ij - i B_ij. The real symmetric part
is necessary even when B=0; it enforces the output CAR. -/
def fermionicNoiseContraction {n m : ℕ} (A : Matrix (Major m) (Major n) ℝ)
    (B : Matrix (Major m) (Major m) ℝ) : Major m → Major m → ℂ :=
  fun i j =>
    ((((1 : Matrix (Major m) (Major m) ℝ) - A * A.transpose) i j : ℝ) : ℂ) -
      Complex.I * (B i j : ℂ)

/-- PDF p.2, Eq.(3), canonical full CAR extension: expand each output
Majorana into system plus independent Gaussian noise; move system factors left
with the fermionic sign, and contract the noise by Wick's rule. This gives an
actual observable, rather than an unspecified covariance-only map. -/
def gaussianObservable {n m : ℕ} (s : CARSystem n)
    (A : Matrix (Major m) (Major n) ℝ) (B : Matrix (Major m) (Major m) ℝ)
    (l : List (Major m)) : Matrix (Qubits n) (Qubits n) ℂ :=
  ∑ S ∈ (Finset.univ : Finset (Fin l.length)).powerset,
    let selected := (List.finRange l.length).filter (fun p => p ∈ S)
    let remaining := (List.finRange l.length).filter (fun p => p ∉ S)
    let crossings := ∑ i : Fin l.length,
      if i ∉ S then (Finset.univ.filter (fun j : Fin l.length => j ∈ S ∧ i < j)).card
      else 0
    ((-1 : ℂ) ^ crossings *
      wick (fermionicNoiseContraction A B) l.length (remaining.map (fun p => l.get p))) •
      (selected.map (fun p => ∑ j : Major n,
        (A (l.get p) j : ℂ) • s.majorana j)).prod

/-- PDF p.2, Eq.(3): canonical Gaussian action on the FULL operator algebra.
Testing all X and all monomials specifies every matrix entry, including the odd
operator sector; Gaussian-state spanning is not assumed for that sector. -/
def HasFermionicGaussianAction {n m : ℕ} (s : CARSystem n) (t : CARSystem m)
    (T : Superop (Qubits n) (Qubits m)) (A : Matrix (Major m) (Major n) ℝ)
    (B : Matrix (Major m) (Major m) ℝ) : Prop :=
  ∀ (X : Matrix (Qubits n) (Qubits n) ℂ) (l : List (Major m)),
    (T X * monomial t l).trace = (X * gaussianObservable s A B l).trace

/-- PDF p.2, Eqs.(3-4): a genuine CPTP fermionic Gaussian channel, not a
free affine action on covariance matrices. B is real skew symmetric. -/
def IsFGC {n m : ℕ} (s : CARSystem n) (t : CARSystem m)
    (T : Superop (Qubits n) (Qubits m)) (A : Matrix (Major m) (Major n) ℝ)
    (B : Matrix (Major m) (Major m) ℝ) : Prop :=
  IsChannel T ∧ B.transpose = -B ∧ HasFermionicGaussianAction s t T A B

/-- PDF pp.2,7: both partial traces use this SAME pure-environment isometry.
The environment is a Hilbert-space register, not a freely chosen second channel. -/
def HasReceiverDilation {A B E : Type*} [Fintype A] [Fintype B] [Fintype E]
    [DecidableEq A] (T : Superop A B) (V : Matrix (B × E) A ℂ) : Prop :=
  IsIsometry V ∧ ∀ X, T X = receiverChannel V X

/-- PDF pp.2,7: arbitrary CPTP postprocessing, with equality on all operators. -/
def Degrades {A B E : Type*} [Fintype A] [Fintype B] [Fintype E]
    [DecidableEq B] (T : Superop A B) (C : Superop A E) : Prop :=
  ∃ D : Superop B E, IsChannel D ∧ ∀ X, D (T X) = C X

/-- PDF pp.2,7: ordinary channel degradability for some pure Stinespring dilation.
The accepted fixed-dilation predicate supplies unrestricted CPTP postprocessing.
A nonzero finite environment can always be indexed by Fin(e+1). -/
def ChannelDegradable {A B : Type*} [Fintype A] [Fintype B]
    [DecidableEq A] [DecidableEq B] (T : Superop A B) : Prop :=
  IsChannel T ∧ ∃ e : ℕ, ∃ V : Matrix (B × Fin (e + 1)) A ℂ,
    HasReceiverDilation T V ∧
      QAlgorithms.Papers.Independent.Information100.P67.IsDegradable V

/-- PDF pp.2,8: ordinary channel antidegradability uses the accepted reversed postprocessing arrow. -/
def ChannelAntidegradable {A B : Type*} [Fintype A] [Fintype B]
    [DecidableEq A] [DecidableEq B] (T : Superop A B) : Prop :=
  IsChannel T ∧ ∃ e : ℕ, ∃ V : Matrix (B × Fin (e + 1)) A ℂ,
    HasReceiverDilation T V ∧
      QAlgorithms.Papers.Independent.Information100.P67.IsAntidegradable V

/-- PDF p.9: normalized ordinary Choi density. Its rank is independent of
the reference basis and of the Gaussian choice of maximally entangled vector. -/
def normalizedChoiDensity {A B : Type*} [Fintype A] [DecidableEq A] (T : Superop A B) :
    Matrix (B × A) (B × A) ℂ :=
  fun i j => (Fintype.card A : ℂ)⁻¹ *
    QAlgorithms.Papers.Independent.Information100.P34.choi T (i.2, i.1) (j.2, j.1)

/-- PDF p.9: mode rank is log_2 of the ACTUAL ordinary Choi rank. S9
asserts separately that that rank is exactly a power of two; it is not defined
by the desired kernel formula. On a zero map this total auxiliary returns 0. -/
def choiModeRank {A B : Type*} [Fintype A] [Fintype B] [DecidableEq A]
    (T : Superop A B) : ℕ :=
  Nat.log 2 (Matrix.rank (normalizedChoiDensity T))

/-- Complex kernel dimension, including empty matrices. -/
def nullityC {I J : Type*} [Fintype I] [Fintype J] (M : Matrix I J ℂ) : ℕ :=
  Module.finrank ℂ (LinearMap.ker M.mulVecLin)

/-- Real kernel dimension, including empty matrices. -/
def nullityR {I J : Type*} [Fintype I] [Fintype J] (M : Matrix I J ℝ) : ℕ :=
  Module.finrank ℝ (LinearMap.ker M.mulVecLin)

/-- PDF p.2, Eq.(4): complete-positivity matrix, with the source's -iB sign. -/
def fermionicCPMatrix {n m : ℕ} (A : Matrix (Major m) (Major n) ℝ)
    (B : Matrix (Major m) (Major m) ℝ) : Matrix (Major m) (Major m) ℂ :=
  (1 - A * A.transpose).map Complex.ofReal - Complex.I • B.map Complex.ofReal

/-- PDF pp.2,9: canonical Gaussian Choi covariance. The Choi density itself
is independently constructed as normalizedChoiDensity T. -/
def choiCovariance {n m : ℕ} (A : Matrix (Major m) (Major n) ℝ)
    (B : Matrix (Major m) (Major m) ℝ) :
    Matrix (Major m ⊕ Major n) (Major m ⊕ Major n) ℝ :=
  Matrix.fromBlocks B A (-A.transpose) 0

/-- PDF pp.2-3,9: normalized noise, using the spectral Moore--Penrose
inverse square root, with zero inverse on the kernel. Complex matrices merely
provide Mathlib's Hermitian functional calculus; the resulting entries are real. -/
def normalizedNoise {n m : ℕ} (A : Matrix (Major m) (Major n) ℝ)
    (B : Matrix (Major m) (Major m) ℝ) : Matrix (Major m) (Major m) ℂ :=
  let R := cfc (fun x : ℝ => (Real.sqrt x)⁻¹)
    ((1 - A * A.transpose).map Complex.ofReal)
  R * B.map Complex.ofReal * R

/-- PDF pp.2,7,9: all local phase changes may be orthogonal, including
parity-normalizing reflections; no unsupported SO requirement is imposed. -/
def IsPhaseOrthogonal {I : Type*} [Fintype I] [DecidableEq I]
    (O : Matrix I I ℝ) : Prop :=
  O.transpose * O = 1 ∧ O * O.transpose = 1

/-- PDF pp.1-3,9: actual unitary implementation of a real phase-space
operation. The Heisenberg action fixes the covariance transformation sign. -/
def ImplementsCAR {n : ℕ} (s : CARSystem n) (O : Matrix (Major n) (Major n) ℝ)
    (U : Matrix.unitaryGroup (Qubits n) ℂ) : Prop :=
  IsPhaseOrthogonal O ∧ ∀ i,
    (U : Matrix (Qubits n) (Qubits n) ℂ).conjTranspose * s.majorana i *
      (U : Matrix (Qubits n) (Qubits n) ℂ) =
        ∑ j, (O i j : ℂ) • s.majorana j

/-- PDF p.4: one-mode attenuation, in a Fock basis whose target pure state
has covariance J. Both Kraus operators are specified on the full qubit algebra. -/
def attenuation (p : ℝ) : Superop Bool Bool :=
  krausApply (fun j : Bool => if j then
    (fun a b => if a = false ∧ b = true then (Real.sqrt p : ℂ) else 0)
    else (fun a b => if a = b then
      (if a then (Real.sqrt (1 - p) : ℂ) else 1) else 0))

/-- PDF p.4: the one-parameter coherent-information objective. -/
def capacityObjective (p lambda : ℝ) : ℝ :=
  binEntropy2 ((1 - p) * (1 - lambda) / 2) -
    binEntropy2 (p * (1 - lambda) / 2)

/-- PDF p.12: n=2^N independent copies, ordered by copy then original
mode. Since rho is even, the product density is the graded Fock product as
well as the displayed ordinary matrix product. -/
def copyDensity {n : ℕ} (rho : Matrix (Qubits n) (Qubits n) ℂ) (N : ℕ) :
    Matrix (Fin (2 ^ N) → Qubits n) (Fin (2 ^ N) → Qubits n) ℂ :=
  fun x y => ∏ j, rho (x j) (y j)

/-- PDF pp.11-12: the CAR operator of direction r in copy j, with the
Jordan--Wigner parity strings of all PRECEDING copies. Ordinary qubit swaps
are never substituted for this Fock identification. -/
def copyMajorana {n : ℕ} (s : CARSystem n) (N : ℕ)
    (j : Fin (2 ^ N)) (r : Major n) :
    Matrix (Fin (2 ^ N) → Qubits n) (Fin (2 ^ N) → Qubits n) ℂ :=
  fun x y => ∏ k, if k < j then totalFermionParity s (x k) (y k)
    else if k = j then s.majorana r (x k) (y k)
    else if x k = y k then 1 else 0

/-- PDF p.12: entries of H_2 tensor ... tensor H_2 divided by sqrt(2^N).
Bits are read in the same order for rows and columns, so reversing the tensor
order has no effect. N=0 gives the one by one identity. -/
def sylvesterCoefficient (N : ℕ) (j k : Fin (2 ^ N)) : ℝ :=
  (-1 : ℝ) ^ ((Finset.range N).filter
    (fun r => j.val.testBit r = true ∧ k.val.testBit r = true)).card /
      Real.sqrt (2 ^ N : ℝ)

/-- PDF p.12: the ACTUAL mixer, specified by its action on the copied CAR
operators. The identical real mixer is applied to both Majoranas of every
original mode; hence it is passive and local for every original party split.
No convergence or Gaussian optimality assumption is hidden in this predicate. -/
def IsGaussificationMixer {n : ℕ} (s : CARSystem n) (N : ℕ)
    (U : Matrix.unitaryGroup (Fin (2 ^ N) → Qubits n) ℂ) : Prop :=
  ∀ (j : Fin (2 ^ N)) (r : Major n),
    (U : Matrix _ _ ℂ).conjTranspose * copyMajorana s N j r *
      (U : Matrix _ _ ℂ) =
        ∑ k, (sylvesterCoefficient N j k : ℂ) • copyMajorana s N k r

/-- Fill in the retained copy and all spectator occupations for a partial trace. -/
def insertFermionicCopy {n N : ℕ} (j : Fin (2 ^ N)) (a : Qubits n)
    (z : {k : Fin (2 ^ N) // k ≠ j} → Qubits n) : Fin (2 ^ N) → Qubits n :=
  fun k => if h : k = j then a else z ⟨k, h⟩

/-- PDF p.12: the actual reduced state of copy j after applying U to the
independent product input. Evenness makes this contiguous-copy partial trace
the fermionic marginal, without discarding Fock regrouping signs. -/
def mixedCopyMarginal {n : ℕ} (rho : Matrix (Qubits n) (Qubits n) ℂ)
    (N : ℕ) (U : Matrix.unitaryGroup (Fin (2 ^ N) → Qubits n) ℂ)
    (j : Fin (2 ^ N)) : Matrix (Qubits n) (Qubits n) ℂ :=
  let mixed := (U : Matrix _ _ ℂ) * copyDensity rho N * (U : Matrix _ _ ℂ).conjTranspose
  fun a b => ∑ z : {k : Fin (2 ^ N) // k ≠ j} → Qubits n,
    mixed (insertFermionicCopy j a z) (insertFermionicCopy j b z)

/-- Sanity: zero mixing rounds give the identity coefficient, not 1/sqrt(0). -/
example : sylvesterCoefficient 0 0 0 = 1 := by
  norm_num [sylvesterCoefficient]

/-- Sanity: empty monomials are identities, also at zero modes. -/
example {n : ℕ} (s : CARSystem n) : monomial s [] = 1 := by
  rfl

/-- Sanity: Wick normalization at the empty list is exactly 1. -/
example {I : Type*} (C : I → I → ℂ) : wick C 0 [] = 1 := by
  rfl

/-- Sanity: the one-operator moment is zero, without a vacuum-only restriction. -/
example {I : Type*} (C : I → I → ℂ) (i : I) : wick C 1 [i] = 0 := by
  simp [wick]

/-- Sanity: entropy includes the endpoint 0 log 0 without an undefined value. -/
example : binEntropy2 0 = 0 := by
  simp [binEntropy2]

end QAlgorithms.Papers.Independent.Advance50.P19
Source
Degradability of Fermionic Gaussian Channels, arXiv:1604.01954v2, https://arxiv.org/abs/1604.01954v2
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

QAlgorithms.Papers.Independent.Advance50.P19.CARSystem

For every natural number nnn, a CAR system consists of complex matrices cic_ici​, indexed by i∈{0,…,2n−1}i\in\{0,\ldots,2n-1\}i∈{0,…,2n−1}, whose rows and columns are indexed by the length-nnn Boolean strings, together with the requirements that every cic_ici​ is Hermitian and that, for every pair of indices i,ji,ji,j,

cicj+cjci={2I,i=j,0,i≠j.c_ic_j+c_jc_i= \begin{cases} 2I,&i=j,\\ 0,&i\ne j. \end{cases}ci​cj​+cj​ci​={2I,0,​i=j,i=j.​

Thus the matrices have size 2n×2n2^n\times2^n2n×2n. When n=0n=0n=0, the family is empty and both requirements are vacuous.

QAlgorithms.Papers.Independent.Advance50.P19.ChannelAntidegradable

For finite types A,BA,BA,B with decidable equality, and a function TTT from complex matrices on AAA to those on BBB, this predicate means that TTT admits a finite Kraus representation T(X)=∑jKjXKj†T(X)=\sum_jK_jXK_j^\daggerT(X)=∑j​Kj​XKj†​ for every XXX, with ∑jKj†Kj=IA\sum_jK_j^\dagger K_j=I_A∑j​Kj†​Kj​=IA​, and that there exist a natural number eee and a complex matrix VVV from AAA to B×FB\times FB×F, where F={0,…,e}F=\{0,\ldots,e\}F={0,…,e}, satisfying V†V=IAV^\dagger V=I_AV†V=IA​ and

T(X)bb′=∑f∈F(VXV†)(b,f),(b′,f)T(X)_{bb'}=\sum_{f\in F}(VXV^\dagger)_{(b,f),(b',f)}T(X)bb′​=f∈F∑​(VXV†)(b,f),(b′,f)​

for every X,b,b′X,b,b'X,b,b′. Moreover, there must exist a function DDD from matrices on FFF to matrices on BBB having a finite Kraus representation D(Y)=∑jLjYLj†D(Y)=\sum_jL_jYL_j^\daggerD(Y)=∑j​Lj​YLj†​, with ∑jLj†Lj=IF\sum_jL_j^\dagger L_j=I_F∑j​Lj†​Lj​=IF​, such that

D ⁣([∑b∈B(VXV†)(b,f),(b,f′)]f,f′∈F)=T(X)D\!\left(\left[\sum_{b\in B}(VXV^\dagger)_{(b,f),(b,f')}\right]_{f,f'\in F}\right)=T(X)D​[b∈B∑​(VXV†)(b,f),(b,f′)​]f,f′∈F​​=T(X)

for every complex matrix XXX on AAA. The isometry equation is also explicitly included in the antidegradability condition on VVV. The types A,BA,BA,B may be empty, while FFF is always nonempty.

QAlgorithms.Papers.Independent.Advance50.P19.ChannelDegradable

For finite types A,BA,BA,B with decidable equality, and a function TTT from complex matrices on AAA to those on BBB, this predicate means that TTT admits a finite Kraus representation T(X)=∑jKjXKj†T(X)=\sum_jK_jXK_j^\daggerT(X)=∑j​Kj​XKj†​ for every XXX, with ∑jKj†Kj=IA\sum_jK_j^\dagger K_j=I_A∑j​Kj†​Kj​=IA​, and that there exist a natural number eee and a complex matrix VVV from AAA to B×FB\times FB×F, where F={0,…,e}F=\{0,\ldots,e\}F={0,…,e}, satisfying V†V=IAV^\dagger V=I_AV†V=IA​ and

T(X)bb′=∑f∈F(VXV†)(b,f),(b′,f)T(X)_{bb'}=\sum_{f\in F}(VXV^\dagger)_{(b,f),(b',f)}T(X)bb′​=f∈F∑​(VXV†)(b,f),(b′,f)​

for every X,b,b′X,b,b'X,b,b′. Moreover, there must exist a function DDD from matrices on BBB to matrices on FFF having a finite Kraus representation D(Y)=∑jLjYLj†D(Y)=\sum_jL_jYL_j^\daggerD(Y)=∑j​Lj​YLj†​, with ∑jLj†Lj=IB\sum_jL_j^\dagger L_j=I_B∑j​Lj†​Lj​=IB​, such that, for every complex matrix XXX on AAA,

D(T(X))ff′=∑b∈B(VXV†)(b,f),(b,f′).D(T(X))_{ff'}=\sum_{b\in B}(VXV^\dagger)_{(b,f),(b,f')}.D(T(X))ff′​=b∈B∑​(VXV†)(b,f),(b,f′)​.

The isometry equation is also explicitly included in the degradability condition on VVV. The types A,BA,BA,B may be empty, but the chosen environment FFF is always nonempty, including when e=0e=0e=0.

QAlgorithms.Papers.Independent.Advance50.P19.Degrades

For any finite types A,B,EA,B,EA,B,E, with decidable equality on BBB, and arbitrary functions TTT from complex matrices on AAA to those on BBB and CCC from complex matrices on AAA to those on EEE, this predicate means that there exists a function DDD from complex matrices on BBB to those on EEE admitting a finite Kraus representation: for some natural number rrr and matrices KjK_jKj​ with rows in EEE and columns in BBB, ∑j<rKj†Kj=IB\sum_{j<r}K_j^\dagger K_j=I_B∑j<r​Kj†​Kj​=IB​ and D(Y)=∑j<rKjYKj†D(Y)=\sum_{j<r}K_jYK_j^\daggerD(Y)=∑j<r​Kj​YKj†​ for every complex matrix YYY on BBB. It additionally requires D(T(X))=C(X)D(T(X))=C(X)D(T(X))=C(X) for every complex matrix XXX on AAA. No channel assumption is imposed on TTT or CCC. Empty finite types and an empty Kraus family are permitted whenever these equations hold.

QAlgorithms.Papers.Independent.Advance50.P19.HasFermionicGaussianAction

For all natural numbers n,mn,mn,m, let s=(cj)0≤j<2ns=(c_j)_{0\le j<2n}s=(cj​)0≤j<2n​ and t=(di)0≤i<2mt=(d_i)_{0\le i<2m}t=(di​)0≤i<2m​ be families of Hermitian complex matrices on the length-nnn and length-mmm Boolean strings, respectively, satisfying cicj+cjci=2δijIc_ic_j+c_jc_i=2\delta_{ij}Ici​cj​+cj​ci​=2δij​I and didj+djdi=2δijId_id_j+d_jd_i=2\delta_{ij}Idi​dj​+dj​di​=2δij​I. For every arbitrary map TTT from complex matrices on the length-nnn Boolean strings to complex matrices on the length-mmm Boolean strings, every real 2m×2n2m\times2n2m×2n matrix AAA, and every real 2m×2m2m\times2m2m×2m matrix BBB, having fermionic Gaussian action means that, for every complex input matrix XXX and every finite list l=[l0,…,lr−1]l=[l_0,\ldots,l_{r-1}]l=[l0​,…,lr−1​] of output indices, including repeated indices,

tr⁡ ⁣(T(X)dl0⋯dlr−1)=tr⁡ ⁣(XGs,A,B(l)),\operatorname{tr}\!\left(T(X)d_{l_0}\cdots d_{l_{r-1}}\right) =\operatorname{tr}\!\left(XG_{s,A,B}(l)\right),tr(T(X)dl0​​⋯dlr−1​​)=tr(XGs,A,B​(l)),

where

Gs,A,B(l)=∑S⊆{0,…,r−1}(−1)∣{(i,j):i<j, i∉S, j∈S}∣WC ⁣(r,[lp:p∉S in increasing order])∏p∈Sin increasing order(∑j=02n−1Alpjcj),C(i,j)=(I2m−AAT)ij−iBij.G_{s,A,B}(l)= \sum_{S\subseteq\{0,\ldots,r-1\}} (-1)^{|\{(i,j):i<j,\ i\notin S,\ j\in S\}|} W_C\!\left(r,[l_p:p\notin S\text{ in increasing order}]\right) \prod_{\substack{p\in S\\\text{in increasing order}}} \left(\sum_{j=0}^{2n-1}A_{l_pj}c_j\right), \qquad C(i,j)=(I_{2m}-AA^{\mathsf T})_{ij}-\mathrm{i}B_{ij}.Gs,A,B​(l)=S⊆{0,…,r−1}∑​(−1)∣{(i,j):i<j, i∈/S, j∈S}∣WC​(r,[lp​:p∈/S in increasing order])p∈Sin increasing order​∏​(j=0∑2n−1​Alp​j​cj​),C(i,j)=(I2m​−AAT)ij​−iBij​.

Here WC(f,[])=1W_C(f,[])=1WC​(f,[])=1 for every fuel fff, WC(0,L)=0W_C(0,L)=0WC​(0,L)=0 for nonempty LLL, and

WC(f+1,[i,t0,…,tq−1])=∑j=0q−1(−1)jC(i,tj) WC(f,[t0,…,tq−1] with position j deleted).W_C(f+1,[i,t_0,\ldots,t_{q-1}]) =\sum_{j=0}^{q-1}(-1)^jC(i,t_j)\, W_C(f,[t_0,\ldots,t_{q-1}]\text{ with position }j\text{ deleted}).WC​(f+1,[i,t0​,…,tq−1​])=j=0∑q−1​(−1)jC(i,tj​)WC​(f,[t0​,…,tq−1​] with position j deleted).

Empty matrix products are identities and empty sums are zero. Consequently the empty-list instance requires tr⁡(T(X))=tr⁡(X)\operatorname{tr}(T(X))=\operatorname{tr}(X)tr(T(X))=tr(X) for every XXX; when m=0m=0m=0, this is the only list instance.

QAlgorithms.Papers.Independent.Advance50.P19.HasReceiverDilation

For any finite types A,B,EA,B,EA,B,E, with decidable equality on AAA, any function TTT from complex A×AA\times AA×A matrices to complex B×BB\times BB×B matrices, and any complex matrix VVV with rows indexed by B×EB\times EB×E and columns indexed by AAA, this predicate means that V†V=IAV^\dagger V=I_AV†V=IA​ and, for every complex matrix XXX on AAA and all b,b′∈Bb,b'\in Bb,b′∈B,

T(X)bb′=∑e∈E(VXV†)(b,e),(b′,e).T(X)_{bb'}=\sum_{e\in E}(VXV^\dagger)_{(b,e),(b',e)}.T(X)bb′​=e∈E∑​(VXV†)(b,e),(b′,e)​.

The equation is required for every matrix XXX, without a positivity or normalization restriction. The finite types may be empty, and all sums retain their empty-sum meaning.

QAlgorithms.Papers.Independent.Advance50.P19.ImplementsCAR

Let nnn be any natural number, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let sss consist of Hermitian complex matrices γi\gamma_iγi​ on CQn\mathbb C^{Q_n}CQn​, indexed by 0≤i<2n0\le i<2n0≤i<2n, satisfying γiγj+γjγi=2δijI\gamma_i\gamma_j+\gamma_j\gamma_i=2\delta_{ij}Iγi​γj​+γj​γi​=2δij​I. For any real 2n×2n2n\times2n2n×2n matrix OOO and any unitary matrix UUU on CQn\mathbb C^{Q_n}CQn​, this predicate means

OTO=I,OOT=I,U†γiU=∑j=02n−1Oijγj(0≤i<2n).O^{\mathsf T}O=I,\qquad OO^{\mathsf T}=I, \qquad U^\dagger\gamma_iU=\sum_{j=0}^{2n-1}O_{ij}\gamma_j \quad(0\le i<2n).OTO=I,OOT=I,U†γi​U=j=0∑2n−1​Oij​γj​(0≤i<2n).

When n=0n=0n=0, the matrices OOO have empty index sets and there are no conjugation equations, so the predicate holds for every supplied unitary UUU on the one-dimensional space indexed by the empty bit string.

QAlgorithms.Papers.Independent.Advance50.P19.IsFGC

For any natural numbers n,mn,mn,m, including zero, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n and Jn={0,…,2n−1}J_n=\{0,\ldots,2n-1\}Jn​={0,…,2n−1}. Let s=(si)i∈Jns=(s_i)_{i\in J_n}s=(si​)i∈Jn​​ and t=(ti)i∈Jmt=(t_i)_{i\in J_m}t=(ti​)i∈Jm​​ be systems of Hermitian matrices on CQn\mathbb C^{Q_n}CQn​ and CQm\mathbb C^{Q_m}CQm​, respectively, satisfying sisj+sjsi=2δijIs_is_j+s_js_i=2\delta_{ij}Isi​sj​+sj​si​=2δij​I and the corresponding equations for ttt. For an arbitrary function TTT from complex matrices on QnQ_nQn​ to complex matrices on QmQ_mQm​, a real 2m×2n2m\times2n2m×2n matrix AAA, and a real 2m×2m2m\times2m2m×2m matrix BBB, this predicate means the conjunction of the following conditions: there are a natural number rrr and matrices K0,…,Kr−1K_0,\ldots,K_{r-1}K0​,…,Kr−1​ such that ∑jKj†Kj=I\sum_jK_j^\dagger K_j=I∑j​Kj†​Kj​=I and T(X)=∑jKjXKj†T(X)=\sum_jK_jXK_j^\daggerT(X)=∑j​Kj​XKj†​ for every complex input matrix XXX; BT=−BB^{\mathsf T}=-BBT=−B; and, for every complex input matrix XXX and every finite list ℓ=(ℓ0,…,ℓL−1)\ell=(\ell_0,\ldots,\ell_{L-1})ℓ=(ℓ0​,…,ℓL−1​) of elements of JmJ_mJm​,

tr⁡ ⁣(T(X)∏p=0L−1tℓp)=tr⁡ ⁣(X∑S⊆{0,…,L−1}(−1)c(S)WC ⁣(L,(ℓp)p∉S)∏p∈S(∑j∈JnAℓpjsj)).\operatorname{tr}\!\left(T(X)\prod_{p=0}^{L-1}t_{\ell_p}\right) = \operatorname{tr}\!\left( X\sum_{S\subseteq\{0,\ldots,L-1\}} (-1)^{c(S)}W_C\!\left(L,(\ell_p)_{p\notin S}\right) \prod_{p\in S}\left(\sum_{j\in J_n}A_{\ell_pj}s_j\right) \right).tr(T(X)p=0∏L−1​tℓp​​)=tr​XS⊆{0,…,L−1}∑​(−1)c(S)WC​(L,(ℓp​)p∈/S​)p∈S∏​​j∈Jn​∑​Aℓp​j​sj​​​.

Here every product and sublist follows increasing position order, c(S)=∣{(i,j):i∉S, j∈S, i<j}∣c(S)=|\{(i,j):i\notin S,\ j\in S,\ i<j\}|c(S)=∣{(i,j):i∈/S, j∈S, i<j}∣, and Cij=(I−AAT)ij−iBijC_{ij}=(I-AA^{\mathsf T})_{ij}-\mathrm iB_{ij}Cij​=(I−AAT)ij​−iBij​. The scalar recursion WCW_CWC​ is defined by WC(f,[])=1W_C(f,[])=1WC​(f,[])=1 for every natural fuel fff, WC(0,ℓ)=0W_C(0,\ell)=0WC​(0,ℓ)=0 for a nonempty list, and

WC(f+1,i::u)=∑j=0∣u∣−1(−1)jCi,uj WC(f,u with position j deleted).W_C(f+1,i::u)= \sum_{j=0}^{|u|-1}(-1)^j C_{i,u_j}\, W_C(f,u\text{ with position }j\text{ deleted}).WC​(f+1,i::u)=j=0∑∣u∣−1​(−1)jCi,uj​​WC​(f,u with position j deleted).

Empty products are identities and empty sums are zero; in particular, the empty-list action equation requires tr⁡(T(X))=tr⁡(X)\operatorname{tr}(T(X))=\operatorname{tr}(X)tr(T(X))=tr(X). When n=0n=0n=0 or m=0m=0m=0, the corresponding Majorana index set is empty, while the corresponding bit-string set has one element.

QAlgorithms.Papers.Independent.Advance50.P19.IsFermionicState

For every natural number nnn, every family s=(ci)0≤i<2ns=(c_i)_{0\le i<2n}s=(ci​)0≤i<2n​ of Hermitian complex matrices on the length-nnn Boolean strings satisfying cicj+cjci=2δijIc_ic_j+c_jc_i=2\delta_{ij}Ici​cj​+cj​ci​=2δij​I, and every complex matrix ρ\rhoρ on those strings, being a fermionic state means that ρ\rhoρ is positive semidefinite, tr⁡ρ=1\operatorname{tr}\rho=1trρ=1, and

ρΠs=Πsρ,Πs=i nc0c1⋯c2n−1.\rho\Pi_s=\Pi_s\rho, \qquad \Pi_s=\mathrm{i}^{\,n}c_0c_1\cdots c_{2n-1}.ρΠs​=Πs​ρ,Πs​=inc0​c1​⋯c2n−1​.

The product defining Πs\Pi_sΠs​ uses increasing index order and is the identity when n=0n=0n=0; in that case the commutation condition holds automatically.

QAlgorithms.Papers.Independent.Advance50.P19.IsGaussianState

For every natural number nnn, every family s=(ci)0≤i<2ns=(c_i)_{0\le i<2n}s=(ci​)0≤i<2n​ of Hermitian complex matrices on the length-nnn Boolean strings satisfying cicj+cjci=2δijIc_ic_j+c_jc_i=2\delta_{ij}Ici​cj​+cj​ci​=2δij​I, and every complex matrix ρ\rhoρ on those strings, being a Gaussian state means that ρ\rhoρ is positive semidefinite, has trace 111, commutes with i nc0⋯c2n−1\mathrm{i}^{\,n}c_0\cdots c_{2n-1}inc0​⋯c2n−1​, and satisfies, for every finite list l=[i1,…,ir]l=[i_1,\ldots,i_r]l=[i1​,…,ir​] of Majorana indices, including lists with repeated indices,

tr⁡(ρ ci1⋯cir)=WC(r,l),C(i,j)=tr⁡(ρ cicj).\operatorname{tr}(\rho\,c_{i_1}\cdots c_{i_r})=W_C(r,l), \qquad C(i,j)=\operatorname{tr}(\rho\,c_ic_j).tr(ρci1​​⋯cir​​)=WC​(r,l),C(i,j)=tr(ρci​cj​).

Here the ordered empty matrix product is III, and WCW_CWC​ is defined by WC(f,[])=1W_C(f,[])=1WC​(f,[])=1 for every fuel fff, WC(0,l)=0W_C(0,l)=0WC​(0,l)=0 for nonempty lll, and

WC(f+1,[i,t0,…,tq−1])=∑j=0q−1(−1)jC(i,tj) WC(f,[t0,…,tq−1] with position j deleted).W_C(f+1,[i,t_0,\ldots,t_{q-1}]) =\sum_{j=0}^{q-1}(-1)^j C(i,t_j)\, W_C(f,[t_0,\ldots,t_{q-1}]\text{ with position }j\text{ deleted}).WC​(f+1,[i,t0​,…,tq−1​])=j=0∑q−1​(−1)jC(i,tj​)WC​(f,[t0​,…,tq−1​] with position j deleted).

Thus the condition includes every list length, with the initial fuel equal to that length. At n=0n=0n=0, only the empty list occurs and the parity commutation condition is automatic.

QAlgorithms.Papers.Independent.Advance50.P19.IsGaussificationMixer

Let n,Nn,Nn,N be natural numbers, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, let sss supply Hermitian matrices γr\gamma_rγr​, 0≤r<2n0\le r<2n0≤r<2n, satisfying γrγq+γqγr=2δrqI\gamma_r\gamma_q+\gamma_q\gamma_r=2\delta_{rq}Iγr​γq​+γq​γr​=2δrq​I, and let UUU be any unitary matrix indexed by tuples of 2N2^N2N elements of QnQ_nQn​. Put Π=inγ0⋯γ2n−1\Pi=i^n\gamma_0\cdots\gamma_{2n-1}Π=inγ0​⋯γ2n−1​, with increasing factor order, and define Cj,rC_{j,r}Cj,r​ by

(Cj,r)x,y=(∏k<jΠxk,yk)(γr)xj,yj(∏k>jδxk,yk).(C_{j,r})_{x,y} = \left(\prod_{k<j}\Pi_{x_k,y_k}\right) (\gamma_r)_{x_j,y_j} \left(\prod_{k>j}\delta_{x_k,y_k}\right).(Cj,r​)x,y​=​k<j∏​Πxk​,yk​​​(γr​)xj​,yj​​​k>j∏​δxk​,yk​​​.

Writing bN(j,k)b_N(j,k)bN​(j,k) for the number of binary positions 0≤q<N0\le q<N0≤q<N at which both jjj and kkk have bit 111, the predicate means

U†Cj,rU=∑k=02N−1(−1)bN(j,k)2N Ck,rfor every 0≤j<2N, 0≤r<2n.U^\dagger C_{j,r}U = \sum_{k=0}^{2^N-1} \frac{(-1)^{b_N(j,k)}}{\sqrt{2^N}}\,C_{k,r} \quad\text{for every }0\le j<2^N,\ 0\le r<2n.U†Cj,r​U=k=0∑2N−1​2N​(−1)bN​(j,k)​Ck,r​for every 0≤j<2N, 0≤r<2n.

When n=0n=0n=0, there are no indices rrr, so the predicate holds vacuously for every supplied UUU. When N=0N=0N=0, it requires U†γrU=γrU^\dagger\gamma_rU=\gamma_rU†γr​U=γr​ for every rrr.

QAlgorithms.Papers.Independent.Advance50.P19.IsPhaseOrthogonal

For any finite type III with decidable equality and any real matrix OOO indexed by I×II\times II×I, this predicate means that both

OTO=IIandOOT=II.O^{\mathsf T}O=I_I \qquad\text{and}\qquad OO^{\mathsf T}=I_I.OTO=II​andOOT=II​.

The index type may be empty; in that case both equations hold for the unique empty matrix.

QAlgorithms.Papers.Independent.Advance50.P19.Major

For every natural number nnn, Major⁡(n)\operatorname{Major}(n)Major(n) is the finite index set {0,…,2n−1}\{0,\ldots,2n-1\}{0,…,2n−1}. For n=0n=0n=0, this set is empty.

QAlgorithms.Papers.Independent.Advance50.P19.attenuation

For every real number ppp, this defines a function on all complex matrices indexed by the two Boolean values, ordered as (false,true)(\mathrm{false},\mathrm{true})(false,true), by

Ap(ρ)=K0ρK0†+K1ρK1†,K0=(1001−p),K1=(0p00).\mathcal A_p(\rho)=K_0\rho K_0^\dagger+K_1\rho K_1^\dagger, \qquad K_0=\begin{pmatrix}1&0\\0&\sqrt{1-p}\end{pmatrix}, \qquad K_1=\begin{pmatrix}0&\sqrt p\\0&0\end{pmatrix}.Ap​(ρ)=K0​ρK0†​+K1​ρK1†​,K0​=(10​01−p​​),K1​=(00​p​0​).

There is no restriction on ppp and no density-matrix assumption on ρ\rhoρ. The square roots are the total real square-root function, which is zero on negative arguments; thus p=0\sqrt p=0p​=0 when p<0p<0p<0, and 1−p=0\sqrt{1-p}=01−p​=0 when p>1p>1p>1.

QAlgorithms.Papers.Independent.Advance50.P19.capacityObjective

For arbitrary real numbers ppp and λ\lambdaλ, this defines

F(p,λ)=h2 ⁣((1−p)(1−λ)2)−h2 ⁣(p(1−λ)2),h2(u)=−ulog⁡u−(1−u)log⁡(1−u)log⁡2.F(p,\lambda)= h_2\!\left(\frac{(1-p)(1-\lambda)}2\right) - h_2\!\left(\frac{p(1-\lambda)}2\right), \qquad h_2(u)=\frac{-u\log u-(1-u)\log(1-u)}{\log2}.F(p,λ)=h2​(2(1−p)(1−λ)​)−h2​(2p(1−λ)​),h2​(u)=log2−ulogu−(1−u)log(1−u)​.

Neither argument of h2h_2h2​ is required to lie in [0,1][0,1][0,1]. The expression uses the total real logarithm: log⁡0=0\log0=0log0=0, and for negative arguments log⁡u=log⁡∣u∣\log u=\log|u|logu=log∣u∣; in particular the terms 0log⁡00\log00log0 are zero.

QAlgorithms.Papers.Independent.Advance50.P19.choiCovariance

For any natural numbers n,mn,mn,m, any real 2m×2n2m\times2n2m×2n matrix AAA, and any real 2m×2m2m\times2m2m×2m matrix BBB, this defines the real matrix indexed by the disjoint union of a 2m2m2m-element set and a 2n2n2n-element set, with block form

(BA−AT02n×2n).\begin{pmatrix} B&A\\ -A^{\mathsf T}&0_{2n\times2n} \end{pmatrix}.(B−AT​A02n×2n​​).

There is no antisymmetry or positivity hypothesis. Zero values of nnn or mmm are allowed, with the corresponding blocks empty.

QAlgorithms.Papers.Independent.Advance50.P19.choiModeRank

For finite types A,BA,BA,B, with decidable equality on AAA, and any function TTT from complex matrices on AAA to those on BBB, this defines the natural number log⁡2nat(rank⁡JT)\log^{\mathrm{nat}}_2(\operatorname{rank}J_T)log2nat​(rankJT​), where JTJ_TJT​ is the complex matrix indexed by B×AB\times AB×A with entries (JT)(b,a),(b′,a′)=∣A∣−1T(Eaa′)bb′(J_T)_{(b,a),(b',a')}=|A|^{-1}T(E_{aa'})_{bb'}(JT​)(b,a),(b′,a′)​=∣A∣−1T(Eaa′​)bb′​, and Eaa′E_{aa'}Eaa′​ is the matrix unit. For positive rank, the natural-number logarithm is the floor of the base-two logarithm; for rank zero it is zero. Thus ranks zero and one both give value zero, and no assumption requires the rank to be a power of two. No channel hypothesis is imposed, and either finite type may be empty.

QAlgorithms.Papers.Independent.Advance50.P19.copyDensity

For every natural number nnn, every complex matrix ρ\rhoρ indexed by Qn×QnQ_n\times Q_nQn​×Qn​, where Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and every natural number NNN, this defines a matrix indexed by tuples of 2N2^N2N elements of QnQ_nQn​, with entries

Rx,y=∏j=02N−1ρxj,yj.R_{x,y}=\prod_{j=0}^{2^N-1}\rho_{x_j,y_j}.Rx,y​=j=0∏2N−1​ρxj​,yj​​.

No positivity, Hermiticity, or trace normalization is assumed for ρ\rhoρ. When N=0N=0N=0, there is one factor, so this is one copy of ρ\rhoρ under the singleton-tuple indexing. When n=0n=0n=0, QnQ_nQn​ has one element and the result is the one-entry matrix whose entry is the sole entry of ρ\rhoρ raised to 2N2^N2N.

QAlgorithms.Papers.Independent.Advance50.P19.copyMajorana

Let n,Nn,Nn,N be natural numbers, let Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, and let sss supply Hermitian matrices γr\gamma_rγr​, 0≤r<2n0\le r<2n0≤r<2n, satisfying γrγq+γqγr=2δrqI\gamma_r\gamma_q+\gamma_q\gamma_r=2\delta_{rq}Iγr​γq​+γq​γr​=2δrq​I. Define

Π=inγ0γ1⋯γ2n−1,\Pi=i^n\gamma_0\gamma_1\cdots\gamma_{2n-1},Π=inγ0​γ1​⋯γ2n−1​,

with the factors in increasing index order. For a copy index 0≤j<2N0\le j<2^N0≤j<2N and a Majorana index 0≤r<2n0\le r<2n0≤r<2n, this defines a matrix Cj,rC_{j,r}Cj,r​ on tuples of 2N2^N2N elements of QnQ_nQn​ by

(Cj,r)x,y=∏k=02N−1{Πxk,yk,k<j,(γr)xk,yk,k=j,δxk,yk,k>j.(C_{j,r})_{x,y} = \prod_{k=0}^{2^N-1} \begin{cases} \Pi_{x_k,y_k},&k<j,\\ (\gamma_r)_{x_k,y_k},&k=j,\\ \delta_{x_k,y_k},&k>j. \end{cases}(Cj,r​)x,y​=k=0∏2N−1​⎩⎨⎧​Πxk​,yk​​,(γr​)xk​,yk​​,δxk​,yk​​,​k<j,k=j,k>j.​

For N=0N=0N=0, the only copy index is j=0j=0j=0, and the result is γr\gamma_rγr​ under singleton-tuple indexing. When n=0n=0n=0, no index rrr exists, so there are no admissible arguments of that form.

QAlgorithms.Papers.Independent.Advance50.P19.fermionicCPMatrix

For any natural numbers n,mn,mn,m, any real 2m×2n2m\times2n2m×2n matrix AAA, and any real 2m×2m2m\times2m2m×2m matrix BBB, this defines the complex 2m×2m2m\times2m2m×2m matrix

I2m−AAT−iB,I_{2m}-AA^{\mathsf T}-\mathrm iB,I2m​−AAT−iB,

where the real matrices are embedded entrywise into C\mathbb CC. No positivity condition or antisymmetry condition on BBB is required. Both n=0n=0n=0 and m=0m=0m=0 are included; when n=0n=0n=0, AAT=0AA^{\mathsf T}=0AAT=0, and when m=0m=0m=0 the result is the empty square matrix.

QAlgorithms.Papers.Independent.Advance50.P19.fermionicCovariance

For every natural number nnn, every family s=(ci)0≤i<2ns=(c_i)_{0\le i<2n}s=(ci​)0≤i<2n​ of Hermitian complex matrices on the length-nnn Boolean strings satisfying cicj+cjci=2δijIc_ic_j+c_jc_i=2\delta_{ij}Ici​cj​+cj​ci​=2δij​I, and every arbitrary complex matrix ρ\rhoρ on those strings, the fermionic covariance is the real 2n×2n2n\times2n2n×2n matrix defined entrywise by

Γij=Re⁡ ⁣(i2tr⁡(ρ(cicj−cjci))),0≤i,j<2n.\Gamma_{ij} =\operatorname{Re}\!\left( \frac{\mathrm{i}}2\operatorname{tr}\bigl(\rho(c_ic_j-c_jc_i)\bigr) \right), \qquad 0\le i,j<2n.Γij​=Re(2i​tr(ρ(ci​cj​−cj​ci​))),0≤i,j<2n.

This formula includes equal indices, where the commutator is zero. For n=0n=0n=0, it defines the empty matrix.

QAlgorithms.Papers.Independent.Advance50.P19.fermionicNoiseContraction

For all natural numbers n,mn,mn,m, every real 2m×2n2m\times2n2m×2n matrix AAA, and every real 2m×2m2m\times2m2m×2m matrix BBB, the fermionic noise contraction is the complex-valued function on pairs i,j∈{0,…,2m−1}i,j\in\{0,\ldots,2m-1\}i,j∈{0,…,2m−1} defined by

CA,B(i,j)=(I2m−AAT)ij−iBij.C_{A,B}(i,j)=(I_{2m}-AA^{\mathsf T})_{ij}-\mathrm{i}B_{ij}.CA,B​(i,j)=(I2m​−AAT)ij​−iBij​.

The matrices A,BA,BA,B are arbitrary. When n=0n=0n=0, the product AATAA^{\mathsf T}AAT is zero because its entrywise sums are empty; when m=0m=0m=0, the function has empty domain.

QAlgorithms.Papers.Independent.Advance50.P19.gaussianObservable

For all natural numbers n,mn,mn,m, every family s=(cj)0≤j<2ns=(c_j)_{0\le j<2n}s=(cj​)0≤j<2n​ of Hermitian complex matrices on the length-nnn Boolean strings satisfying cicj+cjci=2δijIc_ic_j+c_jc_i=2\delta_{ij}Ici​cj​+cj​ci​=2δij​I, every real 2m×2n2m\times2n2m×2n matrix AAA, every real 2m×2m2m\times2m2m×2m matrix BBB, and every finite list l=[l0,…,lr−1]l=[l_0,\ldots,l_{r-1}]l=[l0​,…,lr−1​] with entries in {0,…,2m−1}\{0,\ldots,2m-1\}{0,…,2m−1}, the Gaussian observable is

Gs,A,B(l)=∑S⊆{0,…,r−1}(−1)χ(S)WCA,B ⁣(r,[lp:p∉S in increasing order])∏p∈Sin increasing order(∑j=02n−1Alpjcj),G_{s,A,B}(l)= \sum_{S\subseteq\{0,\ldots,r-1\}} (-1)^{\chi(S)} W_{C_{A,B}}\!\left(r,[l_p:p\notin S\text{ in increasing order}]\right) \prod_{\substack{p\in S\\\text{in increasing order}}} \left(\sum_{j=0}^{2n-1}A_{l_pj}c_j\right),Gs,A,B​(l)=S⊆{0,…,r−1}∑​(−1)χ(S)WCA,B​​(r,[lp​:p∈/S in increasing order])p∈Sin increasing order​∏​(j=0∑2n−1​Alp​j​cj​),

where χ(S)=∣{(i,j):0≤i<j<r, i∉S, j∈S}∣\chi(S)=|\{(i,j):0\le i<j<r,\ i\notin S,\ j\in S\}|χ(S)=∣{(i,j):0≤i<j<r, i∈/S, j∈S}∣, and CA,B(i,j)=(I2m−AAT)ij−iBijC_{A,B}(i,j)=(I_{2m}-AA^{\mathsf T})_{ij}-\mathrm{i}B_{ij}CA,B​(i,j)=(I2m​−AAT)ij​−iBij​. The scalar recursion used here is WC(f,[])=1W_C(f,[])=1WC​(f,[])=1 for every fuel fff, WC(0,L)=0W_C(0,L)=0WC​(0,L)=0 for every nonempty list LLL, and

WC(f+1,[i,t0,…,tq−1])=∑j=0q−1(−1)jC(i,tj) WC(f,[t0,…,tq−1] with position j deleted).W_C(f+1,[i,t_0,\ldots,t_{q-1}]) =\sum_{j=0}^{q-1}(-1)^jC(i,t_j)\, W_C(f,[t_0,\ldots,t_{q-1}]\text{ with position }j\text{ deleted}).WC​(f+1,[i,t0​,…,tq−1​])=j=0∑q−1​(−1)jC(i,tj​)WC​(f,[t0​,…,tq−1​] with position j deleted).

The initial fuel is the full original list length rrr for every subset SSS. List entries may repeat, all ordered empty matrix products are identities, and empty sums are zero; in particular, Gs,A,B([])=IG_{s,A,B}([])=IGs,A,B​([])=I. Zero values of nnn or mmm are included.

QAlgorithms.Papers.Independent.Advance50.P19.insertFermionicCopy

For natural numbers n,Nn,Nn,N, a chosen index 0≤j<2N0\le j<2^N0≤j<2N, a bit string a∈Qn={0,1}na\in Q_n=\{0,1\}^na∈Qn​={0,1}n, and an assignment zk∈Qnz_k\in Q_nzk​∈Qn​ for every index k≠jk\ne jk=j, this defines the full tuple xxx by

xk={a,k=j,zk,k≠j.x_k= \begin{cases} a,&k=j,\\ z_k,&k\ne j. \end{cases}xk​={a,zk​,​k=j,k=j.​

When N=0N=0N=0, j=0j=0j=0, the assignment zzz has empty domain, and the result is the singleton tuple containing aaa. When n=0n=0n=0, all entries are necessarily the unique empty bit string.

QAlgorithms.Papers.Independent.Advance50.P19.majoranaContraction

For every natural number nnn, every family s=(ci)0≤i<2ns=(c_i)_{0\le i<2n}s=(ci​)0≤i<2n​ of Hermitian complex matrices on the length-nnn Boolean strings satisfying cicj+cjci=2δijIc_ic_j+c_jc_i=2\delta_{ij}Ici​cj​+cj​ci​=2δij​I, every arbitrary complex matrix ρ\rhoρ on those strings, and every i,j∈{0,…,2n−1}i,j\in\{0,\ldots,2n-1\}i,j∈{0,…,2n−1}, the Majorana contraction is the complex number

Cs,ρ(i,j)=tr⁡(ρ cicj).C_{s,\rho}(i,j)=\operatorname{tr}(\rho\,c_ic_j).Cs,ρ​(i,j)=tr(ρci​cj​).

Equal indices are included. At n=0n=0n=0, there are no indices at which this function can be evaluated.

QAlgorithms.Papers.Independent.Advance50.P19.mixedCopyMarginal

For natural numbers n,Nn,Nn,N, any complex matrix ρ\rhoρ indexed by Qn×QnQ_n\times Q_nQn​×Qn​, where Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n, any unitary matrix UUU indexed by tuples of 2N2^N2N elements of QnQ_nQn​, and any 0≤j<2N0\le j<2^N0≤j<2N, form

Rx,y=∏k=02N−1ρxk,yk,R~=URU†.R_{x,y}=\prod_{k=0}^{2^N-1}\rho_{x_k,y_k}, \qquad \widetilde R=URU^\dagger.Rx,y​=k=0∏2N−1​ρxk​,yk​​,R=URU†.

This defines the matrix σj\sigma_jσj​ indexed by Qn×QnQ_n\times Q_nQn​×Qn​ through

(σj)a,b=∑z:{0,…,2N−1}∖{j}→QnR~xa,z,xb,z,xka,z={a,k=j,zk,k≠j.(\sigma_j)_{a,b} = \sum_{z:\{0,\ldots,2^N-1\}\setminus\{j\}\to Q_n} \widetilde R_{x^{a,z},x^{b,z}}, \qquad x^{a,z}_k= \begin{cases}a,&k=j,\\z_k,&k\ne j.\end{cases}(σj​)a,b​=z:{0,…,2N−1}∖{j}→Qn​∑​Rxa,z,xb,z​,xka,z​={a,zk​,​k=j,k=j.​

No density-matrix assumption on ρ\rhoρ, or additional mixing condition on UUU, is imposed. When N=0N=0N=0, the sum has one term and gives UρU†U\rho U^\daggerUρU† under singleton-tuple indexing; when n=0n=0n=0, the result has the single entry ρ∅,∅ 2N\rho_{\varnothing,\varnothing}^{\,2^N}ρ∅,∅2N​.

QAlgorithms.Papers.Independent.Advance50.P19.monomial

For every natural number nnn, every family s=(ci)0≤i<2ns=(c_i)_{0\le i<2n}s=(ci​)0≤i<2n​ of Hermitian complex matrices on the length-nnn Boolean strings satisfying cicj+cjci=2δijIc_ic_j+c_jc_i=2\delta_{ij}Ici​cj​+cj​ci​=2δij​I, and every finite list l=[i1,…,ir]l=[i_1,\ldots,i_r]l=[i1​,…,ir​] of indices in {0,…,2n−1}\{0,\ldots,2n-1\}{0,…,2n−1}, the monomial is the matrix product

monomial⁡(s,l)=ci1⋯cir\operatorname{monomial}(s,l)=c_{i_1}\cdots c_{i_r}monomial(s,l)=ci1​​⋯cir​​

in the listed order. Indices may repeat, and the product of the empty list is the identity matrix. For n=0n=0n=0, the empty list is the only possible list.

QAlgorithms.Papers.Independent.Advance50.P19.normalizedChoiDensity

For a finite type AAA with decidable equality, an arbitrary type BBB, and any function TTT from complex matrices on AAA to complex matrices on BBB, this defines the complex matrix JTJ_TJT​ indexed by B×AB\times AB×A whose entries are

(JT)(b,a),(b′,a′)=∣A∣−1 T(Eaa′)bb′,(J_T)_{(b,a),(b',a')}=|A|^{-1}\,T(E_{aa'})_{bb'},(JT​)(b,a),(b′,a′)​=∣A∣−1T(Eaa′​)bb′​,

where Eaa′E_{aa'}Eaa′​ has entry 111 at (a,a′)(a,a')(a,a′) and zero elsewhere, and the reciprocal is taken in C\mathbb CC. No channel, positivity, or trace condition is assumed. The type BBB need not be finite. If AAA is empty, the reciprocal is the totalized value 0−1=00^{-1}=00−1=0, and the resulting matrix has an empty index set.

QAlgorithms.Papers.Independent.Advance50.P19.normalizedNoise

For any natural numbers n,mn,mn,m, any real 2m×2n2m\times2n2m×2n matrix AAA, and any real 2m×2m2m\times2m2m×2m matrix BBB, put H=I2m−AATH=I_{2m}-AA^{\mathsf T}H=I2m​−AAT, regarded entrywise as a complex Hermitian matrix. This defines the complex matrix RBRRBRRBR, where BBB is also embedded entrywise into C\mathbb CC and R=f(H)R=f(H)R=f(H) is obtained by spectral functional calculus with f(x)=(x)−1f(x)=(\sqrt{x})^{-1}f(x)=(x​)−1. Explicitly, RRR acts on an eigenvector of HHH with eigenvalue λ>0\lambda>0λ>0 by multiplication by 1/λ1/\sqrt{\lambda}1/λ​, and on an eigenvector with λ≤0\lambda\le0λ≤0 by zero, using the totalized real square root and reciprocal. No positivity or invertibility of HHH, and no antisymmetry of BBB, is assumed. The definition includes n=0n=0n=0 and m=0m=0m=0, with an empty resulting matrix when m=0m=0m=0.

QAlgorithms.Papers.Independent.Advance50.P19.nullityC

For any finite types I,JI,JI,J and complex matrix MMM with rows indexed by III and columns indexed by JJJ, this defines the complex dimension

dim⁡C{x∈CJ: ∀i∈I, ∑j∈JMijxj=0}.\dim_{\mathbb C}\{x\in\mathbb C^J:\ \forall i\in I,\ \sum_{j\in J}M_{ij}x_j=0\}.dimC​{x∈CJ: ∀i∈I, j∈J∑​Mij​xj​=0}.

Empty index types are included: an empty column type gives nullity zero, and an empty row type gives nullity ∣J∣|J|∣J∣.

QAlgorithms.Papers.Independent.Advance50.P19.nullityR

For any finite types I,JI,JI,J and real matrix MMM with rows indexed by III and columns indexed by JJJ, this defines the real dimension

dim⁡R{x∈RJ: ∀i∈I, ∑j∈JMijxj=0}.\dim_{\mathbb R}\{x\in\mathbb R^J:\ \forall i\in I,\ \sum_{j\in J}M_{ij}x_j=0\}.dimR​{x∈RJ: ∀i∈I, j∈J∑​Mij​xj​=0}.

Empty index types are included: an empty column type gives nullity zero, and an empty row type gives nullity ∣J∣|J|∣J∣.

QAlgorithms.Papers.Independent.Advance50.P19.sylvesterCoefficient

For every natural number NNN and integers j,kj,kj,k satisfying 0≤j,k<2N0\le j,k<2^N0≤j,k<2N, this defines

Hjk(N)=(−1) ∣{r:0≤r<N, bit r of j=1 and bit r of k=1}∣2N,H^{(N)}_{jk} = \frac{(-1)^{\,|\{r:0\le r<N,\ \text{bit }r\text{ of }j=1 \ \text{and bit }r\text{ of }k=1\}|}} {\sqrt{2^N}},Hjk(N)​=2N​(−1)∣{r:0≤r<N, bit r of j=1 and bit r of k=1}∣​,

where bit 000 is the least significant binary bit. The denominator is always positive. When N=0N=0N=0, the only indices are j=k=0j=k=0j=k=0, the counted set is empty, and the coefficient is 111.

QAlgorithms.Papers.Independent.Advance50.P19.totalFermionParity

For every natural number nnn and every family s=(ci)0≤i<2ns=(c_i)_{0\le i<2n}s=(ci​)0≤i<2n​ of Hermitian complex matrices on the length-nnn Boolean strings satisfying cicj+cjci=2δijIc_ic_j+c_jc_i=2\delta_{ij}Ici​cj​+cj​ci​=2δij​I, the total fermion parity matrix is defined by

Πs=i nc0c1⋯c2n−1,\Pi_s=\mathrm{i}^{\,n}c_0c_1\cdots c_{2n-1},Πs​=inc0​c1​⋯c2n−1​,

with the factors in increasing index order. At n=0n=0n=0, the empty product and the scalar i0\mathrm{i}^0i0 are both 111, so Πs\Pi_sΠs​ is the identity on the one-dimensional space indexed by the empty Boolean string.

QAlgorithms.Papers.Independent.Advance50.P19.wick

For every type III and every function C:I×I→CC:I\times I\to\mathbb CC:I×I→C, this definition assigns a complex number WC(f,l)W_C(f,l)WC​(f,l) to every natural-number fuel fff and every finite list lll of elements of III. Its complete recursion is

WC(f,[])=1for every f,WC(0,l)=0when l≠[],W_C(f,[])=1\quad\text{for every }f,\qquad W_C(0,l)=0\quad\text{when }l\ne[],WC​(f,[])=1for every f,WC​(0,l)=0when l=[],

and, for f≥0f\ge0f≥0 and l=[i,t0,…,tr−1]l=[i,t_0,\ldots,t_{r-1}]l=[i,t0​,…,tr−1​],

WC(f+1,l)=∑j=0r−1(−1)jC(i,tj) WC ⁣(f,[t0,…,tr−1] with position j deleted).W_C(f+1,l)= \sum_{j=0}^{r-1}(-1)^j C(i,t_j)\, W_C\!\left(f,[t_0,\ldots,t_{r-1}]\text{ with position }j\text{ deleted}\right).WC​(f+1,l)=j=0∑r−1​(−1)jC(i,tj​)WC​(f,[t0​,…,tr−1​] with position j deleted).

Positions are numbered starting at zero, deletion removes that occurrence, and the order of all remaining entries is preserved. The fuel and list length are independent arguments; in particular, an empty list always returns 111, while a singleton list always returns 000. No finiteness or symmetry condition is imposed on III or CCC.

Human review
  • Endorsed by Shuze Chen · Oct 29, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 29, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me