Offline · exact source
Exact Lean source

InfiniteFidelityMixtureNormalization

formalization/Cloning/InfiniteFidelityMixtureNormalization.lean

Source hash: c014495d63a25bd3a20cff882d5ae113238cdb7bb864b48c597178d368b54efe

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.InfiniteFidelityBlockFactorization
2 
3/-! Actual normalization of positive finite mixtures, with a unit fallback
4only when their total mass is zero. -/
5noncomputable section
6open scoped BigOperators ComplexOrder Classical
7namespace Cloning.Hybrid.PositiveTraceClass
8open Cloning.InfiniteTraceClass Cloning.InfiniteFidelityHilbertSum
9set_option backward.isDefEq.respectTransparency false
10variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H]
11variable {I : Type*} [Fintype I]
12 
13theorem norm_finiteMixture (q : I → ℝ) (hq : ∀ i, 0 ≤ q i)
14    (A : I → PositiveTraceClass H) :
15    ‖(finiteMixture q hq A).1‖ = ∑ i, q i * ‖(A i).1‖ := by
16  rw [positive_norm_eq_trace]
17  simp only [finiteMixture_val, map_sum, map_smul, Complex.re_sum, smul_eq_mul,
18    Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero]
19  apply Finset.sum_congr rfl
20  intro i hi
21  rw [positive_norm_eq_trace]
22 
23def normalized (A fallback : PositiveTraceClass H) : PositiveTraceClass H :=
24  if h : 0 < ‖A.1‖ then scale ⟨‖A.1‖⁻¹, inv_nonneg.mpr (norm_nonneg _)⟩ A else fallback
25 
26theorem norm_normalized (A fallback : PositiveTraceClass H) (hf : ‖fallback.1‖ = 1) :
27    ‖(normalized A fallback).1‖ = 1 := by
28  by_cases h : 0 < ‖A.1‖
29  · rw [normalized, dif_pos h, norm_scale]
30    exact inv_mul_cancel₀ (ne_of_gt h)
31  · simpa only [normalized, dif_neg h] using hf
32 
33theorem scale_normalized (A fallback : PositiveTraceClass H) :
34    scale ⟨‖A.1‖, norm_nonneg _⟩ (normalized A fallback) = A := by
35  apply Subtype.ext
36  by_cases h : 0 < ‖A.1‖
37  · simp only [normalized, dif_pos h, scale, smul_smul]
38    change ((‖A.1‖ : ℂ) * (‖A.1‖⁻¹ : ℝ)) • A.1 = A.1
39    rw [← Complex.ofReal_mul, mul_inv_cancel₀ (ne_of_gt h), Complex.ofReal_one, one_smul]
40  · have hz : ‖A.1‖ = 0 := le_antisymm (le_of_not_gt h) (norm_nonneg _)
41    have hA : A.1 = 0 := norm_eq_zero.mp hz
42    change (‖A.1‖ : ℂ) • (normalized A fallback).1 = A.1
43    rw [hz, Complex.ofReal_zero, zero_smul, hA]
44 
45theorem normalized_finiteMixture_of_pos
46    (q : I → ℝ) (hq : ∀ i, 0 ≤ q i) (A : I → PositiveTraceClass H)
47    (hA : ∀ i, ‖(A i).1‖ = 1) (fallback : PositiveTraceClass H)
48    (hs : 0 < ∑ i, q i) :
49    normalized (finiteMixture q hq A) fallback =
50      finiteMixture (fun i ↦ q i / ∑ a, q a)
51        (fun i ↦ div_nonneg (hq i) hs.le) A := by
52  have hn : ‖(finiteMixture q hq A).1‖ = ∑ i, q i := by
53    simp only [norm_finiteMixture, hA, mul_one]
54  rw [normalized, dif_pos (hn ▸ hs)]
55  apply Subtype.ext
56  change ((‖(finiteMixture q hq A).1‖⁻¹ : ℝ) : ℂ) • (finiteMixture q hq A).1 = _
57  rw [hn]
58  simp only [finiteMixture_val, Finset.smul_sum, smul_smul]
59  apply Finset.sum_congr rfl
60  intro i hi
61  congr 1
62  simp only [Complex.ofReal_div, Complex.ofReal_inv, Complex.ofReal_mul, div_eq_mul_inv, mul_comm]
63 
64theorem normalized_mixture_weights_sum
65    (q : I → ℝ) (hs : 0 < ∑ i, q i) : ∑ i, q i / ∑ a, q a = 1 := by
66  rw [← Finset.sum_div, div_self (ne_of_gt hs)]
67 
68end Cloning.Hybrid.PositiveTraceClass