Download data/lean/OAI/Probability/EntangledGames/Model.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.6 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/EntangledGames/Model.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/EntangledGames/Model.lean
-
curl -L -o Model.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/EntangledGames/Model.lean
2.6 kB
| 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 | |