Offline · exact source
Exact Lean source

TensorLANEmbeddingSelectorRecovery

formalization/Cloning/TensorLANEmbeddingSelectorRecovery.lean

Source hash: f0f708fe00f389ad31054c0773a1fd8be347d367f21cc70ef38f7a8655c7dab4

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.TensorLANEmbeddingCellWeights
2 
3/-! Exact reconstruction of physical copy probabilities by the reverse
4uniform-within-label selector. -/
5noncomputable section
6open scoped BigOperators Topology Classical InnerProductSpace NNReal ENNReal
7open MeasureTheory Filter
8namespace Cloning.TensorLAN
9open Cloning.YoungHyperplane Cloning.TensorLie Cloning.PCTJointGaussianWhitening
10set_option backward.isDefEq.respectTransparency false
11set_option maxHeartbeats 1200000
12 
13section Generic
14variable {ι Λ X : Type*} [Fintype ι] [DecidableEq Λ] [MeasurableSpace Λ]
15  [MeasurableSingletonClass Λ] [MeasurableSpace X] {ν : Measure X}
16 
17theorem labelMultiplicity_own_pos (labels : ι → Λ) (i : ι) :
18    0 < labelMultiplicity labels (labels i) := by
19  apply Finset.card_pos.mpr
20  exact ⟨i, by simp [labelMultiplicity]⟩
21 
22theorem copyCellWeight_mul_integrable (labels : ι → Λ) (q : X → Λ)
23    (hq : Measurable q) (f : X → ℝ) (hf : Integrable f ν) (i : ι) :
24    Integrable (fun x => copyCellWeight labels q i x * f x) ν := by
25  have he : (fun x => copyCellWeight labels q i x*f x) =
26      fun x => (1/(labelMultiplicity labels (labels i) : ℝ)) *
27        ((q ⁻¹' {labels i}).indicator f) x := by
28    funext x
29    by_cases hx : q x = labels i <;> simp [copyCellWeight, Set.indicator, hx]
30  rw [he]
31  exact (hf.indicator (hq (measurableSet_singleton _))).const_mul _
32 
33theorem integral_copyCellWeight_mul (labels : ι → Λ) (q : X → Λ)
34    (hq : Measurable q) (f : X → ℝ) (i : ι) :
35    (∫ x, copyCellWeight labels q i x*f x ∂ν) =
36      YoungRounding.binMass ν q f (labels i) / labelMultiplicity labels (labels i) := by
37  have he : (fun x => copyCellWeight labels q i x*f x) =
38      fun x => (1/(labelMultiplicity labels (labels i) : ℝ)) *
39        ((q ⁻¹' {labels i}).indicator f) x := by
40    funext x
41    by_cases hx : q x = labels i <;> simp [copyCellWeight, Set.indicator, hx]
42  rw [he, integral_const_mul, integral_indicator (hq (measurableSet_singleton _))]
43  simp only [YoungRounding.binMass, one_div, div_eq_mul_inv, mul_comm,
44    one_mul]
45 
46theorem copyCellWeight_recovers (labels : ι → Λ) (q : X → Λ)
47    (hq : Measurable q) (f : X → ℝ) (w : ι → ℝ)
48    (hlabels : ∀ i j, labels i = labels j → w i = w j)
49    (hmass : ∀ a, YoungRounding.binMass ν q f a =
50      ∑ i, if labels i = a then w i else 0) (i : ι) :
51    (∫ x, copyCellWeight labels q i x*f x ∂ν) = w i := by
52  rw [integral_copyCellWeight_mul labels q hq f i, hmass]
53  have he : (∑ j, if labels j = labels i then w j else 0) =
54      (labelMultiplicity labels (labels i) : ℝ)*w i := by
55    calc
56      _ = ∑ j, if labels j = labels i then w i else 0 := by
57        apply Finset.sum_congr rfl
58        intro j _
59        split_ifs with h
60        · exact hlabels j i h
61        · rfl
62      _ = _ := by simp [labelMultiplicity, Finset.sum_ite, mul_comm]
63  rw [he]
64  exact mul_div_cancel_left₀ _ (Nat.cast_ne_zero.mpr (labelMultiplicity_own_pos labels i).ne')
65 
66theorem uniformLabelSelector_recovers (labels : ι → Λ) (q : X → Λ)
67    (hq : Measurable q) (f : X → ℝ) (hf : Integrable f ν) (hint : ∫ x, f x ∂ν = 1)
68    (w : ι → ℝ) (hw : ∑ i, w i = 1)
69    (hlabels : ∀ i j, labels i = labels j → w i = w j)
70    (hmass : ∀ a, YoungRounding.binMass ν q f a =
71      ∑ i, if labels i = a then w i else 0) (i : Option ι) :
72    (∫ x, uniformLabelSelector labels q i x*f x ∂ν) =
73      i.elim 0 w := by
74  cases i with
75  | some i => exact copyCellWeight_recovers labels q hq f w hlabels hmass i
76  | none =>
77    have he : (fun x => uniformLabelSelector labels q none x*f x) =
78        fun x => f x - ∑ i, copyCellWeight labels q i x*f x := by
79      funext x
80      simp [uniformLabelSelector, sub_mul, Finset.sum_mul]
81    rw [he, integral_sub hf (integrable_finset_sum _
82      (fun i _ => copyCellWeight_mul_integrable labels q hq f hf i)),
83      integral_finset_sum _ (fun i _ => copyCellWeight_mul_integrable labels q hq f hf i)]
84    simp_rw [copyCellWeight_recovers labels q hq f w hlabels hmass]
85    simp only [hint, hw, sub_self, Option.elim_none]
86end Generic
87 
88/-- Copies with the same literal affine label have the same actual character
89weight, because their canonical cyclic sectors are identical. -/
90theorem physicalCopy_character_eq_of_lattice_eq (N d : ℕ) (p : Fin (d+1) → ℝ)
91    (i j : SchurCopy N (d+1)) (h : schurCopyLattice N d i = schurCopyLattice N d j) :
92    ((recursivePhysicalDecomposition N (d+1)).get i).character p =
93      ((recursivePhysicalDecomposition N (d+1)).get j).character p := by
94  have hw : ((recursivePhysicalDecomposition N (d+1)).get i).weight =
95      ((recursivePhysicalDecomposition N (d+1)).get j).weight := by
96    funext a
97    have he := congrArg (fun x : Lattice d (N : ℤ) => x.1 a) h
98    change (((recursivePhysicalDecomposition N (d+1)).get i).weight a : ℤ) =
99      (((recursivePhysicalDecomposition N (d+1)).get j).weight a : ℤ) at he
100    exact_mod_cast he
101  simp only [PhysicalHighestTensor.character_eq_physicalSectorCharacter, hw]
102 
103end Cloning.TensorLAN