File size: 5,021 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 95 96 97 98 99 100 | import OAI.Computability.BinPacking.Games.Reindexing
namespace OAI
namespace BinPackingGames.Foundations.Games.Game
noncomputable section
variable {Qβ Qβ Aβ Aβ Rβ Rβ Bβ Bβ Seed : Type*}
[Fintype Qβ] [Fintype Qβ] [Fintype Aβ] [Fintype Aβ]
[Fintype Rβ] [Fintype Rβ] [Fintype Bβ] [Fintype Bβ] [Fintype Seed]
[Nonempty Aβ] [Nonempty Aβ]
def localEmbeddingLaw (G : Game Qβ Qβ Aβ Aβ)
(seedLaw : FiniteDistribution Seed)
(left : Seed β Qβ β Rβ) (right : Seed β Qβ β Rβ) :
FiniteDistribution (Rβ Γ Rβ) :=
seedLaw.mixture fun seed =>
G.questions.pushforward fun q => (left seed q.1, right seed q.2)
theorem success_le_value_add_embedding_distance
(G : Game Qβ Qβ Aβ Aβ) (H : Game Rβ Rβ Bβ Bβ)
(seedLaw : FiniteDistribution Seed)
(left : Seed β Qβ β Rβ) (right : Seed β Qβ β Rβ)
(answerLeft : Seed β Qβ β Bβ β Aβ)
(answerRight : Seed β Qβ β Bβ β Aβ)
(acceptance : β seed x y a b,
H.accepts (left seed x) (right seed y) a b = true β
G.accepts x y (answerLeft seed x a) (answerRight seed y b) = true)
(strategy : Strategy Rβ Rβ Bβ Bβ) :
H.success strategy β€ G.value +
H.questions.totalVariation (G.localEmbeddingLaw seedLaw left right) := by
have localBound (seed : Seed) :
(G.questions.pushforward (fun q => (left seed q.1, right seed q.2))).probability
(H.wins strategy) β€ G.value := by
let embedded : Game Rβ Rβ Bβ Bβ :=
{ questions := G.questions.pushforward fun q => (left seed q.1, right seed q.2)
accepts := H.accepts }
change embedded.success strategy β€ G.value
exact (G.success_le_of_localSimulation embedded (left seed) (right seed)
(answerLeft seed) (answerRight seed) rfl (acceptance seed) strategy).trans
(G.success_le_value _)
have mixtureBound :
(G.localEmbeddingLaw seedLaw left right).probability (H.wins strategy) β€ G.value :=
seedLaw.probability_mixture_le _ _ _ localBound
exact (H.questions.probability_le_add_totalVariation
(G.localEmbeddingLaw seedLaw left right) (H.wins strategy)).trans
(add_le_add mixtureBound (le_refl _))
def coordinateGame (G : Game Qβ Qβ Aβ Aβ) {n : Nat} (coordinate : Fin n)
(law : FiniteDistribution ((Fin n β Qβ) Γ (Fin n β Qβ))) :
Game (Fin n β Qβ) (Fin n β Qβ) (Fin n β Aβ) (Fin n β Aβ) where
questions := law
accepts x y a b := G.accepts (x coordinate) (y coordinate) (a coordinate) (b coordinate)
theorem coordinate_probability_le_value_add_embedding_distance
(G : Game Qβ Qβ Aβ Aβ) {n : Nat} (coordinate : Fin n)
(law : FiniteDistribution ((Fin n β Qβ) Γ (Fin n β Qβ)))
(seedLaw : FiniteDistribution Seed)
(left : Seed β Qβ β Fin n β Qβ) (right : Seed β Qβ β Fin n β Qβ)
(left_preserves : β seed x, left seed x coordinate = x)
(right_preserves : β seed y, right seed y coordinate = y)
(strategy : Strategy (Fin n β Qβ) (Fin n β Qβ) (Fin n β Aβ) (Fin n β Aβ)) :
law.probability (G.coordinateWin strategy coordinate) β€ G.value +
law.totalVariation (G.localEmbeddingLaw seedLaw left right) := by
apply G.success_le_value_add_embedding_distance (G.coordinateGame coordinate law)
seedLaw left right (fun _ _ a => a coordinate) (fun _ _ b => b coordinate)
intro seed x y a b h
simpa only [coordinateGame, left_preserves, right_preserves] using h
theorem coordinate_probability_le_value_of_approximate_embeddings
{SeedFamily : Nat β Type*} [β t, Fintype (SeedFamily t)]
(G : Game Qβ Qβ Aβ Aβ) {n : Nat} (coordinate : Fin n)
(law : FiniteDistribution ((Fin n β Qβ) Γ (Fin n β Qβ)))
(seedLaw : (t : Nat) β FiniteDistribution (SeedFamily t))
(left : (t : Nat) β SeedFamily t β Qβ β Fin n β Qβ)
(right : (t : Nat) β SeedFamily t β Qβ β Fin n β Qβ)
(left_preserves : β t seed x, left t seed x coordinate = x)
(right_preserves : β t seed y, right t seed y coordinate = y)
(strategy : Strategy (Fin n β Qβ) (Fin n β Qβ) (Fin n β Aβ) (Fin n β Aβ))
(distance : β)
(close : β Ξ· : β, 0 < Ξ· β β t,
law.totalVariation (G.localEmbeddingLaw (seedLaw t) (left t) (right t)) β€
distance + Ξ·) :
law.probability (G.coordinateWin strategy coordinate) β€ G.value + distance := by
by_contra h
have gap : 0 < law.probability (G.coordinateWin strategy coordinate) -
(G.value + distance) := sub_pos.mpr (lt_of_not_ge h)
obtain β¨t, htβ© := close
((law.probability (G.coordinateWin strategy coordinate) - (G.value + distance)) / 2)
(by linarith)
have bound := G.coordinate_probability_le_value_add_embedding_distance coordinate law
(seedLaw t) (left t) (right t) (left_preserves t) (right_preserves t) strategy
linarith
end
end BinPackingGames.Foundations.Games.Game
end OAI
|