File size: 3,368 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | 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
|