Offline · exact source
Exact Lean source

PCTCountMeasurementImage

formalization/Cloning/PCTCountMeasurementImage.lean

Source hash: 2915e1efff0251e4f76bd0bb047f134596eb0b2929a6fe06efb4f8fcd64c0c42

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.PCTCountMeasurementFidelity
2 
3/-! A finite computational measurement with arbitrary labels, including the
4full affine count lattice. Its finite image supplies the actual CPTP map. -/
5noncomputable section
6open scoped BigOperators InnerProductSpace ComplexOrder Classical
7namespace Cloning.PCTCountMeasurement
8open Cloning.PCT Cloning.InfiniteTraceClass Cloning.Hybrid
9set_option backward.isDefEq.respectTransparency false
10set_option maxHeartbeats 1000000
11variable {H I J : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H]
12  [Fintype I]
13 
14theorem weightCLM_apply_any (b : I → H) (label : I → J) (j : J) (A : TraceClass H) :
15    weightCLM b label j A = ∑ i, if label i=j then (⟪b i,A.1 (b i)⟫_ℂ).re else 0 := by
16  simp only [weightCLM, ContinuousLinearMap.sum_apply]
17  apply Finset.sum_congr rfl
18  intro i _
19  by_cases hi : label i=j
20  · simp only [if_pos hi]; rfl
21  · simp only [if_neg hi, ContinuousLinearMap.zero_apply]
22 
23def imageLabel (label : I → J) (i : I) : Set.range label := ⟨label i, i, rfl⟩
24 
25instance imageLabelFintype (label : I → J) : Fintype (Set.range label) :=
26  (Set.finite_range label).fintype
27 
28theorem weightCLM_image (b : I → H) (label : I → J) (j : Set.range label) (A : TraceClass H) :
29    weightCLM b (imageLabel label) j A = weightCLM b label j.val A := by
30  simp only [weightCLM_apply, weightCLM_apply_any]
31  apply Finset.sum_congr rfl
32  intro i _
33  have he : imageLabel label i=j ↔ label i=j.val := Subtype.ext_iff
34  rw [he]
35 
36theorem weightCLM_zero_outside (b : I → H) (label : I → J) (A : TraceClass H)
37    (j : J) (hj : j ∉ Set.range label) : weightCLM b label j A=0 := by
38  rw [weightCLM_apply_any]
39  apply Finset.sum_eq_zero
40  intro i _
41  exact if_neg (fun h => hj ⟨i,h⟩)
42 
43theorem weightCLM_support (b : I → H) (label : I → J) (A : TraceClass H) :
44    Function.support (fun j => weightCLM b label j A) ⊆ Set.range label := by
45  intro j hj
46  by_contra hn
47  exact hj (weightCLM_zero_outside b label A j hn)
48 
49theorem weightCLM_summable (b : I → H) (label : I → J) (A : TraceClass H) :
50    Summable (fun j => weightCLM b label j A) :=
51  summable_of_hasFiniteSupport ((Set.finite_range label).subset (weightCLM_support b label A))
52 
53theorem weightCLM_nonneg_any (b : I → H) (label : I → J) (A : TraceClass H)
54    (hA : 0≤A.1) (j : J) : 0≤weightCLM b label j A := by
55  by_cases hj : j∈Set.range label
56  · rw [← weightCLM_image b label ⟨j,hj⟩ A]
57    exact weightCLM_nonneg b (imageLabel label) ⟨j,hj⟩ A hA
58  · rw [weightCLM_zero_outside b label A j hj]
59 
60theorem tsum_eq_image_sum (label : I → J) (f : J → ℝ)
61    (hf : ∀ j, j∉Set.range label → f j=0) :
62    (∑' j, f j) = ∑ j : Set.range label, f j.val := by
63  have he : (∑' j : Set.range label, f j.val) = ∑' j, f j :=
64    tsum_subtype_eq_of_support_subset (by
65      intro j hj
66      by_contra hn
67      exact hj (hf j hn))
68  simpa only [tsum_fintype] using he.symm
69 
70theorem weightCLM_tsum (b : OrthonormalBasis I ℂ H) (label : I → J) (A : TraceClass H) :
71    (∑' j, weightCLM b label j A)=(traceCLM A).re := by
72  rw [tsum_eq_image_sum label _ (weightCLM_zero_outside b label A)]
73  simp_rw [← weightCLM_image]
74  exact weightCLM_sum b (imageLabel label) A
75 
76theorem weightCLM_tsum_l1_contraction (b : OrthonormalBasis I ℂ H) (label : I → J)
77    (A B : TraceClass H) (hA : 0≤A.1) (hB : 0≤B.1) :
78    (∑' j, |weightCLM b label j A-weightCLM b label j B|)≤‖A-B‖ := by
79  rw [tsum_eq_image_sum label _ (by
80    intro j hj
81    rw [weightCLM_zero_outside b label A j hj, weightCLM_zero_outside b label B j hj]
82    simp)]
83  simp_rw [← weightCLM_image]
84  exact weightCLM_l1_contraction b (imageLabel label) A B hA hB
85 
86theorem rootFidelity_le_tsum_affinity [DecidableEq I] (label : I → J)
87    (A B : PositiveTraceClass (Register I)) :
88    A.rootFidelity B ≤ ∑' j, Real.sqrt (weightCLM (registerBasis I) label j A.1) *
89      Real.sqrt (weightCLM (registerBasis I) label j B.1) := by
90  rw [tsum_eq_image_sum label _ (by
91    intro j hj
92    rw [weightCLM_zero_outside _ label A.1 j hj]
93    simp)]
94  simp_rw [← weightCLM_image]
95  have h := rootFidelity_le_measurement_affinity (imageLabel label) A B
96  simpa only [Real.sqrt_mul (weightCLM_nonneg _ _ _ A.1 A.2)] using h
97 
98end Cloning.PCTCountMeasurement