Download data/lean/OAI/Computability/VertexCover/Repetition/SelectedCommonMarginal.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.57 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/VertexCover/Repetition/SelectedCommonMarginal.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/VertexCover/Repetition/SelectedCommonMarginal.lean
-
curl -L -o SelectedCommonMarginal.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/VertexCover/Repetition/SelectedCommonMarginal.lean
6.57 kB
| import Mathlib | |
| import OAI.Computability.VertexCover.Repetition.SelectedJointGame | |
| import OAI.Computability.VertexCover.Repetition.QuestionMarginal | |
| import OAI.Computability.VertexCover.Repetition.DistributionMaps | |
| import OAI.Computability.VertexCover.Repetition.SelectedCommon | |
| namespace OAI | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| namespace UniqueGames.Foundations.Repetition | |
| open scoped BigOperators | |
| open Games Information | |
| noncomputable section | |
| theorem pushforward_snd_weight_eq_secondMarginal {A B : Type*} | |
| [Fintype A] [Fintype B] (ΞΌ : FiniteDistribution (A Γ B)) : | |
| (ΞΌ.pushforward Prod.snd).weight = secondMarginal ΞΌ.weight := by | |
| classical | |
| funext b | |
| simp [FiniteDistribution.pushforward, secondMarginal, Fintype.sum_prod_type] | |
| variable {I T X Y : Type*} [Fintype I] [DecidableEq I] [Fintype T] | |
| [Fintype X] [Fintype Y] [DecidableEq X] [DecidableEq Y] | |
| def revealDataSplitEquiv (j : I) : | |
| (T Γ (I β X β Y)) β ((T Γ ({i : I // i β j} β X β Y)) Γ (X β Y)) where | |
| toFun z := ((z.1, fun i => z.2 i.1), z.2 j) | |
| invFun z := (z.1.1, mergeAt j z.2 z.1.2) | |
| left_inv z := by | |
| apply Prod.ext | |
| Β· rfl | |
| Β· funext i | |
| by_cases h : i = j <;> simp [mergeAt, h] | |
| right_inv z := by | |
| apply Prod.ext | |
| Β· apply Prod.ext | |
| Β· rfl | |
| Β· funext i | |
| exact mergeAt_other j z.2 z.1.2 i | |
| Β· exact mergeAt_self j z.2 z.1.2 | |
| theorem partialRevealMarginal_secondMarginal | |
| (ΞΌ : FiniteDistribution (X Γ Y)) (j : I) | |
| (likelihood : T β (I β X Γ Y) β β) : | |
| secondMarginal (partialRevealMarginal ΞΌ j likelihood) = | |
| secondMarginal (fullRevealMarginal ΞΌ j likelihood) := by | |
| classical | |
| funext q | |
| calc | |
| _ = β z : (T Γ ({i : I // i β j} β X β Y)) Γ (X β Y), | |
| maskedJoint (partialRevealMarginal ΞΌ j likelihood) (z,q) := by | |
| simp [secondMarginal, Fintype.sum_prod_type, maskedJoint] | |
| _ = _ := by | |
| apply Fintype.sum_equiv (revealDataSplitEquiv (T := T) j).symm | |
| intro z | |
| exact (fullRevealMarginal_merge ΞΌ j likelihood z.1.1 z.1.2 z.2 q).symm | |
| variable {Qβ Qβ Aβ Aβ : Type*} | |
| [Fintype Qβ] [Fintype Qβ] [Fintype Aβ] [Fintype Aβ] | |
| [DecidableEq Qβ] [DecidableEq Qβ] {n : Nat} | |
| def selectedObservationDataEquiv (selected : Finset (Fin n)) : | |
| (SelectedInput Qβ Qβ selected Γ SelectedLabels (Aβ := Aβ) (Aβ := Aβ) selected) β | |
| (((selected β Qβ Γ Qβ) Γ SelectedLabels (Aβ := Aβ) (Aβ := Aβ) selected) Γ | |
| ({i : Fin n // i β selected} β Qβ β Qβ)) where | |
| toFun z := ((z.1.1,z.2),z.1.2) | |
| invFun z := ((z.1.1,z.2),z.1.2) | |
| left_inv _ := rfl | |
| right_inv _ := rfl | |
| theorem selectedFullReveal_secondMarginal (G : Game Qβ Qβ Aβ Aβ) | |
| (strategy : Strategy (Fin n β Qβ) (Fin n β Qβ) (Fin n β Aβ) (Fin n β Aβ)) | |
| (selected : Finset (Fin n)) (j : {i : Fin n // i β selected}) : | |
| secondMarginal (fullRevealMarginal G.questions j | |
| (selectedOutsideLikelihood G strategy selected)) = | |
| secondMarginal (selectedRawMarginal G strategy selected j) := by | |
| classical | |
| funext q | |
| apply Fintype.sum_equiv | |
| (selectedObservationDataEquiv (Qβ := Qβ) (Qβ := Qβ) | |
| (Aβ := Aβ) (Aβ := Aβ) selected).symm | |
| intro z | |
| exact (selectedRawMarginal_fullReveal G strategy selected j (z,q)).symm | |
| theorem selectedRawMarginal_secondMarginal (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}) : | |
| secondMarginal (selectedRawMarginal G strategy selected j) = | |
| (selectedQuestionMarginal G strategy selected positive j.1).weight := by | |
| classical | |
| funext q | |
| calc | |
| _ = (selectedJointLaw G strategy selected positive).probability | |
| (fun z => decide (z.2 j = q)) := by | |
| simp only [secondMarginal, selectedRawMarginal, FiniteDistribution.probability, | |
| selectedJointLaw, toGameLaw, Fintype.sum_prod_type, decide_eq_true_eq] | |
| _ = ((G.repetition n).questions.condition (G.selectedWins strategy selected) positive).probability | |
| (fun questions => decide ((questions.1 j.1,questions.2 j.1) = q)) := by | |
| have h := selectedJointLaw_question_probability G strategy selected positive | |
| (fun questions => decide ((questions.1 j.1,questions.2 j.1) = q)) | |
| simpa [selectedQuestionTuple, mergeCoordinates, j.property] using h | |
| _ = _ := by | |
| rw [FiniteDistribution.weight_eq_probability_singleton, selectedQuestionMarginal, | |
| FiniteDistribution.probability_pushforward] | |
| theorem selectedCommonLaw_secondMarginal (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}) : | |
| secondMarginal (selectedCommonLaw G strategy selected positive j).weight = | |
| (selectedQuestionMarginal G strategy selected positive j.1).weight := by | |
| change secondMarginal (partialRevealMarginal G.questions j | |
| (selectedOutsideLikelihood G strategy selected)) = _ | |
| rw [partialRevealMarginal_secondMarginal, selectedFullReveal_secondMarginal] | |
| exact selectedRawMarginal_secondMarginal G strategy selected positive j | |
| theorem selectedCommonLaw_questions_pushforward (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}) : | |
| (selectedCommonLaw G strategy selected positive j).pushforward Prod.snd = | |
| selectedQuestionMarginal G strategy selected positive j.1 := by | |
| classical | |
| apply FiniteDistribution.eq_of_weight_eq | |
| intro q | |
| exact (congrFun (pushforward_snd_weight_eq_secondMarginal | |
| (selectedCommonLaw G strategy selected positive j)) q).trans | |
| (congrFun (selectedCommonLaw_secondMarginal G strategy selected positive j) q) | |
| end | |
| end UniqueGames.Foundations.Repetition | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end OAI | |