Offline · exact source
Exact Lean source

MatrixFidelityBlocks

formalization/Cloning/MatrixFidelityBlocks.lean

Source hash: 100f20b570167e34c0a5d4ade9760ac52dac583b4214f135824ee46e2bd1a37c

Full source copied without mathematical changes from the snapshot whose input hash matches the passing audit. Select a line number for a stable source pointer.

The declarations belong to the compiled inventory covered by the project’s shared axiom audit. That audit records an aggregate union, without attributing axioms to individual declarations.

Declarations in this module
1import Cloning.MatrixFidelity
2 
3/-!
4# Fidelity of finite dependent block-diagonal matrices
5 
6The square-root identity is proved from positivity and uniqueness of positive
7square roots. The block index and every block's matrix dimension are finite;
8different blocks may have different dimensions.
9-/
10 
11noncomputable section
12open scoped BigOperators Matrix MatrixOrder ComplexOrder
13open Matrix
14namespace Cloning.MatrixFidelity
15 
16set_option backward.isDefEq.respectTransparency false
17 
18variable {ι : Type*} [Fintype ι] [DecidableEq ι]
19variable {d : ι → Type*} [∀ i, Fintype (d i)] [∀ i, DecidableEq (d i)]
20 
21/-- Positive semidefiniteness of a finite dependent direct sum. -/
22lemma blockDiagonal'_posSemidef (A : ∀ i, Matrix (d i) (d i) ℂ)
23    (hA : ∀ i, (A i).PosSemidef) : (Matrix.blockDiagonal' A).PosSemidef := by
24  let S := Matrix.blockDiagonal' (fun i => CFC.sqrt (A i))
25  have hsq : S.conjTranspose * S = Matrix.blockDiagonal' A := by
26    dsimp [S]
27    rw [Matrix.blockDiagonal'_conjTranspose, ← Matrix.blockDiagonal'_mul]
28    congr 1
29    funext i
30    rw [((CFC.sqrt_nonneg (A i)).posSemidef).isHermitian.eq]
31    exact CFC.sqrt_mul_sqrt_self (A i) (hA i).nonneg
32  rw [← hsq]
33  exact Matrix.posSemidef_conjTranspose_mul_self S
34 
35/-- The positive square root commutes with finite dependent direct sums. -/
36lemma sqrt_blockDiagonal' (A : ∀ i, Matrix (d i) (d i) ℂ)
37    (hA : ∀ i, (A i).PosSemidef) :
38    CFC.sqrt (Matrix.blockDiagonal' A) =
39      Matrix.blockDiagonal' (fun i => CFC.sqrt (A i)) := by
40  apply CFC.sqrt_unique
41  · rw [← Matrix.blockDiagonal'_mul]
42    congr 1
43    funext i
44    exact CFC.sqrt_mul_sqrt_self (A i) (hA i).nonneg
45  · exact (blockDiagonal'_posSemidef _
46      (fun i => (CFC.sqrt_nonneg (A i)).posSemidef)).nonneg
47 
48/-- Root fidelity is additive over finite dependent orthogonal direct sums.
49This theorem uses the concrete matrix definition, not an abstract fidelity law. -/
50lemma fidelity_blockDiagonal' (A B : ∀ i, Matrix (d i) (d i) ℂ)
51    (hA : ∀ i, (A i).PosSemidef) (hB : ∀ i, (B i).PosSemidef) :
52    fidelity (Matrix.blockDiagonal' A) (Matrix.blockDiagonal' B) =
53      ∑ i, fidelity (A i) (B i) := by
54  unfold fidelity
55  rw [sqrt_blockDiagonal' B hB, ← Matrix.blockDiagonal'_mul,
56    ← Matrix.blockDiagonal'_mul]
57  rw [sqrt_blockDiagonal' _ (fun i => sandwich_posSemidef (hA i) (B i)),
58    Matrix.trace_blockDiagonal']
59  simp
60 
61end Cloning.MatrixFidelity