math / data /lean /OAI /Probability /BinarySweep /Conditional /ConditionalAverage.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
3.75 kB
import Mathlib
import OAI.Probability.BinarySweep.Representations.IsotypicMoment
import OAI.Probability.BinarySweep.Conditional.Placement
namespace OAI
noncomputable section
open scoped BigOperators Classical
namespace BinaryCoordinateSweeps
open Irrep Representation
variable {b h : β„•} {bits : Fin b β†’ β„•} (H : PathFamily bits h) (z : ℝ)
def conditionalGroupLaw (a : Equiv.Perm (FreeSlot H 0)) : ℝ :=
βˆ‘ g : ConditionalChoices H, if remainingPerm H g.val g.property=a then
conditionalChoiceWeight H z g else 0
lemma conditionalGroupLaw_nonneg {z : ℝ} (hz : 0 ≀ z) (hz1 : z<1)
(a : Equiv.Perm (FreeSlot H 0)) : 0 ≀ conditionalGroupLaw H z a := by
apply Finset.sum_nonneg
intro g _
split_ifs
Β· exact conditionalChoiceWeight_nonneg H hz hz1 g
Β· rfl
lemma conditionalGroupLaw_sum {z : ℝ} (hz : 0 ≀ z) (hz1 : z<1) :
βˆ‘ a, conditionalGroupLaw H z a = 1 := by
simp only [conditionalGroupLaw]
rw [Finset.sum_comm]
simpa using conditionalChoiceWeight_sum H hz hz1
variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace β„‚ V] [FiniteDimensional β„‚ V]
omit [FiniteDimensional β„‚ V] in
lemma groupAverage_conditional (ρ : Representation β„‚ (Equiv.Perm (FreeSlot H 0)) V) :
groupAverage ρ (fun a => (conditionalGroupLaw H z a : β„‚)) =
βˆ‘ g : ConditionalChoices H, (conditionalChoiceWeight H z g : β„‚) β€’
ρ (remainingPerm H g.val g.property) := by
simp only [groupAverage,conditionalGroupLaw,Complex.ofReal_sum,Finset.sum_smul]
rw [Finset.sum_comm]
apply Finset.sum_congr rfl
intro g _
simp only [apply_ite,Complex.ofReal_zero,ite_smul,zero_smul]
simp
omit [FiniteDimensional β„‚ V] in
lemma groupAverage_conditional_grid (ρ : Representation β„‚ (Equiv.Perm (FreeSlot H 0)) V) :
groupAverage ρ (fun a => (conditionalGroupLaw H z a : β„‚)) =
(conditionalNormalizer H z : β„‚)⁻¹ β€’ βˆ‘ g : GridChoices bits,
if hg : pathEvent H g then (gridWeight bits z g : β„‚) β€’
ρ (remainingPerm H g hg) else 0 := by
rw [groupAverage_conditional]
have hs : βˆ€ g : ConditionalChoices H,
(conditionalChoiceWeight H z g : β„‚) β€’ ρ (remainingPerm H g.val g.property) =
(conditionalNormalizer H z : β„‚)⁻¹ β€’
((gridWeight bits z g.val : β„‚) β€’ ρ (remainingPerm H g.val g.property)) := by
intro g
rw [conditionalChoiceWeight, Complex.ofReal_div, div_eq_mul_inv, mul_comm, mul_smul]
simp_rw [hs]
rw [← Finset.smul_sum]
congr 1
let F : GridChoices bits β†’ (V β†’β‚—[β„‚] V) := fun g =>
if hg : pathEvent H g then (gridWeight bits z g : β„‚) β€’ ρ (remainingPerm H g hg) else 0
have hF : βˆ‘ g : ConditionalChoices H, F g.val = βˆ‘ g, F g := by
rw [← Finset.sum_filter_of_ne (p := pathEvent H) (f := F) (by
intro g _ hg
by_contra hn
simp [F,hn] at hg)]
exact (Finset.sum_subtype _ (by simp) _).symm
simpa only [F,dite_eq_left (Subtype.property _)] using hF
lemma conditionalOperator_groupAverage {D : β„•}
(ρ : Representation β„‚ (Equiv.Perm (FreeSlot H 0)) (RepSpace D)) :
(conditionalOperator H z ρ).toLinearMap =
groupAverage ρ (fun a => (conditionalGroupLaw H z a : β„‚)) := by
rw [groupAverage_conditional_grid]
rfl
lemma conditionalMoment_evenMoment {D : β„•}
(ρ : Representation β„‚ (Equiv.Perm (FreeSlot H 0)) (RepSpace D)) (q : β„•) :
traceMoment q (conditionalOperator H z ρ) =
evenMoment q (groupAverage ρ (fun a => (conditionalGroupLaw H z a : β„‚))) := by
rw [← conditionalOperator_groupAverage]
simp only [traceMoment,evenMoment,ContinuousLinearMap.toLinearMap_pow,
ContinuousLinearMap.toLinearMap_mul,ContinuousLinearMap.adjoint_toLinearMap]
end BinaryCoordinateSweeps
end
end OAI