Offline · exact source
Exact Lean source

TensorLANEmbeddingSelector

formalization/Cloning/TensorLANEmbeddingSelector.lean

Source hash: 8f66ace2b41b6c93296ec726438ba3b2702591cac931185e491b58144ed633aa

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.TensorLANEmbeddingSchur
2import Cloning.TensorSchurDecompositionMultiplicity
3 
4/-! The reverse cell selector chooses physical copies uniformly within the
5measured partition label. Its weights and outside fallback sum to one by the
6proved physical multiplicity count, without a normalization premise. -/
7noncomputable section
8open scoped BigOperators Classical
9namespace Cloning.TensorLAN
10open MeasureTheory Cloning.TensorLie Cloning.PCT Cloning.InfiniteTraceClass Cloning.Hybrid
11set_option maxHeartbeats 800000
12set_option backward.isDefEq.respectTransparency false
13 
14section Selector
15variable {ι Λ X : Type*} [Fintype ι] [DecidableEq Λ] [MeasurableSpace Λ]
16  [MeasurableSingletonClass Λ] [MeasurableSpace X] {ν : Measure X}
17 
18def labelMultiplicity (labels : ι → Λ) (a : Λ) : ℕ :=
19  (Finset.univ.filter (fun i => labels i = a)).card
20 
21def copyCellWeight (labels : ι → Λ) (q : X → Λ) (i : ι) (x : X) : ℝ :=
22  if q x = labels i then 1 / (labelMultiplicity labels (labels i) : ℝ) else 0
23 
24def uniformLabelSelector (labels : ι → Λ) (q : X → Λ) : Option ι → X → ℝ
25  | none, x => 1 - ∑ i, copyCellWeight labels q i x
26  | some i, x => copyCellWeight labels q i x
27 
28theorem copyCellWeight_nonneg (labels : ι → Λ) (q : X → Λ) (i : ι) (x : X) :
29    0 ≤ copyCellWeight labels q i x := by
30  unfold copyCellWeight
31  split_ifs <;> positivity
32 
33theorem copyCellWeight_sum (labels : ι → Λ) (q : X → Λ) (x : X) :
34    (∑ i, copyCellWeight labels q i x) =
35      if labelMultiplicity labels (q x) = 0 then 0 else 1 := by
36  have he : (∑ i, copyCellWeight labels q i x) =
37      (∑ i : ι, if labels i = q x then (1 : ℝ) else 0) / labelMultiplicity labels (q x) := by
38    rw [Finset.sum_div]
39    apply Finset.sum_congr rfl
40    intro i _
41    by_cases hi : labels i = q x <;> simp [copyCellWeight, hi, eq_comm]
42  rw [he]
43  have hc : (∑ i : ι, if labels i = q x then (1 : ℝ) else 0) =
44      (labelMultiplicity labels (q x) : ℝ) := by
45    simp [labelMultiplicity]
46  rw [hc]
47  by_cases hz : labelMultiplicity labels (q x) = 0
48  · simp [hz]
49  · simp [hz, Nat.cast_ne_zero.mpr hz]
50 
51theorem uniformLabelSelector_nonneg (labels : ι → Λ) (q : X → Λ) (i : Option ι) (x : X) :
52    0 ≤ uniformLabelSelector labels q i x := by
53  cases i with
54  | none => simp only [uniformLabelSelector, copyCellWeight_sum]; split_ifs <;> norm_num
55  | some i => exact copyCellWeight_nonneg labels q i x
56 
57theorem uniformLabelSelector_sum (labels : ι → Λ) (q : X → Λ) (x : X) :
58    (∑ i : Option ι, uniformLabelSelector labels q i x) = 1 := by
59  rw [Fintype.sum_option]
60  simp only [uniformLabelSelector]
61  ring
62 
63theorem copyCellWeight_measurable (labels : ι → Λ) (q : X → Λ) (hq : Measurable q) (i : ι) :
64    Measurable (copyCellWeight labels q i) := by
65  apply Measurable.ite _ measurable_const measurable_const
66  exact hq (measurableSet_singleton (labels i))
67 
68theorem uniformLabelSelector_measurable (labels : ι → Λ) (q : X → Λ) (hq : Measurable q)
69    (i : Option ι) : Measurable (uniformLabelSelector labels q i) := by
70  cases i with
71  | none =>
72      exact measurable_const.sub (Finset.measurable_sum _
73        (fun j _ => copyCellWeight_measurable labels q hq j))
74  | some i => exact copyCellWeight_measurable labels q hq i
75 
76end Selector
77 
78local instance (n d : ℕ) : FiniteDimensional ℂ (TensorRegister n (Fin d)) :=
79  (registerBasis (Fin n → Fin d)).toOrthonormalBasis.toBasis.finiteDimensional_of_finite
80 
81def schurCopyLabel (n d : ℕ) (i : SchurCopy n d) : Fin d → ℕ :=
82  ((recursivePhysicalDecomposition n d).get i).weight
83 
84theorem schurCopyLabel_multiplicity (n d : ℕ) (a : Fin d → ℕ) :
85    labelMultiplicity (schurCopyLabel n d) a = Cloning.YoungGeneral.standardCount n a :=
86  recursivePhysicalDecomposition_copyCount n d a
87 
88variable {X : Type*} [MeasurableSpace X] {ν : Measure X}
89 
90/-- Read a measurable classical label, choose uniformly among its actual
91physical copies, and use the explicit physical fallback outside the label set. -/
92def schurReverseFromLabels (n d R : ℕ) (ρ : DensityState (TensorRegister n (Fin d)))
93    (q : X → Fin d → ℕ) (hq : Measurable q) :
94    HybridToQuantum (RootFock d) (TensorRegister n (Fin d)) ν :=
95  schurReverse n d R ρ (uniformLabelSelector (schurCopyLabel n d) q)
96    (fun i => (uniformLabelSelector_measurable _ _ hq i).aestronglyMeasurable)
97    (uniformLabelSelector_nonneg _ _) (uniformLabelSelector_sum _ _)
98 
99/-- On each label cell the reverse channel uses exactly reciprocal tableau
100multiplicity, now identified with the actual physical copy count. -/
101theorem schurReverseFromLabels_copy_weight (n d : ℕ) (q : X → Fin d → ℕ)
102    (i : SchurCopy n d) (x : X) :
103    uniformLabelSelector (schurCopyLabel n d) q (some i) x =
104      if q x = schurCopyLabel n d i then
105        1 / (Cloning.YoungGeneral.standardCount n (schurCopyLabel n d i) : ℝ) else 0 := by
106  simp only [uniformLabelSelector, copyCellWeight, schurCopyLabel_multiplicity]
107 
108end Cloning.TensorLAN