Download data/lean/OAI/Computability/DirectedFeedback/Games/CompletedSampling.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 39.1 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/DirectedFeedback/Games/CompletedSampling.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/DirectedFeedback/Games/CompletedSampling.lean
-
curl -L -o CompletedSampling.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/DirectedFeedback/Games/CompletedSampling.lean
39.1 kB
| import Mathlib | |
| import OAI.Computability.DirectedFeedback.Games.Game | |
| import OAI.Computability.DirectedFeedback.Games.SelectedLikelihood | |
| namespace OAI | |
| namespace DFVSGames.Foundations.Repetition.CompletedSampling | |
| open scoped BigOperators | |
| open Games | |
| noncomputable section | |
| section DistributionIdentities | |
| variable {A B C D : Type*} [Fintype A] [Fintype B] [Fintype C] [Fintype D] | |
| theorem mixture_pushforward_base (ΞΌ : FiniteDistribution A) (f : A β B) | |
| (K : B β FiniteDistribution C) : | |
| (ΞΌ.pushforward f).mixture K = ΞΌ.mixture (fun a => K (f a)) := by | |
| apply FiniteDistribution.eq_of_weight_eq | |
| intro c | |
| exact FiniteDistribution.expectation_pushforward ΞΌ f (fun b => (K b).weight c) | |
| theorem product_pushforward_eq_mixture_right (ΞΌ : FiniteDistribution A) | |
| (Ξ½ : FiniteDistribution B) (f : A Γ B β C) : | |
| (ΞΌ.product Ξ½).pushforward f = | |
| Ξ½.mixture (fun b => ΞΌ.pushforward (fun a => f (a, b))) := by | |
| classical | |
| apply FiniteDistribution.eq_of_weight_eq | |
| intro c | |
| simp only [FiniteDistribution.pushforward, FiniteDistribution.product, | |
| FiniteDistribution.mixture, Fintype.sum_prod_type] | |
| rw [Finset.sum_comm] | |
| apply Finset.sum_congr rfl | |
| intro b _ | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro a _ | |
| by_cases h : f (a, b) = c <;> simp [h, mul_comm] | |
| theorem product_product_pushforward_eq_mixture (ΞΌ : FiniteDistribution A) | |
| (Ξ½ : FiniteDistribution B) (ΞΊ : FiniteDistribution C) (f : A β B β C β D) : | |
| (ΞΌ.product (Ξ½.product ΞΊ)).pushforward (fun z => f z.1 z.2.1 z.2.2) = | |
| (ΞΌ.product Ξ½).mixture | |
| (fun z => ΞΊ.pushforward (fun c => f z.1 z.2 c)) := by | |
| classical | |
| apply FiniteDistribution.eq_of_weight_eq | |
| intro d | |
| simp only [FiniteDistribution.pushforward, FiniteDistribution.product, | |
| FiniteDistribution.mixture, Fintype.sum_prod_type] | |
| simp only [Finset.mul_sum, mul_ite, mul_zero, mul_assoc] | |
| theorem mixture_totalVariation_le (ΞΌ Ξ½ : FiniteDistribution A) | |
| (K : A β FiniteDistribution B) : | |
| (ΞΌ.mixture K).totalVariation (Ξ½.mixture K) β€ ΞΌ.totalVariation Ξ½ := by | |
| simpa only [FiniteDistribution.totalVariation, FiniteDistribution.mixture, | |
| Information.totalVariation, kernelPushforward] using | |
| totalVariation_kernelPushforward_le ΞΌ.weight Ξ½.weight | |
| (fun a => (K a).weight) (fun a => Information.gameLaw_isProbability (K a)) | |
| end DistributionIdentities | |
| section Diagonal | |
| variable {Z S : Type*} [Fintype Z] [Fintype S] | |
| def diagonalLaw (Ο : FiniteDistribution (Z Γ S)) : FiniteDistribution (Z Γ S Γ S) := | |
| Information.toGameLaw (diagonalWeights Ο.weight) | |
| (diagonalWeights_isProbability _ (Information.gameLaw_isProbability Ο)) | |
| theorem diagonalLaw_eq_pushforward (Ο : FiniteDistribution (Z Γ S)) : | |
| diagonalLaw Ο = Ο.pushforward (fun z => (z.1, z.2, z.2)) := by | |
| classical | |
| apply FiniteDistribution.eq_of_weight_eq | |
| rintro β¨z, a, bβ© | |
| change diagonalWeights Ο.weight (z, a, b) = | |
| (Ο.pushforward (fun t => (t.1, t.2, t.2))).weight (z, a, b) | |
| simp only [diagonalWeights, FiniteDistribution.pushforward, | |
| Fintype.sum_prod_type, Prod.mk.injEq] | |
| by_cases hab : a = b | |
| Β· subst b | |
| simp [ite_and] | |
| Β· simp [hab, ite_and] | |
| theorem diagonalLaw_mixture {T : Type*} [Fintype T] | |
| (Ο : FiniteDistribution (Z Γ S)) (K : Z Γ S Γ S β FiniteDistribution T) : | |
| (diagonalLaw Ο).mixture K = Ο.mixture (fun z => K (z.1, z.2, z.2)) := by | |
| rw [diagonalLaw_eq_pushforward, mixture_pushforward_base] | |
| end Diagonal | |
| section Completion | |
| variable {X Y S Ξ U V : Type*} | |
| [Fintype X] [Fintype Y] [Fintype S] [Fintype Ξ] [Fintype U] [Fintype V] | |
| [DecidableEq X] [DecidableEq Y] [DecidableEq S] | |
| abbrev Seed (Ξ X Y S U V : Type*) := | |
| Ξ Γ KernelSampling.Seed (X Γ S) (Y Γ S) U V | |
| def seedLaw (Ξ³ : FiniteDistribution Ξ) | |
| (L : X Γ S β FiniteDistribution U) (R : Y Γ S β FiniteDistribution V) : | |
| FiniteDistribution (Seed Ξ X Y S U V) := | |
| Ξ³.product (KernelSampling.seedLaw L R) | |
| def left (sL : Ξ β X β S) (seed : Seed Ξ X Y S U V) (x : X) : U := | |
| KernelSampling.readLeft seed.2 (x, sL seed.1 x) | |
| def right (sR : Ξ β Y β S) (seed : Seed Ξ X Y S U V) (y : Y) : V := | |
| KernelSampling.readRight seed.2 (y, sR seed.1 y) | |
| def completionKernel (L : X Γ S β FiniteDistribution U) | |
| (R : Y Γ S β FiniteDistribution V) (z : (X Γ Y) Γ S Γ S) : | |
| FiniteDistribution (U Γ V) := | |
| (L (z.1.1, z.2.1)).product (R (z.1.2, z.2.2)) | |
| def outputLaw (ΞΌ : FiniteDistribution (X Γ Y)) (Ξ³ : FiniteDistribution Ξ) | |
| (sL : Ξ β X β S) (sR : Ξ β Y β S) | |
| (L : X Γ S β FiniteDistribution U) (R : Y Γ S β FiniteDistribution V) : | |
| FiniteDistribution (U Γ V) := | |
| (seedLaw Ξ³ L R).mixture (fun seed => | |
| ΞΌ.pushforward (fun q => (left sL seed q.1, right sR seed q.2))) | |
| theorem outputLaw_eq_product_pushforward | |
| (ΞΌ : FiniteDistribution (X Γ Y)) (Ξ³ : FiniteDistribution Ξ) | |
| (sL : Ξ β X β S) (sR : Ξ β Y β S) | |
| (L : X Γ S β FiniteDistribution U) (R : Y Γ S β FiniteDistribution V) : | |
| outputLaw ΞΌ Ξ³ sL sR L R = | |
| (ΞΌ.product (seedLaw Ξ³ L R)).pushforward | |
| (fun z => (left sL z.2 z.1.1, right sR z.2 z.1.2)) := by | |
| exact (product_pushforward_eq_mixture_right ΞΌ (seedLaw Ξ³ L R) | |
| (fun z : (X Γ Y) Γ Seed Ξ X Y S U V => | |
| (left sL z.2 z.1.1, right sR z.2 z.1.2))).symm | |
| theorem outputLaw_eq_mixture | |
| (ΞΌ : FiniteDistribution (X Γ Y)) (Ξ³ : FiniteDistribution Ξ) | |
| (sL : Ξ β X β S) (sR : Ξ β Y β S) | |
| (L : X Γ S β FiniteDistribution U) (R : Y Γ S β FiniteDistribution V) : | |
| outputLaw ΞΌ Ξ³ sL sR L R = | |
| (sharedOutputLaw ΞΌ Ξ³ sL sR).mixture (completionKernel L R) := by | |
| calc | |
| outputLaw ΞΌ Ξ³ sL sR L R = | |
| (ΞΌ.product Ξ³).mixture (fun z => | |
| (KernelSampling.seedLaw L R).pushforward (fun table => | |
| (KernelSampling.readLeft table (z.1.1, sL z.2 z.1.1), | |
| KernelSampling.readRight table (z.1.2, sR z.2 z.1.2)))) := by | |
| rw [outputLaw_eq_product_pushforward] | |
| exact product_product_pushforward_eq_mixture ΞΌ Ξ³ (KernelSampling.seedLaw L R) | |
| (fun q seed table => | |
| (KernelSampling.readLeft table (q.1, sL seed q.1), | |
| KernelSampling.readRight table (q.2, sR seed q.2))) | |
| _ = (ΞΌ.product Ξ³).mixture (fun z => | |
| completionKernel L R (z.1, sL z.2 z.1.1, sR z.2 z.1.2)) := by | |
| apply congrArg ((ΞΌ.product Ξ³).mixture) | |
| funext z | |
| exact KernelSampling.read_joint_pushforward L R | |
| (z.1.1, sL z.2 z.1.1) (z.1.2, sR z.2 z.1.2) | |
| _ = (sharedOutputLaw ΞΌ Ξ³ sL sR).mixture (completionKernel L R) := by | |
| exact (mixture_pushforward_base (ΞΌ.product Ξ³) | |
| (fun z => (z.1, sL z.2 z.1.1, sR z.2 z.1.2)) (completionKernel L R)).symm | |
| omit [DecidableEq X] [DecidableEq Y] [DecidableEq S] in | |
| theorem diagonalLaw_completion_mixture | |
| (Ο : FiniteDistribution ((X Γ Y) Γ S)) | |
| (L : X Γ S β FiniteDistribution U) (R : Y Γ S β FiniteDistribution V) : | |
| (diagonalLaw Ο).mixture (completionKernel L R) = | |
| Ο.mixture (fun z => (L (z.1.1, z.2)).product (R (z.1.2, z.2))) := by | |
| exact diagonalLaw_mixture Ο (completionKernel L R) | |
| theorem outputLaw_totalVariation_le | |
| (ΞΌ : FiniteDistribution (X Γ Y)) (Ξ³ : FiniteDistribution Ξ) | |
| (sL : Ξ β X β S) (sR : Ξ β Y β S) | |
| (L : X Γ S β FiniteDistribution U) (R : Y Γ S β FiniteDistribution V) | |
| (Ο : FiniteDistribution ((X Γ Y) Γ S)) : | |
| (outputLaw ΞΌ Ξ³ sL sR L R).totalVariation | |
| (Ο.mixture (fun z => (L (z.1.1, z.2)).product (R (z.1.2, z.2)))) β€ | |
| (sharedOutputLaw ΞΌ Ξ³ sL sR).totalVariation (diagonalLaw Ο) := by | |
| rw [outputLaw_eq_mixture, β diagonalLaw_completion_mixture Ο L R] | |
| exact mixture_totalVariation_le _ _ (completionKernel L R) | |
| end Completion | |
| variable {I X Y S Ξ : Type*} | |
| [Fintype I] [Fintype X] [Fintype Y] [Fintype S] [Fintype Ξ] | |
| [DecidableEq I] [DecidableEq X] [DecidableEq Y] [DecidableEq S] | |
| def coordinateLeft (j : I) (sL : Ξ β X β S) | |
| (seed : Seed Ξ X Y S (I β X) (I β Y)) (x : X) : I β X := | |
| KernelSampling.completedLeft j seed.2 (x, sL seed.1 x) | |
| def coordinateRight (j : I) (sR : Ξ β Y β S) | |
| (seed : Seed Ξ X Y S (I β X) (I β Y)) (y : Y) : I β Y := | |
| KernelSampling.completedRight j seed.2 (y, sR seed.1 y) | |
| omit [Fintype I] [Fintype X] [Fintype Y] [Fintype S] [Fintype Ξ] | |
| [DecidableEq X] [DecidableEq Y] [DecidableEq S] in | |
| @[simp] theorem coordinateLeft_preserves (j : I) (sL : Ξ β X β S) | |
| (seed : Seed Ξ X Y S (I β X) (I β Y)) (x : X) : | |
| coordinateLeft j sL seed x j = x := by | |
| simp [coordinateLeft] | |
| omit [Fintype I] [Fintype X] [Fintype Y] [Fintype S] [Fintype Ξ] | |
| [DecidableEq X] [DecidableEq Y] [DecidableEq S] in | |
| @[simp] theorem coordinateRight_preserves (j : I) (sR : Ξ β Y β S) | |
| (seed : Seed Ξ X Y S (I β X) (I β Y)) (y : Y) : | |
| coordinateRight j sR seed y j = y := by | |
| simp [coordinateRight] | |
| def coordinateOutputLaw (ΞΌ : FiniteDistribution (X Γ Y)) (Ξ³ : FiniteDistribution Ξ) | |
| (j : I) (sL : Ξ β X β S) (sR : Ξ β Y β S) | |
| (L : X Γ S β FiniteDistribution (I β X)) | |
| (R : Y Γ S β FiniteDistribution (I β Y)) : | |
| FiniteDistribution ((I β X) Γ (I β Y)) := | |
| (seedLaw Ξ³ L R).mixture (fun seed => ΞΌ.pushforward | |
| (fun q => (coordinateLeft j sL seed q.1, coordinateRight j sR seed q.2))) | |
| theorem coordinateOutputLaw_eq_mixture | |
| (ΞΌ : FiniteDistribution (X Γ Y)) (Ξ³ : FiniteDistribution Ξ) | |
| (j : I) (sL : Ξ β X β S) (sR : Ξ β Y β S) | |
| (L : X Γ S β FiniteDistribution (I β X)) | |
| (R : Y Γ S β FiniteDistribution (I β Y)) | |
| (hL : β q xs, (L q).weight xs β 0 β xs j = q.1) | |
| (hR : β q ys, (R q).weight ys β 0 β ys j = q.1) : | |
| coordinateOutputLaw ΞΌ Ξ³ j sL sR L R = | |
| (sharedOutputLaw ΞΌ Ξ³ sL sR).mixture (completionKernel L R) := by | |
| calc | |
| coordinateOutputLaw ΞΌ Ξ³ j sL sR L R = | |
| (ΞΌ.product (seedLaw Ξ³ L R)).pushforward | |
| (fun z => (coordinateLeft j sL z.2 z.1.1, | |
| coordinateRight j sR z.2 z.1.2)) := by | |
| exact (product_pushforward_eq_mixture_right ΞΌ (seedLaw Ξ³ L R) | |
| (fun z : (X Γ Y) Γ Seed Ξ X Y S (I β X) (I β Y) => | |
| (coordinateLeft j sL z.2 z.1.1, coordinateRight j sR z.2 z.1.2))).symm | |
| _ = (ΞΌ.product Ξ³).mixture (fun z => | |
| (KernelSampling.seedLaw L R).pushforward (fun table => | |
| (KernelSampling.completedLeft j table (z.1.1, sL z.2 z.1.1), | |
| KernelSampling.completedRight j table (z.1.2, sR z.2 z.1.2)))) := by | |
| exact product_product_pushforward_eq_mixture ΞΌ Ξ³ (KernelSampling.seedLaw L R) | |
| (fun q seed table => | |
| (KernelSampling.completedLeft j table (q.1, sL seed q.1), | |
| KernelSampling.completedRight j table (q.2, sR seed q.2))) | |
| _ = (ΞΌ.product Ξ³).mixture (fun z => | |
| completionKernel L R (z.1, sL z.2 z.1.1, sR z.2 z.1.2)) := by | |
| apply congrArg ((ΞΌ.product Ξ³).mixture) | |
| funext z | |
| exact KernelSampling.completed_joint_pushforward L R j hL hR | |
| (z.1.1, sL z.2 z.1.1) (z.1.2, sR z.2 z.1.2) | |
| _ = (sharedOutputLaw ΞΌ Ξ³ sL sR).mixture (completionKernel L R) := by | |
| exact (mixture_pushforward_base (ΞΌ.product Ξ³) | |
| (fun z => (z.1, sL z.2 z.1.1, sR z.2 z.1.2)) (completionKernel L R)).symm | |
| theorem coordinateOutputLaw_eq_outputLaw | |
| (ΞΌ : FiniteDistribution (X Γ Y)) (Ξ³ : FiniteDistribution Ξ) | |
| (j : I) (sL : Ξ β X β S) (sR : Ξ β Y β S) | |
| (L : X Γ S β FiniteDistribution (I β X)) | |
| (R : Y Γ S β FiniteDistribution (I β Y)) | |
| (hL : β q xs, (L q).weight xs β 0 β xs j = q.1) | |
| (hR : β q ys, (R q).weight ys β 0 β ys j = q.1) : | |
| coordinateOutputLaw ΞΌ Ξ³ j sL sR L R = outputLaw ΞΌ Ξ³ sL sR L R := by | |
| rw [coordinateOutputLaw_eq_mixture ΞΌ Ξ³ j sL sR L R hL hR, outputLaw_eq_mixture] | |
| theorem coordinateOutputLaw_totalVariation_le | |
| (ΞΌ : FiniteDistribution (X Γ Y)) (Ξ³ : FiniteDistribution Ξ) | |
| (j : I) (sL : Ξ β X β S) (sR : Ξ β Y β S) | |
| (L : X Γ S β FiniteDistribution (I β X)) | |
| (R : Y Γ S β FiniteDistribution (I β Y)) | |
| (hL : β q xs, (L q).weight xs β 0 β xs j = q.1) | |
| (hR : β q ys, (R q).weight ys β 0 β ys j = q.1) | |
| (Ο : FiniteDistribution ((X Γ Y) Γ S)) : | |
| (coordinateOutputLaw ΞΌ Ξ³ j sL sR L R).totalVariation | |
| (Ο.mixture (fun z => (L (z.1.1, z.2)).product (R (z.1.2, z.2)))) β€ | |
| (sharedOutputLaw ΞΌ Ξ³ sL sR).totalVariation (diagonalLaw Ο) := by | |
| rw [coordinateOutputLaw_eq_outputLaw ΞΌ Ξ³ j sL sR L R hL hR] | |
| exact outputLaw_totalVariation_le ΞΌ Ξ³ sL sR L R Ο | |
| end | |
| end DFVSGames.Foundations.Repetition.CompletedSampling | |
| namespace DFVSGames.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 DFVSGames.Foundations.Games.Game | |
| namespace DFVSGames.Foundations.Repetition | |
| open scoped BigOperators | |
| open Games CorrelatedSampling | |
| noncomputable section | |
| variable {Qβ Qβ Aβ Aβ S : Type*} | |
| [Fintype Qβ] [Fintype Qβ] [Fintype Aβ] [Fintype Aβ] [Fintype S] | |
| [Nonempty Aβ] [Nonempty Aβ] [Nonempty S] | |
| [DecidableEq Qβ] [DecidableEq Qβ] [DecidableEq S] {n : Nat} | |
| theorem coordinate_probability_le_value_of_local_completion | |
| (G : Game Qβ Qβ Aβ Aβ) (j : Fin n) | |
| (strategy : Strategy (Fin n β Qβ) (Fin n β Qβ) (Fin n β Aβ) (Fin n β Aβ)) | |
| (Ο : FiniteDistribution ((Qβ Γ Qβ) Γ S)) | |
| (profileL : Qβ β FiniteDistribution S) (profileR : Qβ β FiniteDistribution S) | |
| (completionL : Qβ Γ S β FiniteDistribution (Fin n β Qβ)) | |
| (completionR : Qβ Γ S β FiniteDistribution (Fin n β Qβ)) | |
| (supportL : β q xs, (completionL q).weight xs β 0 β xs j = q.1) | |
| (supportR : β q ys, (completionR q).weight ys β 0 β ys j = q.1) | |
| (fallback : S) : | |
| (Ο.mixture (fun z => (completionL (z.1.1,z.2)).product | |
| (completionR (z.1.2,z.2)))).probability (G.coordinateWin strategy j) β€ | |
| G.value + | |
| (2 * Information.totalVariation Ο.weight | |
| (fun z => G.questions.weight z.1 * (profileL z.1.1).weight z.2) + | |
| 2 * Information.totalVariation Ο.weight | |
| (fun z => G.questions.weight z.1 * (profileR z.1.2).weight z.2)) := by | |
| let targetLaw := Ο.mixture (fun z => (completionL (z.1.1,z.2)).product (completionR (z.1.2,z.2))) | |
| let Ξ΄ := 2 * Information.totalVariation Ο.weight | |
| (fun z => G.questions.weight z.1 * (profileL z.1.1).weight z.2) + | |
| 2 * Information.totalVariation Ο.weight | |
| (fun z => G.questions.weight z.1 * (profileR z.1.2).weight z.2) | |
| change targetLaw.probability (G.coordinateWin strategy j) β€ G.value + Ξ΄ | |
| by_contra h | |
| have gap : 0 < targetLaw.probability (G.coordinateWin strategy j) - (G.value + Ξ΄) := | |
| sub_pos.mpr (lt_of_not_ge h) | |
| let Ξ· := (targetLaw.probability (G.coordinateWin strategy j) - (G.value + Ξ΄)) / 2 | |
| have hΞ· : 0 < Ξ· := by dsimp [Ξ·]; linarith | |
| obtain β¨N,hNβ© := samplerOutputLaw_arbitrarily_close Ο G.questions profileL profileR fallback Ξ· hΞ· | |
| let thresholds := sharedProfileThresholds profileL profileR | |
| let Ξ³ := traceSeedLaw (rectangleDistribution (Ξ± := S) thresholds) N | |
| let sL := samplerLocal thresholds profileL fallback N | |
| let sR := samplerLocal thresholds profileR fallback N | |
| have hvariation := CompletedSampling.coordinateOutputLaw_totalVariation_le | |
| G.questions Ξ³ j sL sR completionL completionR supportL supportR Ο | |
| have hclose : (CompletedSampling.coordinateOutputLaw G.questions Ξ³ j sL sR completionL completionR).totalVariation targetLaw β€ Ξ΄ + Ξ· := | |
| hvariation.trans hN | |
| have hsuccess := G.coordinate_probability_le_value_add_embedding_distance j targetLaw | |
| (CompletedSampling.seedLaw Ξ³ completionL completionR) | |
| (CompletedSampling.coordinateLeft j sL) (CompletedSampling.coordinateRight j sR) | |
| (CompletedSampling.coordinateLeft_preserves j sL) | |
| (CompletedSampling.coordinateRight_preserves j sR) strategy | |
| have hsym : targetLaw.totalVariation | |
| (G.localEmbeddingLaw (CompletedSampling.seedLaw Ξ³ completionL completionR) | |
| (CompletedSampling.coordinateLeft j sL) (CompletedSampling.coordinateRight j sR)) = | |
| (CompletedSampling.coordinateOutputLaw G.questions Ξ³ j sL sR completionL completionR).totalVariation targetLaw := by | |
| unfold FiniteDistribution.totalVariation | |
| congr 1 | |
| apply Finset.sum_congr rfl | |
| intro q _ | |
| exact abs_sub_comm _ _ | |
| rw [hsym] at hsuccess | |
| dsimp [Ξ·] at hclose | |
| linarith | |
| end | |
| end DFVSGames.Foundations.Repetition | |
| namespace DFVSGames.Foundations.Repetition | |
| open scoped BigOperators | |
| open Games | |
| noncomputable section | |
| variable {Qβ Qβ Aβ Aβ : Type*} | |
| [Fintype Qβ] [Fintype Qβ] [Fintype Aβ] [Fintype Aβ] | |
| [DecidableEq Qβ] [DecidableEq Qβ] {n : β} | |
| theorem selectedLabels_card (selected : Finset (Fin n)) : | |
| Fintype.card (SelectedLabels (Aβ := Aβ) (Aβ := Aβ) selected) = | |
| (Fintype.card Aβ * Fintype.card Aβ) ^ selected.card := by | |
| simp [SelectedLabels, Fintype.card_prod, mul_pow] | |
| theorem unusedCoordinates_card (selected : Finset (Fin n)) : | |
| Fintype.card {i : Fin n // i β selected} = n - selected.card := by | |
| classical | |
| simp | |
| theorem unusedCoordinates_card_real (selected : Finset (Fin n)) : | |
| (Fintype.card {i : Fin n // i β selected} : β) = (n : β) - selected.card := by | |
| have hs : selected.card β€ n := by simpa using Finset.card_le_univ selected | |
| rw [unusedCoordinates_card, Nat.cast_sub hs] | |
| theorem log_le_logTwo {x : β} (hx : 1 β€ x) : Real.log x β€ logTwo x := by | |
| have hlog : 0 β€ Real.log x := Real.log_nonneg hx | |
| have htwo : 0 < Real.log 2 := Real.log_pos (by norm_num) | |
| have htwo_le : Real.log 2 β€ 1 := by | |
| convert Real.log_le_sub_one_of_pos (by norm_num : (0 : β) < 2) using 1 ; norm_num | |
| unfold logTwo | |
| apply (le_div_iffβ htwo).2 | |
| simpa using mul_le_mul_of_nonneg_left htwo_le hlog | |
| theorem selectedLabels_log_le [Nonempty Aβ] [Nonempty Aβ] | |
| (selected : Finset (Fin n)) (ell : β) | |
| (hell : logTwo ((Fintype.card Aβ : β) * (Fintype.card Aβ : β)) β€ ell) : | |
| Real.log (Fintype.card (SelectedLabels (Aβ := Aβ) (Aβ := Aβ) selected) : β) β€ | |
| (selected.card : β) * ell := by | |
| have ha : (1 : β) β€ Fintype.card Aβ := by exact_mod_cast Fintype.card_pos (Ξ± := Aβ) | |
| have hb : (1 : β) β€ Fintype.card Aβ := by exact_mod_cast Fintype.card_pos (Ξ± := Aβ) | |
| have hab : (1 : β) β€ (Fintype.card Aβ : β) * (Fintype.card Aβ : β) := by nlinarith | |
| rw [selectedLabels_card, Nat.cast_pow, Nat.cast_mul, Real.log_pow] | |
| exact mul_le_mul_of_nonneg_left ((log_le_logTwo hab).trans hell) (Nat.cast_nonneg _) | |
| omit [DecidableEq Qβ] [DecidableEq Qβ] in | |
| theorem selectedInformationRadius_le [Nonempty Aβ] [Nonempty Aβ] | |
| (G : Game Qβ Qβ Aβ Aβ) | |
| (strategy : Strategy (Fin n β Qβ) (Fin n β Qβ) (Fin n β Aβ) (Fin n β Aβ)) | |
| (selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected) | |
| (ell : β) | |
| (hell : logTwo ((Fintype.card Aβ : β) * (Fintype.card Aβ : β)) β€ ell) : | |
| selectedInformationRadius G strategy selected β€ | |
| Real.sqrt (((n : β) - selected.card) * | |
| ((selected.card : β) * ell + logTwo (1 / G.selectedSuccess strategy selected))) := by | |
| have hprob : 1 β€ 1 / G.selectedSuccess strategy selected := by | |
| apply (le_div_iffβ positive).2 | |
| simpa using G.selectedSuccess_le_one strategy selected | |
| have hbudget := add_le_add (selectedLabels_log_le (Aβ := Aβ) (Aβ := Aβ) selected ell hell) | |
| (log_le_logTwo hprob) | |
| unfold selectedInformationRadius | |
| rw [β unusedCoordinates_card_real selected] | |
| apply Real.sqrt_le_sqrt | |
| exact mul_le_mul_of_nonneg_left hbudget (Nat.cast_nonneg _) | |
| theorem sqrt_budget_factor (a b : β) (ha : 0 < a) : | |
| Real.sqrt (a * b) = a * Real.sqrt (b / a) := by | |
| have he : a * b = a ^ 2 * (b / a) := by | |
| field_simp | |
| rw [he, Real.sqrt_mul (sq_nonneg a), Real.sqrt_sq (le_of_lt ha)] | |
| omit [DecidableEq Qβ] [DecidableEq Qβ] in | |
| theorem exists_coordinate_le_information_budget [Nonempty Aβ] [Nonempty Aβ] | |
| (G : Game Qβ Qβ Aβ Aβ) | |
| (strategy : Strategy (Fin n β Qβ) (Fin n β Qβ) (Fin n β Aβ) (Fin n β Aβ)) | |
| (selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected) | |
| (ell : β) | |
| (hell : logTwo ((Fintype.card Aβ : β) * (Fintype.card Aβ : β)) β€ ell) | |
| (hselected : selected.card < n) | |
| (error : {i : Fin n // i β selected} β β) | |
| (hsum : (β j, error j) β€ 15 * selectedInformationRadius G strategy selected) : | |
| β j : {i : Fin n // i β selected}, error j β€ 15 * Real.sqrt | |
| (((selected.card : β) * ell + logTwo (1 / G.selectedSuccess strategy selected)) / | |
| ((n : β) - selected.card)) := by | |
| classical | |
| have hcard : 0 < Fintype.card {i : Fin n // i β selected} := by | |
| rw [unusedCoordinates_card] | |
| exact Nat.sub_pos_of_lt hselected | |
| let : Nonempty {i : Fin n // i β selected} := Fintype.card_pos_iff.mp hcard | |
| have hden : 0 < (n : β) - selected.card := by | |
| rw [β unusedCoordinates_card_real selected] | |
| exact_mod_cast hcard | |
| have htotal := hsum.trans (mul_le_mul_of_nonneg_left | |
| (selectedInformationRadius_le G strategy selected positive ell hell) (by norm_num : (0 : β) β€ 15)) | |
| rw [sqrt_budget_factor _ _ hden] at htotal | |
| have havg : (β j, error j) β€ β _j : {i : Fin n // i β selected}, | |
| 15 * Real.sqrt | |
| (((selected.card : β) * ell + logTwo (1 / G.selectedSuccess strategy selected)) / | |
| ((n : β) - selected.card)) := by | |
| simpa only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, | |
| unusedCoordinates_card_real, mul_assoc, mul_left_comm] using htotal | |
| obtain β¨j, _, hjβ© := Finset.exists_le_of_sum_le Finset.univ_nonempty havg | |
| exact β¨j, hjβ© | |
| end | |
| end DFVSGames.Foundations.Repetition | |
| namespace DFVSGames.Foundations.Repetition.SelectionSequence | |
| private theorem exists_unused_inline_SelectionSequence {n : Nat} (S : Finset (Fin n)) (hcard : S.card < n) : | |
| β j : Fin n, j β S := by | |
| classical | |
| apply Classical.byContradiction | |
| intro h | |
| have hall : β j : Fin n, j β S := by | |
| intro j | |
| apply Classical.byContradiction | |
| intro hj | |
| exact h β¨j, hjβ© | |
| have hfull : S = Finset.univ := | |
| Finset.ext (fun j => iff_of_true (hall j) (Finset.mem_univ j)) | |
| have hbad : n < n := by | |
| simpa only [hfull, Finset.card_univ, Fintype.card_fin] using hcard | |
| exact Nat.lt_irrefl n hbad | |
| noncomputable def nextSet {n : Nat} | |
| (Step : Finset (Fin n) β Fin n β Prop) | |
| (witness : β S, S.card < n β β j, j β S β§ Step S j) | |
| (S : Finset (Fin n)) : Finset (Fin n) := | |
| if hs : S.card < n then insert (Classical.choose (witness S hs)) S else S | |
| noncomputable def selectedSet {n : Nat} | |
| (Step : Finset (Fin n) β Fin n β Prop) | |
| (witness : β S, S.card < n β β j, j β S β§ Step S j) : Nat β Finset (Fin n) | |
| | 0 => β | |
| | m + 1 => nextSet Step witness (selectedSet Step witness m) | |
| theorem selectedSet_card {n : Nat} | |
| (Step : Finset (Fin n) β Fin n β Prop) | |
| (witness : β S, S.card < n β β j, j β S β§ Step S j) (m : Nat) : | |
| (selectedSet Step witness m).card = min m n := by | |
| induction m with | |
| | zero => simp [selectedSet] | |
| | succ m ih => | |
| by_cases hm : m < n | |
| Β· have hc : (selectedSet Step witness m).card = m := by | |
| simpa only [Nat.min_eq_left (Nat.le_of_lt hm)] using ih | |
| have hs : (selectedSet Step witness m).card < n := by | |
| simpa only [hc] using hm | |
| rw [selectedSet, nextSet, dite_eq_left hs, | |
| Finset.card_insert_of_notMem ((Classical.choose_spec (witness _ hs)).1), | |
| hc, Nat.min_eq_left (Nat.succ_le_of_lt hm)] | |
| Β· have hc : (selectedSet Step witness m).card = n := by | |
| simpa only [Nat.min_eq_right (Nat.le_of_not_gt hm)] using ih | |
| have hs : Β¬(selectedSet Step witness m).card < n := by | |
| rw [hc] | |
| exact Nat.not_lt.mpr (Nat.le_refl n) | |
| rw [selectedSet, nextSet, dite_eq_right hs, hc, | |
| Nat.min_eq_right (Nat.le_trans (Nat.le_of_not_gt hm) (Nat.le_succ m))] | |
| theorem selectedSet_subset_succ {n : Nat} | |
| (Step : Finset (Fin n) β Fin n β Prop) | |
| (witness : β S, S.card < n β β j, j β S β§ Step S j) (m : Nat) : | |
| selectedSet Step witness m β selectedSet Step witness (m + 1) := by | |
| change selectedSet Step witness m β nextSet Step witness (selectedSet Step witness m) | |
| unfold nextSet | |
| split | |
| Β· exact Finset.subset_insert _ _ | |
| Β· exact le_rfl | |
| theorem selectedSet_monotone {n : Nat} | |
| (Step : Finset (Fin n) β Fin n β Prop) | |
| (witness : β S, S.card < n β β j, j β S β§ Step S j) : | |
| Monotone (selectedSet Step witness) := | |
| monotone_nat_of_le_succ (selectedSet_subset_succ Step witness) | |
| theorem selectedSet_univ {n : Nat} | |
| (Step : Finset (Fin n) β Fin n β Prop) | |
| (witness : β S, S.card < n β β j, j β S β§ Step S j) : | |
| selectedSet Step witness n = Finset.univ := by | |
| apply Finset.eq_of_subset_of_card_le (Finset.subset_univ _) | |
| simp [selectedSet_card] | |
| theorem selectedSet_step {n : Nat} | |
| (Step : Finset (Fin n) β Fin n β Prop) | |
| (witness : β S, S.card < n β β j, j β S β§ Step S j) | |
| (m : Nat) (hm : m < n) : | |
| β j, j β selectedSet Step witness m β§ | |
| selectedSet Step witness (m + 1) = insert j (selectedSet Step witness m) β§ | |
| Step (selectedSet Step witness m) j := by | |
| have hc : (selectedSet Step witness m).card = m := by | |
| rw [selectedSet_card, Nat.min_eq_left (Nat.le_of_lt hm)] | |
| have hs : (selectedSet Step witness m).card < n := by simpa only [hc] using hm | |
| let j := Classical.choose (witness (selectedSet Step witness m) hs) | |
| have hj := Classical.choose_spec (witness (selectedSet Step witness m) hs) | |
| refine β¨j, hj.1, ?_, hj.2β© | |
| simp only [selectedSet, nextSet, dite_eq_left hs, j] | |
| def SetStep {n : Nat} (P : Finset (Fin n) β β) (v ell : β) | |
| (S : Finset (Fin n)) (j : Fin n) : Prop := | |
| P (insert j S) β€ P S * | |
| (v + 15 * Real.sqrt (((S.card : β) * ell + logTwo (1 / P S)) / | |
| ((n : β) - S.card))) | |
| theorem totalSetStep {n : Nat} (P : Finset (Fin n) β β) (v ell : β) | |
| (hnonneg : β S, 0 β€ P S) (hanti : Antitone P) | |
| (hpositive : β S, S.card < n β 0 < P S β | |
| β j, j β S β§ SetStep P v ell S j) : | |
| β S, S.card < n β β j, j β S β§ SetStep P v ell S j := by | |
| intro S hcard | |
| by_cases hp : 0 < P S | |
| Β· exact hpositive S hcard hp | |
| Β· obtain β¨j, hjβ© := exists_unused_inline_SelectionSequence S hcard | |
| have hz : P S = 0 := le_antisymm (le_of_not_gt hp) (hnonneg S) | |
| have hnext : P (insert j S) = 0 := le_antisymm | |
| ((hanti (Finset.subset_insert j S)).trans (le_of_eq hz)) (hnonneg (insert j S)) | |
| refine β¨j, hj, ?_β© | |
| simpa only [SetStep, hnext, hz, zero_mul] using (le_refl (0 : β)) | |
| theorem exists_scalar_sequence {n : Nat} (P : Finset (Fin n) β β) (v ell : β) | |
| (hempty : P β = 1) (hnonneg : β S, 0 β€ P S) (hanti : Antitone P) | |
| (hpositive : β S, S.card < n β 0 < P S β | |
| β j, j β S β§ SetStep P v ell S j) : | |
| β p : Nat β β, p 0 = 1 β§ (β m, 0 β€ p m) β§ Antitone p β§ | |
| ScalarRecurrence p n v ell β§ p n = P Finset.univ := by | |
| let witness := totalSetStep P v ell hnonneg hanti hpositive | |
| let sets := selectedSet (SetStep P v ell) witness | |
| let p := fun m => P (sets m) | |
| refine β¨p, ?_, ?_, ?_, ?_, ?_β© | |
| Β· change P (selectedSet (SetStep P v ell) witness 0) = 1 | |
| simpa only [selectedSet] using hempty | |
| Β· intro m | |
| exact hnonneg (sets m) | |
| Β· intro i j hij | |
| exact hanti (selectedSet_monotone (SetStep P v ell) witness hij) | |
| Β· intro m hm | |
| obtain β¨j, _, hnext, hboundβ© := | |
| selectedSet_step (SetStep P v ell) witness m hm | |
| have hc : (selectedSet (SetStep P v ell) witness m).card = m := by | |
| rw [selectedSet_card, Nat.min_eq_left (Nat.le_of_lt hm)] | |
| change P (selectedSet (SetStep P v ell) witness (m + 1)) β€ _ | |
| rw [hnext] | |
| simpa only [SetStep, hc] using hbound | |
| Β· change P (selectedSet (SetStep P v ell) witness n) = P Finset.univ | |
| rw [selectedSet_univ] | |
| open DFVSGames.Foundations.Games | |
| variable {Qβ Qβ Aβ Aβ : Type*} | |
| variable [Fintype Qβ] [Fintype Qβ] [Fintype Aβ] [Fintype Aβ] | |
| variable [Nonempty Aβ] [Nonempty Aβ] | |
| def ConditionalCoordinateBound (G : Game Qβ Qβ Aβ Aβ) (n : Nat) | |
| (strategy : Strategy (Fin n β Qβ) (Fin n β Qβ) (Fin n β Aβ) (Fin n β Aβ)) | |
| (ell : β) : Prop := | |
| β (S : Finset (Fin n)) (_hcard : S.card < n) | |
| (hp : 0 < G.selectedSuccess strategy S), | |
| β j, j β S β§ | |
| (((G.repetition n).questions.condition (G.selectedWins strategy S) hp).probability | |
| (G.coordinateWin strategy j)) β€ | |
| G.value + 15 * Real.sqrt | |
| (((S.card : β) * ell + logTwo (1 / G.selectedSuccess strategy S)) / | |
| ((n : β) - S.card)) | |
| theorem repetition_success_le_of_conditionalCoordinateBound | |
| (G : Game Qβ Qβ Aβ Aβ) (n : Nat) | |
| (strategy : Strategy (Fin n β Qβ) (Fin n β Qβ) (Fin n β Aβ) (Fin n β Aβ)) | |
| {v ell : β} (hvalue : G.value β€ v) (hv1 : v < 1) (hell : 1 β€ ell) | |
| (hcoordinate : ConditionalCoordinateBound G n strategy ell) : | |
| (G.repetition n).success strategy β€ | |
| (1 - (1 - v)^3 / 6000)^((n : β) / ell) := by | |
| have hpositive : β S : Finset (Fin n), S.card < n β | |
| 0 < G.selectedSuccess strategy S β | |
| β j, j β S β§ SetStep (G.selectedSuccess strategy) v ell S j := by | |
| intro S hcard hp | |
| obtain β¨j, hj, hboundβ© := hcoordinate S hcard hp | |
| refine β¨j, hj, ?_β© | |
| change G.selectedSuccess strategy (insert j S) β€ _ | |
| rw [G.selectedSuccess_insert strategy S j hp] | |
| exact mul_le_mul_of_nonneg_left | |
| (hbound.trans (add_le_add hvalue (le_refl _))) (le_of_lt hp) | |
| obtain β¨p, hp0, hpnonneg, hpmono, hrec, hpnβ© := | |
| exists_scalar_sequence (G.selectedSuccess strategy) v ell | |
| (G.selectedSuccess_empty strategy) (G.selectedSuccess_nonnegative strategy) | |
| (G.selectedSuccess_antitone strategy) hpositive | |
| have hbound := scalar_bound_6000 p n | |
| (G.value_nonnegative.trans hvalue) hv1 hell hp0 hpnonneg hpmono hrec | |
| rw [hpn, G.selectedSuccess_univ strategy] at hbound | |
| exact hbound | |
| end DFVSGames.Foundations.Repetition.SelectionSequence | |
| namespace DFVSGames.Foundations.Repetition | |
| open scoped BigOperators | |
| open Games | |
| noncomputable section | |
| variable {Qβ Qβ Aβ Aβ : Type*} | |
| [Fintype Qβ] [Fintype Qβ] [Fintype Aβ] [Fintype Aβ] | |
| [Nonempty Aβ] [Nonempty Aβ] | |
| [DecidableEq Qβ] [DecidableEq Qβ] {n : Nat} | |
| theorem selected_coordinate_probability_le_value_add_error | |
| (G : Game Qβ Qβ Aβ Aβ) | |
| (strategy : Strategy (Fin n β Qβ) (Fin n β Qβ) (Fin n β Aβ) (Fin n β Aβ)) | |
| (selected : Finset (Fin n)) (positive : 0 < G.selectedSuccess strategy selected) | |
| (j : {i : Fin n // i β selected}) : | |
| ((G.repetition n).questions.condition (G.selectedWins strategy selected) positive).probability | |
| (G.coordinateWin strategy j.1) β€ | |
| G.value + selectedEmbeddingError G strategy selected positive j := by | |
| classical | |
| let : Nonempty (SelectedCommonData (Qβ := Qβ) (Qβ := Qβ) | |
| (Aβ := Aβ) (Aβ := Aβ) selected j) := | |
| finiteDistribution_nonempty (selectedProfileFallback G strategy selected positive j) | |
| have h := coordinate_probability_le_value_of_local_completion G j.1 strategy | |
| (selectedSamplingTarget G strategy selected positive j) | |
| (selectedLeftProfile G strategy selected positive j) | |
| (selectedRightProfile G strategy selected positive j) | |
| (selectedFullLeftCompletion G strategy selected j) | |
| (selectedFullRightCompletion G strategy selected j) | |
| (selectedFullLeftCompletion_support G strategy selected j) | |
| (selectedFullRightCompletion_support G strategy selected j) | |
| (Classical.choice inferInstance) | |
| have htarget : (selectedSamplingTarget G strategy selected positive j).mixture | |
| (fun z => (selectedFullLeftCompletion G strategy selected j (z.1.1,z.2)).product | |
| (selectedFullRightCompletion G strategy selected j (z.1.2,z.2))) = | |
| (G.repetition n).questions.condition (G.selectedWins strategy selected) positive := | |
| selectedFullCompletionMixture_eq_conditionedQuestions G strategy selected positive j | |
| rw [htarget, selectedSamplingTarget_left_error, selectedSamplingTarget_right_error] at h | |
| exact h | |
| theorem holenstein_conditionalCoordinateBound | |
| (G : Game Qβ Qβ Aβ Aβ) (n : Nat) | |
| (strategy : Strategy (Fin n β Qβ) (Fin n β Qβ) (Fin n β Aβ) (Fin n β Aβ)) | |
| (ell : β) | |
| (halphabet : logTwo ((Fintype.card Aβ : β) * (Fintype.card Aβ : β)) β€ ell) : | |
| SelectionSequence.ConditionalCoordinateBound G n strategy ell := by | |
| intro selected hcard positive | |
| obtain β¨j,hjβ© := exists_coordinate_le_information_budget G strategy selected positive ell | |
| halphabet hcard (selectedEmbeddingError G strategy selected positive) | |
| (selectedEmbeddingError_sum_le_fifteen G strategy selected positive) | |
| exact β¨j.1,j.property, | |
| (selected_coordinate_probability_le_value_add_error G strategy selected positive j).trans | |
| (add_le_add le_rfl hj)β© | |
| theorem holenstein_repetition_success | |
| (G : Game Qβ Qβ Aβ Aβ) (n : Nat) | |
| (strategy : Strategy (Fin n β Qβ) (Fin n β Qβ) (Fin n β Aβ) (Fin n β Aβ)) | |
| {v ell : β} (hvalue : G.value β€ v) (hv : v < 1) (hell : 1 β€ ell) | |
| (halphabet : logTwo ((Fintype.card Aβ : β) * (Fintype.card Aβ : β)) β€ ell) : | |
| (G.repetition n).success strategy β€ | |
| (1 - (1 - v)^3 / 6000)^((n : β) / ell) := | |
| SelectionSequence.repetition_success_le_of_conditionalCoordinateBound G n strategy | |
| hvalue hv hell (holenstein_conditionalCoordinateBound G n strategy ell halphabet) | |
| theorem holenstein_repetition_value | |
| (G : Game Qβ Qβ Aβ Aβ) (n : Nat) | |
| {v ell : β} (hvalue : G.value β€ v) (hv : v < 1) (hell : 1 β€ ell) | |
| (halphabet : logTwo ((Fintype.card Aβ : β) * (Fintype.card Aβ : β)) β€ ell) : | |
| (G.repetition n).value β€ | |
| (1 - (1 - v)^3 / 6000)^((n : β) / ell) := by | |
| apply ((G.repetition n).value_le_iff _).2 | |
| intro strategy | |
| exact holenstein_repetition_success G n strategy hvalue hv hell halphabet | |
| end | |
| end DFVSGames.Foundations.Repetition | |
| end OAI | |