introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
3.37 kB
import Mathlib
namespace OAI
noncomputable section
open scoped BigOperators
namespace BinaryCoordinateSweeps
/-- The positions of a binary deck of dimension d. -/
abbrev Slot (d : β„•) := Fin d β†’ Bool
/-- Independent switches on the edges parallel to one coordinate. -/
def coordinateLayer (d : β„•) (j : Fin d)
(c : (({i : Fin d // i β‰  j} β†’ Bool)) β†’ Bool) : Equiv.Perm (Slot d) :=
let e := Equiv.piSplitAt j (fun _ : Fin d => Bool)
let sw : Equiv.Perm (Bool Γ— ({i : Fin d // i β‰  j} β†’ Bool)) :=
{ toFun := fun x => (x.1 ^^ c x.2, x.2)
invFun := fun x => (x.1 ^^ c x.2, x.2)
left_inv := fun x => by simp
right_inv := fun x => by simp }
e.trans (sw.trans e.symm)
abbrev SweepCoins (d : β„•) :=
(j : Fin d) β†’ ({i : Fin d // i β‰  j} β†’ Bool) β†’ Bool
/-- The coordinate layers are applied in increasing coordinate order. -/
def binarySweep (d : β„•) (c : SweepCoins d) : Equiv.Perm (Slot d) :=
(List.ofFn (fun j => coordinateLayer d j (c j))).reverse.prod
def finiteLaw {Ξ© G : Type*} [Fintype Ξ©] [Fintype G] (f : Ξ© β†’ G) (g : G) : ℝ := by
classical
exact βˆ‘ Ο‰, if f Ο‰ = g then (Fintype.card Ξ© : ℝ)⁻¹ else 0
/-- Half the unnormalized sum of absolute probability-mass differences. -/
def totalVariation {G : Type*} [Fintype G] (p q : G β†’ ℝ) : ℝ :=
(1 / ((2 : β„•) : ℝ)) * βˆ‘ g, |p g - q g|
def uniformLaw (G : Type*) [Fintype G] : G β†’ ℝ :=
fun _ => (Fintype.card G : ℝ)⁻¹
def binaryLaw (d : β„•) : Equiv.Perm (Slot d) β†’ ℝ :=
finiteLaw (binarySweep d)
abbrev RepSpace (D : β„•) := EuclideanSpace β„‚ (Fin D)
def IsUnitaryRep {G : Type*} [Monoid G]
{D : β„•} (ρ : Representation β„‚ G (RepSpace D)) : Prop :=
βˆ€ g x, ‖ρ g xβ€– = β€–xβ€–
def averageOperator {G : Type*} [Fintype G] [Monoid G] {D : β„•}
(p : G β†’ ℝ) (ρ : Representation β„‚ G (RepSpace D)) :
RepSpace D β†’L[β„‚] RepSpace D :=
LinearMap.toContinuousLinearMap (βˆ‘ g, (p g : β„‚) β€’ ρ g)
def BinaryContractionTarget : Prop :=
βˆƒ g : ℝ, 0 < g ∧ βˆƒ dβ‚€ : β„•, βˆ€ d β‰₯ dβ‚€, βˆ€ D : β„•,
βˆ€ ρ : Representation β„‚ (Equiv.Perm (Slot d)) (RepSpace D),
ρ.IsIrreducible β†’ IsUnitaryRep ρ β†’
β€–averageOperator (binaryLaw d) ρ‖ ≀ (D : ℝ) ^ (-g)
def realSign {Ξ± : Type*} [Fintype Ξ±] [DecidableEq Ξ±] : Equiv.Perm Ξ± β†’* ℝ :=
(Int.castRingHom ℝ).toMonoidHom.comp ((Units.coeHom β„€).comp Equiv.Perm.sign)
section FiniteLaws
variable {G : Type*} [Fintype G] [Group G]
def convolution (p q : G β†’ ℝ) (g : G) : ℝ := βˆ‘ x, p x * q (x⁻¹ * g)
def pointMassOne (g : G) : ℝ := by
classical
exact if g = 1 then 1 else 0
/-- The law of independent repetitions, with the empty product at the identity. -/
def convolutionPower (p : G β†’ ℝ) : β„• β†’ G β†’ ℝ
| 0 => pointMassOne
| n + 1 => convolution p (convolutionPower p n)
end FiniteLaws
def sweepLaw (d t : β„•) : Equiv.Perm (Slot d) β†’ ℝ :=
convolutionPower (binaryLaw d) t
/-- A single number of sweeps works uniformly over deterministic initial decks. -/
def UniformSweepMixingTarget : Prop :=
βˆƒ w : β„•, βˆ€ Ξ΅ : ℝ, 0 < Ξ΅ β†’ βˆƒ dβ‚€ : β„•, βˆ€ d β‰₯ dβ‚€,
βˆ€ Ο„ : Equiv.Perm (Slot d),
totalVariation (fun g => sweepLaw d w (g * τ⁻¹))
(uniformLaw (Equiv.Perm (Slot d))) ≀ Ξ΅
end BinaryCoordinateSweeps
end
end OAI