Offline · exact source
Exact Lean source

TensorCloningAchievabilityCompatibility

formalization/Cloning/TensorCloningAchievabilityCompatibility.lean

Source hash: 9f088366a0b67f83fd9d27fb846004fabf22e5e0d6e9a4d4de4533dd77a8face

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.TensorCloningAchievabilityProbability
2import Cloning.YoungCompatibility
3 
4/-! Typical independent source and target labels force actual Cartan
5compatibility and the required diverging gaps and gain fractions. -/
6noncomputable section
7open scoped BigOperators Classical Topology
8open Filter
9namespace Cloning.TensorCloning
10open Cloning.TensorLie Cloning.TensorLAN Cloning.YoungGeneral
11set_option backward.isDefEq.respectTransparency false
12set_option maxHeartbeats 1400000
13variable {d : ℕ}
14 
15/-- Strict positive limiting coordinate differences force an actual natural
16partition difference; compatibility is a conclusion. -/
17theorem eventually_partitionCompatible_of_scaled_limits
18    (n : ℕ → ℕ) (hn : Tendsto n atTop atTop) (μ ν : ℕ → Fin d → ℕ)
19    (p : Fin d → ℝ) (hp : ∀ a, 0 < p a) (hord : StrictAnti p)
20    (γ : ℝ) (hγ : 1 < γ)
21    (hμ : ∀ a, Tendsto (fun k => (μ k a : ℝ)/(n k : ℝ)) atTop (𝓝 (p a)))
22    (hν : ∀ a, Tendsto (fun k => (ν k a : ℝ)/(n k : ℝ)) atTop (𝓝 (γ*p a))) :
23    ∀ᶠ k in atTop, PartitionCompatible (μ k) (ν k) := by
24  have hd (a : Fin d) : Tendsto
25      (fun k => (ν k a : ℝ)/(n k : ℝ)-(μ k a : ℝ)/(n k : ℝ)) atTop (𝓝 ((γ-1)*p a)) := by
26    convert (hν a).sub (hμ a) using 1 <;> ring
27  have hpos : ∀ᶠ k in atTop, ∀ a,
28      0 < (ν k a : ℝ)/(n k : ℝ)-(μ k a : ℝ)/(n k : ℝ) :=
29    eventually_all.mpr (fun a => (hd a).eventually (eventually_gt_nhds (mul_pos (sub_pos.mpr hγ) (hp a))))
30  have hgap : ∀ᶠ k in atTop, ∀ r : PositiveRoot d,
31      0 < ((ν k r.val.1 : ℝ)/(n k : ℝ)-(μ k r.val.1 : ℝ)/(n k : ℝ)) -
32        ((ν k r.val.2 : ℝ)/(n k : ℝ)-(μ k r.val.2 : ℝ)/(n k : ℝ)) := by
33    apply eventually_all.mpr
34    intro r
35    apply ((hd r.val.1).sub (hd r.val.2)).eventually
36    apply eventually_gt_nhds
37    nlinarith [hord r.property]
38  filter_upwards [hpos, hgap, hn.eventually (eventually_gt_atTop 0)] with k hk hg hnk
39  have hnreal : (0 : ℝ) < n k := by exact_mod_cast hnk
40  have hle (a : Fin d) : μ k a ≤ ν k a := by
41    have hh := hk a
42    rw [← sub_div, div_pos_iff_of_pos_right hnreal] at hh
43    exact_mod_cast (sub_pos.mp hh).le
44  refine ⟨hle, ?_⟩
45  intro a b hab
46  rcases hab.eq_or_lt with rfl | hab
47  · exact le_rfl
48  have hh := hg ⟨(a,b),hab⟩
49  simp only at hh
50  rw [← sub_div, ← sub_div, ← sub_div, div_pos_iff_of_pos_right hnreal] at hh
51  have hreal : ((ν k b-μ k b : ℕ) : ℝ) ≤ ((ν k a-μ k a : ℕ) : ℝ) := by
52    rw [Nat.cast_sub (hle a), Nat.cast_sub (hle b)]
53    linarith
54  exact_mod_cast hreal
55 
56theorem difference_scaled_tendsto
57    (n : ℕ → ℕ) (μ ν : ℕ → Fin d → ℕ) (p : Fin d → ℝ) (γ : ℝ)
58    (hμ : ∀ a, Tendsto (fun k => (μ k a : ℝ)/(n k : ℝ)) atTop (𝓝 (p a)))
59    (hν : ∀ a, Tendsto (fun k => (ν k a : ℝ)/(n k : ℝ)) atTop (𝓝 (γ*p a)))
60    (hc : ∀ᶠ k in atTop, PartitionCompatible (μ k) (ν k)) (a : Fin d) :
61    Tendsto (fun k => ((ν k a-μ k a : ℕ) : ℝ)/(n k : ℝ)) atTop (𝓝 ((γ-1)*p a)) := by
62  have hh := (hν a).sub (hμ a)
63  have he : γ*p a-p a = (γ-1)*p a := by ring
64  rw [he] at hh
65  apply hh.congr'
66  filter_upwards [hc] with k hk
67  rw [Nat.cast_sub (hk.1 a), sub_div]
68 
69/-- Common diverging physical root-gap bounds follow from actual row
70frequencies. The limiting vector need not have total mass one. -/
71theorem exists_root_gap_of_scaled_limits
72    (n : ℕ → ℕ) (hn : Tendsto n atTop atTop) (μ : ℕ → Fin d → ℕ)
73    (p : Fin d → ℝ) (hp : ∀ a, 0 < p a) (hord : StrictAnti p)
74    (hμ : ∀ a, Tendsto (fun k => (μ k a : ℝ)/(n k : ℝ)) atTop (𝓝 (p a))) :
75    ∃ δ : ℕ → ℝ, Tendsto δ atTop atTop ∧
76      ∀ᶠ k in atTop, ∀ r : PositiveRoot d, δ k ≤ rootGap (μ k) r := by
77  obtain ⟨a,ha,_,hag⟩ := YoungCompatibility.compact_spectra_positive_gap
78    ({p} : Set (Fin d → ℝ)) isCompact_singleton
79    (by intro q hq; simpa only [Set.mem_singleton_iff.mp hq] using hp)
80    (by intro q hq; simpa only [Set.mem_singleton_iff.mp hq] using hord)
81  refine ⟨fun k => (a/2)*(n k : ℝ),
82    (tendsto_natCast_atTop_atTop.comp hn).const_mul_atTop (by positivity), ?_⟩
83  have hscaled : ∀ᶠ k in atTop, ∀ r : PositiveRoot d,
84      a/2 ≤ (μ k r.val.1 : ℝ)/(n k : ℝ)-(μ k r.val.2 : ℝ)/(n k : ℝ) := by
85    apply eventually_all.mpr
86    intro r
87    have hb := hag p (by simp) r.val.1 r.val.2 r.property
88    exact (((hμ r.val.1).sub (hμ r.val.2)).eventually
89      (eventually_gt_nhds (by linarith))).mono (fun _ h => h.le)
90  filter_upwards [hscaled, hn.eventually (eventually_gt_atTop 0)] with k hk hnk r
91  have hnreal : (0 : ℝ) < n k := by exact_mod_cast hnk
92  have hh := hk r
93  rw [← sub_div, le_div_iff₀ hnreal] at hh
94  exact hh
95 
96/-- Independent typical source and target labels have the appropriate
97frequencies relative to the common input scale. -/
98theorem typical_pair_scaled_limits
99    (n m : ℕ → ℕ) (hn : Tendsto n atTop atTop) (hm : Tendsto m atTop atTop)
100    (μ ν : ℕ → Fin d → ℕ) (p : Fin d → ℝ) (γ : ℝ)
101    (hγ : Tendsto (fun k => (m k : ℝ)/(n k : ℝ)) atTop (𝓝 γ))
102    (hμ : ∀ᶠ k in atTop, TypicalLabel (n k) p (μ k))
103    (hν : ∀ᶠ k in atTop, TypicalLabel (m k) p (ν k)) :
104    (∀ a, Tendsto (fun k => (μ k a : ℝ)/(n k : ℝ)) atTop (𝓝 (p a))) ∧
105    (∀ a, Tendsto (fun k => (ν k a : ℝ)/(n k : ℝ)) atTop (𝓝 (γ*p a))) := by
106  refine ⟨fun a => typicalLabel_ratio_tendsto n hn μ (fun _ => p) p (fun _ => tendsto_const_nhds) hμ a, ?_⟩
107  intro a
108  have hh := hγ.mul (typicalLabel_ratio_tendsto m hm ν (fun _ => p) p (fun _ => tendsto_const_nhds) hν a)
109  apply hh.congr'
110  filter_upwards [hm.eventually (eventually_gt_atTop 0)] with k hmk
111  have hmreal : (m k : ℝ) ≠ 0 := by exact_mod_cast hmk.ne'
112  field_simp
113 
114/-- The root-wise Cartan fraction tends to the inverse physical cloning gain. -/
115theorem rootFraction_difference_tendsto
116    (n : ℕ → ℕ) (hn : Tendsto n atTop atTop) (μ ν : ℕ → Fin d → ℕ)
117    (p : Fin d → ℝ) (hord : StrictAnti p) (γ : ℝ) (hγ : 0 < γ)
118    (hμ : ∀ a, Tendsto (fun k => (μ k a : ℝ)/(n k : ℝ)) atTop (𝓝 (p a)))
119    (hν : ∀ a, Tendsto (fun k => (ν k a : ℝ)/(n k : ℝ)) atTop (𝓝 (γ*p a)))
120    (hc : ∀ᶠ k in atTop, PartitionCompatible (μ k) (ν k)) (r : PositiveRoot d) :
121    Tendsto (fun k => rootFraction (μ k) (fun a => ν k a-μ k a) r) atTop (𝓝 γ⁻¹) := by
122  have hg : 0 < p r.val.1-p r.val.2 := sub_pos.mpr (hord r.property)
123  have hq := ((hμ r.val.1).sub (hμ r.val.2)).div
124    ((hν r.val.1).sub (hν r.val.2)) (by nlinarith : γ*p r.val.1-γ*p r.val.2 ≠ 0)
125  have he : (p r.val.1-p r.val.2)/(γ*p r.val.1-γ*p r.val.2) = γ⁻¹ := by
126    rw [← mul_sub]
127    field_simp
128  rw [he] at hq
129  apply hq.congr'
130  filter_upwards [hc, hn.eventually (eventually_gt_atTop 0)] with k hk hnk
131  have hnreal : (n k : ℝ) ≠ 0 := by exact_mod_cast hnk.ne'
132  have hgap : rootGap (μ k) r + rootGap (fun a => ν k a-μ k a) r = rootGap (ν k) r := by
133    simp only [rootGap, Nat.cast_sub (hk.1 _)]
134    ring
135  rw [rootFraction, hgap]
136  simp only [Pi.div_apply, ← sub_div, rootGap]
137  field_simp
138 
139/-- All representation-theoretic hypotheses needed by the actual Cartan
140state limit are derived from the two physical shrinking windows. -/
141theorem typical_pair_cartan_parameters
142    (n m : ℕ → ℕ) (hn : Tendsto n atTop atTop) (hm : Tendsto m atTop atTop)
143    (μ ν : ℕ → Fin d → ℕ) (p : Fin d → ℝ) (hp : ∀ a, 0 < p a) (hord : StrictAnti p)
144    (γ : ℝ) (hγ : 1 < γ)
145    (hgain : Tendsto (fun k => (m k : ℝ)/(n k : ℝ)) atTop (𝓝 γ))
146    (hμ : ∀ᶠ k in atTop, TypicalLabel (n k) p (μ k))
147    (hν : ∀ᶠ k in atTop, TypicalLabel (m k) p (ν k)) :
148    ∃ δμ δτ : ℕ → ℝ, Tendsto δμ atTop atTop ∧ Tendsto δτ atTop atTop ∧
149      (∀ᶠ k in atTop, PartitionCompatible (μ k) (ν k)) ∧
150      (∀ᶠ k in atTop, ∀ r : PositiveRoot d, δμ k ≤ rootGap (μ k) r) ∧
151      (∀ᶠ k in atTop, ∀ r : PositiveRoot d, δτ k ≤ rootGap (fun a => ν k a-μ k a) r) ∧
152      (∀ r : PositiveRoot d, Tendsto (fun k => rootFraction (μ k) (fun a => ν k a-μ k a) r)
153        atTop (𝓝 γ⁻¹)) := by
154  obtain ⟨hμlim,hνlim⟩ := typical_pair_scaled_limits n m hn hm μ ν p γ hgain hμ hν
155  have hc := eventually_partitionCompatible_of_scaled_limits n hn μ ν p hp hord γ hγ hμlim hνlim
156  have hτlim := difference_scaled_tendsto n μ ν p γ hμlim hνlim hc
157  obtain ⟨δμ,hδμ,hgμ⟩ := exists_root_gap_of_scaled_limits n hn μ p hp hord hμlim
158  obtain ⟨δτ,hδτ,hgτ⟩ := exists_root_gap_of_scaled_limits n hn (fun k a => ν k a-μ k a)
159    (fun a => (γ-1)*p a) (fun a => mul_pos (sub_pos.mpr hγ) (hp a))
160    (fun a b hab => mul_lt_mul_of_pos_left (hord hab) (sub_pos.mpr hγ)) hτlim
161  exact ⟨δμ,δτ,hδμ,hδτ,hc,hgμ,hgτ,
162    rootFraction_difference_tendsto n hn μ ν p hord γ (by linarith) hμlim hνlim hc⟩
163 
164end Cloning.TensorCloning