File size: 2,602 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 | import Mathlib
namespace OAI
noncomputable section
open scoped BigOperators ComplexOrder
namespace ThresholdParallelRepetition
structure Game (x y a b : β) where
questionProb : Fin (x + 1) Γ Fin (y + 1) β β
questionProb_nonneg : β z, 0 β€ questionProb z
questionProb_sum : β z, questionProb z = 1
accepts : Fin (x + 1) β Fin (y + 1) β Fin (a + 1) β Fin (b + 1) β Bool
structure Strategy (X Y A B : Type) [Fintype A] [Fintype B] where
dimA : β
dimB : β
state : Fin (dimA + 1) Γ Fin (dimB + 1) β β
state_unit : β i, Complex.normSq (state i) = 1
alice : X β A β Matrix (Fin (dimA + 1)) (Fin (dimA + 1)) β
bob : Y β B β Matrix (Fin (dimB + 1)) (Fin (dimB + 1)) β
alice_pos : β x a, (alice x a).PosSemidef
bob_pos : β y b, (bob y b).PosSemidef
alice_total : β x, β a, alice x a = 1
bob_total : β y, β b, bob y b = 1
def Strategy.born {X Y A B : Type} [Fintype A] [Fintype B]
(S : Strategy X Y A B) (x : X) (y : Y) (a : A) (b : B) : β :=
β i, β j, (star (S.state i) *
(S.alice x a i.1 j.1 * S.bob y b i.2 j.2) * S.state j).re
abbrev SingleStrategy (x y a b : β) :=
Strategy (Fin (x + 1)) (Fin (y + 1)) (Fin (a + 1)) (Fin (b + 1))
def successProbability {x y a b : β} (G : Game x y a b) (S : SingleStrategy x y a b) : β :=
β z : Fin (x + 1) Γ Fin (y + 1), G.questionProb z *
β w : Fin (a + 1) Γ Fin (b + 1),
if G.accepts z.1 z.2 w.1 w.2 then S.born z.1 z.2 w.1 w.2 else 0
def entangledValue {x y a b : β} (G : Game x y a b) : β :=
sSup (Set.range (successProbability G))
abbrev RepeatedStrategy (x y a b k : β) :=
Strategy (Fin k β Fin (x + 1)) (Fin k β Fin (y + 1))
(Fin k β Fin (a + 1)) (Fin k β Fin (b + 1))
def wins {x y a b k : β} (G : Game x y a b)
(xs : Fin k β Fin (x + 1)) (ys : Fin k β Fin (y + 1))
(as : Fin k β Fin (a + 1)) (bs : Fin k β Fin (b + 1)) : β :=
β i, if G.accepts (xs i) (ys i) (as i) (bs i) then 1 else 0
def thresholdProbability {x y a b k : β} (G : Game x y a b) (Ξ΄ : β)
(S : RepeatedStrategy x y a b k) : β :=
β xs : Fin k β Fin (x + 1), β ys : Fin k β Fin (y + 1),
(β i, G.questionProb (xs i, ys i)) *
β as : Fin k β Fin (a + 1), β bs : Fin k β Fin (b + 1),
if β(entangledValue G + Ξ΄) * (k : β)ββ β€ wins G xs ys as bs
then S.born xs ys as bs else 0
def thresholdValue {x y a b k : β} (G : Game x y a b) (Ξ΄ : β) : β :=
sSup (Set.range (thresholdProbability (k := k) G Ξ΄))
end ThresholdParallelRepetition
end
end OAI
|