Offline · exact source
Exact Lean source

InfiniteFidelityMixtureRestriction

formalization/Cloning/InfiniteFidelityMixtureRestriction.lean

Source hash: 6485d3a6a4d29e4949f344ace5ce1c9df70ed9e2bcc0c724324ba0f5e8c8c367

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.InfiniteFidelityMixtureNormalization
2 
3/-! Restricting a masked positive mixture to its actual retained component
4type commutes exactly with normalization. -/
5noncomputable section
6open scoped BigOperators ComplexOrder Classical
7namespace Cloning.Hybrid.PositiveTraceClass
8open Cloning.InfiniteTraceClass
9set_option backward.isDefEq.respectTransparency false
10set_option maxHeartbeats 1200000
11set_option synthInstance.maxHeartbeats 100000
12variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H]
13variable {I : Type*} [Fintype I]
14 
15def maskedWeight (q : I → ℝ) (P : I → Prop) (i : I) : ℝ := if P i then q i else 0
16 
17theorem maskedWeight_nonneg (q : I → ℝ) (hq : ∀ i, 0 ≤ q i) (P : I → Prop) :
18    ∀ i, 0 ≤ maskedWeight q P i := by
19  intro i
20  unfold maskedWeight
21  split_ifs
22  · exact hq i
23  · exact le_rfl
24 
25theorem maskedWeight_sum (q : I → ℝ) (P : I → Prop) :
26    (∑ i, maskedWeight q P i) = ∑ i : {i // P i}, q i.val := by
27  unfold maskedWeight
28  rw [← Finset.sum_filter]
29  exact Finset.sum_subtype _ (by simp) _
30 
31theorem finiteMixture_masked (q : I → ℝ) (hq : ∀ i, 0 ≤ q i) (P : I → Prop)
32    (A : I → PositiveTraceClass H) :
33    finiteMixture (maskedWeight q P) (maskedWeight_nonneg q hq P) A =
34      finiteMixture (fun i : {i // P i} ↦ q i.val) (fun i ↦ hq i.val) (fun i ↦ A i.val) := by
35  apply Subtype.ext
36  simp only [finiteMixture_val, maskedWeight, apply_ite Complex.ofReal, Complex.ofReal_zero,
37    ite_smul, zero_smul]
38  rw [← Finset.sum_filter]
39  exact Finset.sum_subtype _ (by simp) _
40 
41theorem normalized_masked_mixture_eq (q : I → ℝ) (hq : ∀ i, 0 ≤ q i) (P : I → Prop)
42    (A : I → PositiveTraceClass H) (hA : ∀ i, ‖(A i).1‖ = 1)
43    (fallback : PositiveTraceClass H) (hs : 0 < ∑ i : {i // P i}, q i.val) :
44    normalized (finiteMixture (maskedWeight q P) (maskedWeight_nonneg q hq P) A) fallback =
45      finiteMixture (fun i : {i // P i} ↦ q i.val / ∑ a : {i // P i}, q a.val)
46        (fun i ↦ div_nonneg (hq i.val) hs.le) (fun i ↦ A i.val) := by
47  calc
48    _ = normalized (finiteMixture (fun i : {i // P i} ↦ q i.val)
49        (fun i ↦ hq i.val) (fun i ↦ A i.val)) fallback :=
50      congrArg (fun X : PositiveTraceClass H ↦ normalized X fallback) (finiteMixture_masked q hq P A)
51    _ = _ := normalized_finiteMixture_of_pos (fun i : {i // P i} ↦ q i.val)
52      (fun i ↦ hq i.val) (fun i ↦ A i.val) (fun i ↦ hA i.val) fallback hs
53 
54end Cloning.Hybrid.PositiveTraceClass