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