cfahlgren1's picture
download
raw
8.09 kB
import Mathlib
namespace OAI
namespace ParityWL
open scoped BigOperators
abbrev Bit := ZMod 2
abbrev MainPair (t : ℕ) := {p : Fin t × Fin t // p.1 < p.2}
abbrev Helper (t : ℕ) :=
{q : MainPair t × Fin t // q.2 ≠ q.1.1.1 ∧ q.2 ≠ q.1.1.2}
abbrev TemplateVertex (t : ℕ) := Fin t ⊕ Helper t
structure ChoiceSystem (t : ℕ) where
Domain : Fin t → Type
domainFintype : ∀ i, Fintype (Domain i)
Label : MainPair t → Type
labelFintype : ∀ p, Fintype (Label p)
leftLabel : (p : MainPair t) → Domain p.1.1 → Label p
rightLabel : (p : MainPair t) → Domain p.1.2 → Label p
attribute [instance] ChoiceSystem.domainFintype ChoiceSystem.labelFintype
def ChoiceSystem.Successful {t : ℕ} (C : ChoiceSystem t) : Prop :=
∃ d : (i : Fin t) → C.Domain i,
∀ p : MainPair t, C.leftLabel p (d p.1.1) = C.rightLabel p (d p.1.2)
def ChoiceSystem.SizeAtMost {t : ℕ} (C : ChoiceSystem t) (A : ℕ) : Prop :=
(∀ i, Fintype.card (C.Domain i) ≤ A) ∧ (∀ p, Fintype.card (C.Label p) ≤ A)
def helperIncident {t : ℕ} (h : Helper t) (i : Fin t) : Prop :=
i = h.1.1.1.1 ∨ i = h.1.1.1.2 ∨ i = h.1.2
def templateAdj {t : ℕ} : TemplateVertex t → TemplateVertex t → Prop
| .inl i, .inl j => i ≠ j
| .inl i, .inr h => helperIncident h i
| .inr h, .inl i => helperIncident h i
| .inr _, .inr _ => False
def template (t : ℕ) : SimpleGraph (TemplateVertex t) where
Adj := templateAdj
symm := ⟨by
intro x y h
cases x <;> cases y <;> simp_all [templateAdj, ne_comm]⟩
loopless := ⟨by
intro x
cases x <;> simp [templateAdj]⟩
abbrev BaseVertex {t : ℕ} (C : ChoiceSystem t) :=
((i : Fin t) × C.Domain i) ⊕ ((h : Helper t) × C.Label h.1.1)
def baseType {t : ℕ} {C : ChoiceSystem t} : BaseVertex C → TemplateVertex t
| .inl x => .inl x.1
| .inr x => .inr x.1
inductive BaseArc {t : ℕ} (C : ChoiceSystem t) : BaseVertex C → BaseVertex C → Prop
| main (p : MainPair t) (d : C.Domain p.1.1) (e : C.Domain p.1.2)
(h : C.leftLabel p d = C.rightLabel p e) :
BaseArc C (.inl ⟨p.1.1, d⟩) (.inl ⟨p.1.2, e⟩)
| left (h : Helper t) (d : C.Domain h.1.1.1.1) :
BaseArc C (.inr ⟨h, C.leftLabel h.1.1 d⟩) (.inl ⟨h.1.1.1.1, d⟩)
| right (h : Helper t) (e : C.Domain h.1.1.1.2) :
BaseArc C (.inr ⟨h, C.rightLabel h.1.1 e⟩) (.inl ⟨h.1.1.1.2, e⟩)
| third (h : Helper t) (q : C.Label h.1.1) (f : C.Domain h.1.2) :
BaseArc C (.inr ⟨h, q⟩) (.inl ⟨h.1.2, f⟩)
def baseGraph {t : ℕ} (C : ChoiceSystem t) : SimpleGraph (BaseVertex C) :=
SimpleGraph.fromRel (BaseArc C)
def baseProjection {t : ℕ} (C : ChoiceSystem t) : baseGraph C →g template t where
toFun := baseType
map_rel' := by
intro x y h
have arc : ∀ u v, BaseArc C u v → (template t).Adj (baseType u) (baseType v) := by
intro u v huv
cases huv with
| main p d e he => exact ne_of_lt p.property
| left h d => exact Or.inl rfl
| right h e => exact Or.inr (Or.inl rfl)
| third h q f => exact Or.inr (Or.inr rfl)
rcases h.2 with hxy | hyx
· exact arc x y hxy
· exact (arc y x hyx).symm
section Lifts
variable {A V : Type} [Fintype A] (T : SimpleGraph A) (G : SimpleGraph V)
noncomputable def Tag (b : A → Bit) (a : A) := by
classical
exact {z : T.neighborSet a → Bit // ∑ v, z v = b a}
noncomputable instance tagFintype (b : A → Bit) (a : A) : Fintype (Tag T b a) := by
classical
unfold Tag
infer_instance
abbrev LiftVertex (τ : G →g T) (b : A → Bit) := (u : V) × Tag T b (τ u)
noncomputable def liftGraph (τ : G →g T) (b : A → Bit) :
SimpleGraph (LiftVertex T G τ b) where
Adj u v := ∃ h : G.Adj u.1 v.1,
u.2.1 ⟨τ v.1, τ.map_adj h⟩ = v.2.1 ⟨τ u.1, τ.map_adj h.symm⟩
symm := ⟨by
intro u v h
rcases h with ⟨h, e⟩
exact ⟨h.symm, e.symm⟩⟩
loopless := ⟨by
intro u h
exact G.irrefl h.1⟩
end Lifts
noncomputable def starParity (t : ℕ) : TemplateVertex t → Bit :=
fun a => if ∃ i : Fin t, i.val = 0 ∧ a = .inl i then 1 else 0
noncomputable def zeroLift {t : ℕ} (C : ChoiceSystem t) :=
liftGraph (template t) (baseGraph C) (baseProjection C) (fun _ => 0)
noncomputable def starLift {t : ℕ} (C : ChoiceSystem t) :=
liftGraph (template t) (baseGraph C) (baseProjection C) (starParity t)
inductive Convention | joint | separate
deriving DecidableEq
def bagParameter (c : Convention) (k : ℕ) : ℕ :=
match c with | .joint => k + 1 | .separate => k
def detectionRound : Convention → ℕ | .joint => 2 | .separate => 1
def orderFactor (t : ℕ) : ℕ :=
t * 2 ^ (t - 2 + 3 * (t - 1).choose 2) + 12 * t.choose 3
abbrev AtomicType (k : ℕ) := Fin k → Fin k → Bool × Bool
def JointColor (k : ℕ) : ℕ → Type
| 0 => AtomicType k
| r + 1 => JointColor k r × Multiset (Fin k → JointColor k r)
def SeparateColor (k : ℕ) : ℕ → Type
| 0 => AtomicType k
| r + 1 => SeparateColor k r × (Fin k → Multiset (SeparateColor k r))
noncomputable def atomicType {V : Type} (G : SimpleGraph V) {k : ℕ}
(x : Fin k → V) : AtomicType k := by
classical
exact fun i j => (decide (x i = x j), decide (G.Adj (x i) (x j)))
noncomputable def jointColor {V : Type} [Fintype V] (G : SimpleGraph V) (k : ℕ) :
(r : ℕ) → (Fin k → V) → JointColor k r
| 0, x => atomicType G x
| r + 1, x => (jointColor G k r x,
Finset.univ.val.map (fun y => fun i => jointColor G k r (Function.update x i y)))
noncomputable def separateColor {V : Type} [Fintype V] (G : SimpleGraph V) (k : ℕ) :
(r : ℕ) → (Fin k → V) → SeparateColor k r
| 0, x => atomicType G x
| r + 1, x => (separateColor G k r x,
fun i => Finset.univ.val.map (fun y => separateColor G k r (Function.update x i y)))
noncomputable def sameHistogram {V W : Type} [Fintype V] [Fintype W]
(G : SimpleGraph V) (H : SimpleGraph W) (c : Convention) (k r : ℕ) : Prop :=
match c with
| .joint => Finset.univ.val.map (jointColor G k r) =
Finset.univ.val.map (jointColor H k r)
| .separate => Finset.univ.val.map (separateColor G k r) =
Finset.univ.val.map (separateColor H k r)
noncomputable def samePureHistogram {V W : Type} [Fintype V] [Fintype W]
(G : SimpleGraph V) (H : SimpleGraph W) (c : Convention) (k r : ℕ) : Prop :=
match c with
| .joint =>
Finset.univ.val.map (fun x : Fin k → V => jointColor (G.sum H) k r (Sum.inl ∘ x)) =
Finset.univ.val.map (fun x : Fin k → W => jointColor (G.sum H) k r (Sum.inr ∘ x))
| .separate =>
Finset.univ.val.map (fun x : Fin k → V => separateColor (G.sum H) k r (Sum.inl ∘ x)) =
Finset.univ.val.map (fun x : Fin k → W => separateColor (G.sum H) k r (Sum.inr ∘ x))
noncomputable def WLEquivalent {V W : Type} [Fintype V] [Fintype W]
(G : SimpleGraph V) (H : SimpleGraph W) (c : Convention) (k : ℕ) : Prop :=
∀ r, sameHistogram G H c k r
noncomputable def PureWLEquivalent {V W : Type} [Fintype V] [Fintype W]
(G : SimpleGraph V) (H : SimpleGraph W) (c : Convention) (k : ℕ) : Prop :=
∀ r, samePureHistogram G H c k r
noncomputable def ParityReductionStatement : Prop :=
∀ (k : ℕ), 4 ≤ k → ∀ c : Convention, ∀ C : ChoiceSystem (bagParameter c k),
let T := template (bagParameter c k)
let G := baseGraph C
let τ := baseProjection C
let V₀ := LiftVertex T G τ (fun _ => 0)
let V₁ := LiftVertex T G τ (starParity (bagParameter c k))
Fintype.card V₀ = Fintype.card V₁ ∧
(∀ A : ℕ, 1 ≤ A → C.SizeAtMost A → Fintype.card V₀ ≤ A * orderFactor (bagParameter c k)) ∧
(WLEquivalent (zeroLift C) (starLift C) c k ↔ ¬ C.Successful) ∧
(PureWLEquivalent (zeroLift C) (starLift C) c k ↔ ¬ C.Successful) ∧
(C.Successful → ¬ sameHistogram (zeroLift C) (starLift C) c k (detectionRound c) ∧
¬ samePureHistogram (zeroLift C) (starLift C) c k (detectionRound c))
theorem parity_reduction : ParityReductionStatement := by
sorry
end ParityWL
end OAI

Xet Storage Details

Size:
8.09 kB
·
Xet hash:
8b331243689f56ad5b7be9d432e283b7a8b4b1504cc3cadb308143db3e5bd430

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.