Buckets:
| import Mathlib | |
| import OAI.Computability.MinUncut.PCP.SelectedInformation | |
| namespace OAI | |
| namespace MinUncutGames.Foundations.Repetition | |
| open scoped BigOperators | |
| open Games Information | |
| noncomputable section | |
| variable {Q₁ Q₂ A₁ A₂ : Type*} | |
| [Fintype Q₁] [Fintype Q₂] [Fintype A₁] [Fintype A₂] | |
| [DecidableEq Q₁] [DecidableEq Q₂] {n : Nat} | |
| def selectedRawMarginal (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}) : | |
| (SelectedInput Q₁ Q₂ selected × SelectedLabels (A₁ := A₁) (A₂ := A₂) selected) × | |
| (Q₁ × Q₂) → ℝ := by | |
| classical | |
| exact fun z => ∑ u, if u j = z.2 then selectedJointWeight G strategy selected (z.1,u) else 0 | |
| theorem selectedPosterior_eq_raw (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}) (tv) (q) : | |
| selectedSideWeight G strategy selected tv * coordinateMarginal | |
| (posteriorOrOriginal | |
| (independentProduct (fun i => (selectedInputProfile G selected tv.1 i).weight)) | |
| (selectedLikelihood G strategy selected tv.1.1 tv.2) | |
| (selectedSideMass G strategy selected tv)) j q = | |
| selectedRawMarginal G strategy selected j (tv,q) := by | |
| classical | |
| rw [selectedSideWeight] | |
| have h := weighted_coordinate_posterior_recombine | |
| (independentProduct (fun i => (selectedInputProfile G selected tv.1 i).weight)) | |
| (selectedLikelihood G strategy selected tv.1.1 tv.2) | |
| (independentProduct_isProbability _ | |
| (fun i => gameLaw_isProbability (selectedInputProfile G selected tv.1 i))) | |
| (selectedLikelihood_nonnegative G strategy selected tv.1.1 tv.2) | |
| (c := selectedSideMass G strategy selected tv) rfl | |
| ((selectedInputLaw G selected).weight tv.1) (G.selectedSuccess strategy selected) j q | |
| rw [h] | |
| simp only [Finset.mul_sum, selectedRawMarginal, selectedJointWeight] | |
| apply Finset.sum_congr rfl | |
| intro u _ | |
| by_cases hu : u j = q | |
| · simp only [ite_eq_left hu] | |
| ring | |
| · simp [hu] | |
| theorem selectedRawMarginal_firstMarginal (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}) (tv) : | |
| firstMarginal (selectedRawMarginal G strategy selected j) tv = | |
| selectedSideWeight G strategy selected tv := by | |
| classical | |
| simp only [firstMarginal, selectedRawMarginal] | |
| rw [Finset.sum_comm] | |
| simp only [Finset.sum_ite_eq, Finset.mem_univ, ite_true] | |
| exact selectedJointWeight_firstMarginal G strategy selected tv | |
| theorem selectedRawMarginal_isProbability (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}) : | |
| IsProbability (selectedRawMarginal G strategy selected j) := by | |
| classical | |
| constructor | |
| · intro z | |
| apply Finset.sum_nonneg | |
| intro u _ | |
| split | |
| · exact selectedJointWeight_nonnegative G strategy selected (z.1,u) | |
| · exact le_rfl | |
| · rw [Fintype.sum_prod_type] | |
| change (∑ tv, firstMarginal (selectedRawMarginal G strategy selected j) tv) = 1 | |
| simp_rw [selectedRawMarginal_firstMarginal, selectedSideWeight, div_eq_mul_inv] | |
| rw [← Finset.sum_mul, selectedSideMass_total, mul_inv_cancel₀ positive.ne'] | |
| theorem selected_raw_information_bound [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) : | |
| (∑ j : {i : Fin n // i ∉ selected}, totalVariation | |
| (selectedRawMarginal G strategy selected j) | |
| (fun z => selectedSideWeight G strategy selected z.1 * | |
| (selectedInputProfile G selected z.1.1 j).weight z.2)) ≤ | |
| Real.sqrt ((Fintype.card {i : Fin n // i ∉ selected} : ℝ) * | |
| (Real.log (Fintype.card (SelectedLabels (A₁ := A₁) (A₂ := A₂) selected) : ℝ) + | |
| Real.log (1 / G.selectedSuccess strategy selected))) := by | |
| have h := selected_information_bound G strategy selected positive | |
| simp_rw [selectedPosterior_eq_raw] at h | |
| exact h | |
| def selectedOutsideLikelihood (G : Game Q₁ Q₂ A₁ A₂) | |
| (strategy : Strategy (Fin n → Q₁) (Fin n → Q₂) (Fin n → A₁) (Fin n → A₂)) | |
| (selected : Finset (Fin n)) | |
| (t : (selected → Q₁ × Q₂) × SelectedLabels (A₁ := A₁) (A₂ := A₂) selected) | |
| (u : {i : Fin n // i ∉ selected} → Q₁ × Q₂) : ℝ := | |
| (∏ i : selected, G.questions.weight (t.1 i)) * | |
| selectedLikelihood G strategy selected t.1 t.2 u / G.selectedSuccess strategy selected | |
| def selectedObservationEquiv (selected : Finset (Fin n)) : | |
| ((SelectedInput Q₁ Q₂ selected × SelectedLabels (A₁ := A₁) (A₂ := A₂) selected) × | |
| (Q₁ × Q₂)) ≃ | |
| ((((selected → Q₁ × Q₂) × SelectedLabels (A₁ := A₁) (A₂ := A₂) selected) × | |
| ({i : Fin n // i ∉ selected} → Q₁ ⊕ Q₂)) × (Q₁ × Q₂)) where | |
| toFun z := (((z.1.1.1,z.1.2),z.1.1.2),z.2) | |
| invFun z := (((z.1.1.1,z.1.2),z.1.1.2),z.2) | |
| left_inv _ := rfl | |
| right_inv _ := rfl | |
| theorem selectedRawMarginal_fullReveal (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}) (z) : | |
| selectedRawMarginal G strategy selected j | |
| ((selectedObservationEquiv (Q₁ := Q₁) (Q₂ := Q₂) (A₁ := A₁) (A₂ := A₂) selected).symm z) = | |
| fullRevealMarginal G.questions j (selectedOutsideLikelihood G strategy selected) z := by | |
| classical | |
| change selectedRawMarginal G strategy selected j | |
| (((z.1.1.1,z.1.2),z.1.1.2),z.2) = _ | |
| simp only [selectedRawMarginal, fullRevealMarginal] | |
| apply Finset.sum_congr rfl | |
| intro u _ | |
| by_cases hu : u j = z.2 | |
| · simp only [ite_eq_left hu, selectedJointWeight_factorization, selectedOutsideLikelihood] | |
| ring | |
| · simp [hu] | |
| theorem selectedRawReference_fullReveal (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}) (z) : | |
| (fun w => selectedSideWeight G strategy selected w.1 * | |
| (selectedInputProfile G selected w.1.1 j).weight w.2) | |
| ((selectedObservationEquiv (Q₁ := Q₁) (Q₂ := Q₂) (A₁ := A₁) (A₂ := A₂) selected).symm z) = | |
| fullRevealModel G.questions j (selectedOutsideLikelihood G strategy selected) z := by | |
| change selectedSideWeight G strategy selected ((z.1.1.1,z.1.2),z.1.1.2) * | |
| (revealProfile G.questions (z.1.2 j)).weight z.2 = _ | |
| rw [← selectedRawMarginal_firstMarginal G strategy selected j] | |
| unfold firstMarginal fullRevealModel | |
| congr 1 | |
| apply Finset.sum_congr rfl | |
| intro q _ | |
| exact selectedRawMarginal_fullReveal G strategy selected j (z.1,q) | |
| theorem selected_raw_error_eq_fullReveal (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}) : | |
| totalVariation (selectedRawMarginal G strategy selected j) | |
| (fun z => selectedSideWeight G strategy selected z.1 * | |
| (selectedInputProfile G selected z.1.1 j).weight z.2) = | |
| totalVariation (fullRevealMarginal G.questions j (selectedOutsideLikelihood G strategy selected)) | |
| (fullRevealModel G.questions j (selectedOutsideLikelihood G strategy selected)) := by | |
| rw [← totalVariation_comp_equiv | |
| (selectedObservationEquiv (Q₁ := Q₁) (Q₂ := Q₂) (A₁ := A₁) (A₂ := A₂) selected).symm] | |
| congr 1 <;> funext z | |
| · exact selectedRawMarginal_fullReveal G strategy selected j z | |
| · exact selectedRawReference_fullReveal G strategy selected j z | |
| theorem selected_fullReveal_information_bound [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) : | |
| (∑ j : {i : Fin n // i ∉ selected}, | |
| totalVariation (fullRevealMarginal G.questions j (selectedOutsideLikelihood G strategy selected)) | |
| (fullRevealModel G.questions j (selectedOutsideLikelihood G strategy selected))) ≤ | |
| Real.sqrt ((Fintype.card {i : Fin n // i ∉ selected} : ℝ) * | |
| (Real.log (Fintype.card (SelectedLabels (A₁ := A₁) (A₂ := A₂) selected) : ℝ) + | |
| Real.log (1 / G.selectedSuccess strategy selected))) := by | |
| have h := selected_raw_information_bound G strategy selected positive | |
| simp_rw [selected_raw_error_eq_fullReveal] at h | |
| exact h | |
| def selectedInformationRadius (G : Game Q₁ Q₂ A₁ A₂) | |
| (strategy : Strategy (Fin n → Q₁) (Fin n → Q₂) (Fin n → A₁) (Fin n → A₂)) | |
| (selected : Finset (Fin n)) : ℝ := | |
| Real.sqrt ((Fintype.card {i : Fin n // i ∉ selected} : ℝ) * | |
| (Real.log (Fintype.card (SelectedLabels (A₁ := A₁) (A₂ := A₂) selected) : ℝ) + | |
| Real.log (1 / G.selectedSuccess strategy selected))) | |
| theorem selected_leftReveal_error_sum [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) : | |
| (∑ j : {i : Fin n // i ∉ selected}, | |
| totalVariation (partialRevealMarginal G.questions j (selectedOutsideLikelihood G strategy selected)) | |
| (leftRevealModel G.questions | |
| (partialRevealMarginal G.questions j (selectedOutsideLikelihood G strategy selected)))) ≤ | |
| 2 * selectedInformationRadius G strategy selected := by | |
| calc | |
| _ ≤ ∑ j : {i : Fin n // i ∉ selected}, | |
| 2 * totalVariation (fullRevealMarginal G.questions j (selectedOutsideLikelihood G strategy selected)) | |
| (fullRevealModel G.questions j (selectedOutsideLikelihood G strategy selected)) := by | |
| apply Finset.sum_le_sum | |
| intro j _ | |
| exact leftReveal_full_error G.questions j _ | |
| _ = 2 * ∑ j : {i : Fin n // i ∉ selected}, | |
| totalVariation (fullRevealMarginal G.questions j (selectedOutsideLikelihood G strategy selected)) | |
| (fullRevealModel G.questions j (selectedOutsideLikelihood G strategy selected)) := | |
| (Finset.mul_sum _ _ _).symm | |
| _ ≤ _ := mul_le_mul_of_nonneg_left | |
| (selected_fullReveal_information_bound G strategy selected positive) (by norm_num) | |
| theorem selected_rightReveal_error_sum [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) : | |
| (∑ j : {i : Fin n // i ∉ selected}, | |
| totalVariation (partialRevealMarginal G.questions j (selectedOutsideLikelihood G strategy selected)) | |
| (rightRevealModel G.questions | |
| (partialRevealMarginal G.questions j (selectedOutsideLikelihood G strategy selected)))) ≤ | |
| 2 * selectedInformationRadius G strategy selected := by | |
| calc | |
| _ ≤ ∑ j : {i : Fin n // i ∉ selected}, | |
| 2 * totalVariation (fullRevealMarginal G.questions j (selectedOutsideLikelihood G strategy selected)) | |
| (fullRevealModel G.questions j (selectedOutsideLikelihood G strategy selected)) := by | |
| apply Finset.sum_le_sum | |
| intro j _ | |
| exact rightReveal_full_error G.questions j _ | |
| _ = 2 * ∑ j : {i : Fin n // i ∉ selected}, | |
| totalVariation (fullRevealMarginal G.questions j (selectedOutsideLikelihood G strategy selected)) | |
| (fullRevealModel G.questions j (selectedOutsideLikelihood G strategy selected)) := | |
| (Finset.mul_sum _ _ _).symm | |
| _ ≤ _ := mul_le_mul_of_nonneg_left | |
| (selected_fullReveal_information_bound G strategy selected positive) (by norm_num) | |
| omit [DecidableEq Q₁] [DecidableEq Q₂] in | |
| theorem selectedSplit_question_probability (G : Game Q₁ Q₂ A₁ A₂) | |
| (selected : Finset (Fin n)) | |
| (event : ((Fin n → Q₁) × (Fin n → Q₂)) → Bool) : | |
| (selectedSplitLaw G selected).probability | |
| (fun q => event (selectedQuestionTuple selected q.1 q.2)) = | |
| (G.repetition n).questions.probability event := by | |
| rw [selectedSplitLaw, ← iid_coordinate_split, FiniteDistribution.probability_transport] | |
| change (G.questions.iid n).probability _ = | |
| ((G.questions.iid n).transport (Game.tupleQuestionEquiv n)).probability event | |
| rw [FiniteDistribution.probability_transport] | |
| apply congrArg (G.questions.iid n).probability | |
| funext q | |
| congr 1 | |
| apply Prod.ext <;> funext i <;> | |
| simp [selectedQuestionTuple, coordinateSplitEquiv, mergeCoordinates, Game.tupleQuestionEquiv] | |
| theorem selectedJoint_eventMass (G : Game Q₁ Q₂ A₁ A₂) | |
| (strategy : Strategy (Fin n → Q₁) (Fin n → Q₂) (Fin n → A₁) (Fin n → A₂)) | |
| (selected : Finset (Fin n)) | |
| (event : ((Fin n → Q₁) × (Fin n → Q₂)) → Bool) : | |
| (∑ tv : SelectedInput Q₁ Q₂ selected × | |
| SelectedLabels (A₁ := A₁) (A₂ := A₂) selected, | |
| (selectedInputLaw G selected).weight tv.1 * | |
| ∑ u, independentProduct | |
| (fun i => (selectedInputProfile G selected tv.1 i).weight) u * | |
| selectedLikelihood G strategy selected tv.1.1 tv.2 u * | |
| (if event (selectedQuestionTuple selected tv.1.1 u) then 1 else 0)) = | |
| (G.repetition n).questions.probability | |
| (fun q => G.selectedWins strategy selected q && event q) := by | |
| classical | |
| have hlabel (t : SelectedInput Q₁ Q₂ selected) : | |
| (∑ v, ∑ u, independentProduct | |
| (fun i => (selectedInputProfile G selected t i).weight) u * | |
| selectedLikelihood G strategy selected t.1 v u * | |
| (if event (selectedQuestionTuple selected t.1 u) then 1 else 0)) = | |
| ∑ u, independentProduct | |
| (fun i => (selectedInputProfile G selected t i).weight) u * | |
| (if G.selectedWins strategy selected (selectedQuestionTuple selected t.1 u) && | |
| event (selectedQuestionTuple selected t.1 u) then 1 else 0) := by | |
| rw [Finset.sum_comm] | |
| apply Finset.sum_congr rfl | |
| intro u _ | |
| rw [← Finset.sum_mul, ← Finset.mul_sum, selectedLikelihood_sum] | |
| cases G.selectedWins strategy selected (selectedQuestionTuple selected t.1 u) <;> | |
| cases event (selectedQuestionTuple selected t.1 u) <;> simp | |
| rw [Fintype.sum_prod_type] | |
| simp_rw [← Finset.mul_sum, hlabel] | |
| rw [Fintype.sum_prod_type] | |
| simp only [selectedInputLaw, FiniteDistribution.product, FiniteDistribution.table, | |
| selectedInputProfile, independentProduct] | |
| simp_rw [mul_assoc, ← Finset.mul_sum] | |
| have hforget (fixed : selected → Q₁ × Q₂) := | |
| reveal_product_expectation G.questions | |
| (fun u : {i : Fin n // i ∉ selected} → Q₁ × Q₂ => | |
| if G.selectedWins strategy selected (selectedQuestionTuple selected fixed u) && | |
| event (selectedQuestionTuple selected fixed u) then (1 : ℝ) else 0) | |
| simp_rw [hforget] | |
| have h := selectedSplit_question_probability G selected | |
| (fun q => G.selectedWins strategy selected q && event q) | |
| simpa [selectedSplitLaw, FiniteDistribution.probability, FiniteDistribution.product, | |
| FiniteDistribution.table, Fintype.sum_prod_type, Finset.mul_sum, mul_ite, mul_assoc] using h | |
| theorem selectedJointLaw_question_probability (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) | |
| (event : ((Fin n → Q₁) × (Fin n → Q₂)) → Bool) : | |
| (selectedJointLaw G strategy selected positive).probability | |
| (fun z => event (selectedQuestionTuple selected z.1.1.1 z.2)) = | |
| ((G.repetition n).questions.condition (G.selectedWins strategy selected) positive).probability | |
| event := by | |
| classical | |
| erw [FiniteDistribution.probability_condition] | |
| change | |
| (∑ z : (SelectedInput Q₁ Q₂ selected × | |
| SelectedLabels (A₁ := A₁) (A₂ := A₂) selected) × | |
| ({i : Fin n // i ∉ selected} → Q₁ × Q₂), | |
| if event (selectedQuestionTuple selected z.1.1.1 z.2) | |
| then selectedJointWeight G strategy selected z else 0) = | |
| (G.repetition n).questions.probability | |
| (fun q => G.selectedWins strategy selected q && event q) / | |
| G.selectedSuccess strategy selected | |
| calc | |
| _ = (∑ tv : SelectedInput Q₁ Q₂ selected × | |
| SelectedLabels (A₁ := A₁) (A₂ := A₂) selected, | |
| (selectedInputLaw G selected).weight tv.1 * | |
| ∑ u, independentProduct | |
| (fun i => (selectedInputProfile G selected tv.1 i).weight) u * | |
| selectedLikelihood G strategy selected tv.1.1 tv.2 u * | |
| (if event (selectedQuestionTuple selected tv.1.1 u) then 1 else 0)) / | |
| G.selectedSuccess strategy selected := by | |
| conv_lhs => rw [Fintype.sum_prod_type] | |
| simp only [div_eq_mul_inv, Finset.sum_mul, Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro tv _ | |
| apply Finset.sum_congr rfl | |
| intro u _ | |
| cases event (selectedQuestionTuple selected tv.1.1 u) <;> | |
| simp [selectedJointWeight, div_eq_mul_inv, mul_assoc] | |
| _ = _ := by rw [selectedJoint_eventMass] | |
| theorem selectedJointLaw_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) : | |
| (selectedJointLaw G strategy selected positive).pushforward | |
| (fun z => selectedQuestionTuple selected z.1.1.1 z.2) = | |
| (G.repetition n).questions.condition (G.selectedWins strategy selected) positive := by | |
| classical | |
| apply FiniteDistribution.eq_of_weight_eq | |
| intro questions | |
| have h : | |
| ((selectedJointLaw G strategy selected positive).pushforward | |
| (fun z => selectedQuestionTuple selected z.1.1.1 z.2)).probability | |
| (fun q => decide (q = questions)) = | |
| ((G.repetition n).questions.condition (G.selectedWins strategy selected) positive).probability | |
| (fun q => decide (q = questions)) := by | |
| rw [FiniteDistribution.probability_pushforward] | |
| exact selectedJointLaw_question_probability G strategy selected positive | |
| (fun q => decide (q = questions)) | |
| simpa [FiniteDistribution.probability] using h | |
| def selectedTupleLikelihood (G : Game Q₁ Q₂ A₁ A₂) | |
| (strategy : Strategy (Fin n → Q₁) (Fin n → Q₂) (Fin n → A₁) (Fin n → A₂)) | |
| (selected : Finset (Fin n)) (questions : Fin n → Q₁ × Q₂) : ℝ := | |
| if G.selectedWins strategy selected (Game.tupleQuestionEquiv n questions) then 1 else 0 | |
| omit [DecidableEq Q₁] [DecidableEq Q₂] in | |
| theorem selectedTupleLikelihood_nonnegative (G : Game Q₁ Q₂ A₁ A₂) | |
| (strategy : Strategy (Fin n → Q₁) (Fin n → Q₂) (Fin n → A₁) (Fin n → A₂)) | |
| (selected : Finset (Fin n)) (questions : Fin n → Q₁ × Q₂) : | |
| 0 ≤ selectedTupleLikelihood G strategy selected questions := by | |
| unfold selectedTupleLikelihood | |
| split <;> norm_num | |
| omit [DecidableEq Q₁] [DecidableEq Q₂] in | |
| theorem selectedTupleLikelihood_le_one (G : Game Q₁ Q₂ A₁ A₂) | |
| (strategy : Strategy (Fin n → Q₁) (Fin n → Q₂) (Fin n → A₁) (Fin n → A₂)) | |
| (selected : Finset (Fin n)) (questions : Fin n → Q₁ × Q₂) : | |
| selectedTupleLikelihood G strategy selected questions ≤ 1 := by | |
| unfold selectedTupleLikelihood | |
| split <;> norm_num | |
| omit [DecidableEq Q₁] [DecidableEq Q₂] in | |
| theorem selectedTupleLikelihood_mass (G : Game Q₁ Q₂ A₁ A₂) | |
| (strategy : Strategy (Fin n → Q₁) (Fin n → Q₂) (Fin n → A₁) (Fin n → A₂)) | |
| (selected : Finset (Fin n)) : | |
| (∑ questions, independentProduct (fun _ : Fin n => G.questions.weight) questions * | |
| selectedTupleLikelihood G strategy selected questions) = | |
| G.selectedSuccess strategy selected := by | |
| classical | |
| change _ = ((G.questions.iid n).transport (Game.tupleQuestionEquiv n)).probability | |
| (G.selectedWins strategy selected) | |
| rw [FiniteDistribution.probability_transport] | |
| simp only [FiniteDistribution.probability, FiniteDistribution.iid, independentProduct, | |
| selectedTupleLikelihood, mul_ite, mul_one, mul_zero] | |
| def selectedQuestionMarginal (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) | |
| (i : Fin n) : FiniteDistribution (Q₁ × Q₂) := | |
| ((G.repetition n).questions.condition (G.selectedWins strategy selected) positive).pushforward | |
| (fun questions => (questions.1 i, questions.2 i)) | |
| theorem selectedQuestionMarginal_weight (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) | |
| (i : Fin n) : | |
| (selectedQuestionMarginal G strategy selected positive i).weight = | |
| coordinateMarginal | |
| (posterior (independentProduct (fun _ : Fin n => G.questions.weight)) | |
| (selectedTupleLikelihood G strategy selected) (G.selectedSuccess strategy selected)) i := by | |
| classical | |
| funext a | |
| simp only [selectedQuestionMarginal, FiniteDistribution.pushforward, | |
| FiniteDistribution.condition, coordinateMarginal] | |
| refine Fintype.sum_equiv (Game.tupleQuestionEquiv (Q₁ := Q₁) (Q₂ := Q₂) n).symm _ _ ?_ | |
| intro questions | |
| cases he : G.selectedWins strategy selected questions <;> | |
| simp [Game.repetition_question_weight, Game.tupleQuestionEquiv, | |
| posterior, independentProduct, selectedTupleLikelihood, Game.selectedSuccess, he] | |
| theorem selectedQuestionMarginal_totalVariation_sq_sum_le_log | |
| (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) : | |
| (∑ i : Fin n, | |
| (selectedQuestionMarginal G strategy selected positive i).totalVariation G.questions ^ 2) ≤ | |
| Real.log (1 / G.selectedSuccess strategy selected) := by | |
| classical | |
| change (∑ i : Fin n, Information.totalVariation | |
| (selectedQuestionMarginal G strategy selected positive i).weight G.questions.weight ^ 2) ≤ _ | |
| simp_rw [selectedQuestionMarginal_weight] | |
| exact posterior_coordinate_totalVariation_sq_sum_le_log | |
| (fun _ : Fin n => G.questions.weight) (fun _ => gameLaw_isProbability G.questions) | |
| (selectedTupleLikelihood G strategy selected) | |
| (selectedTupleLikelihood_nonnegative G strategy selected) | |
| (selectedTupleLikelihood_le_one G strategy selected) | |
| positive (selectedTupleLikelihood_mass G strategy selected) | |
| theorem unselectedQuestionMarginal_totalVariation_sq_sum_le_log | |
| (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) : | |
| (∑ i : {i : Fin n // i ∉ selected}, | |
| (selectedQuestionMarginal G strategy selected positive i.1).totalVariation G.questions ^ 2) ≤ | |
| Real.log (1 / G.selectedSuccess strategy selected) := by | |
| classical | |
| let d : Fin n → ℝ := fun i => | |
| (selectedQuestionMarginal G strategy selected positive i).totalVariation G.questions | |
| have hfull := selectedQuestionMarginal_totalVariation_sq_sum_le_log G strategy selected positive | |
| have hsplit := Fintype.sum_subtype_add_sum_subtype (fun i : Fin n => i ∈ selected) | |
| (fun i => d i ^ 2) | |
| have hinst : Subtype.fintype (fun i : Fin n => i ∈ selected) = | |
| Finset.Subtype.fintype selected := Subsingleton.elim _ _ | |
| rw [hinst] at hsplit | |
| have hselected : 0 ≤ ∑ i : {i : Fin n // i ∈ selected}, d i.1 ^ 2 := | |
| Finset.sum_nonneg (fun _ _ => sq_nonneg _) | |
| change (∑ i : {i : Fin n // i ∉ selected}, d i.1 ^ 2) ≤ _ | |
| change (∑ i : Fin n, d i ^ 2) ≤ _ at hfull | |
| linarith | |
| theorem unselectedQuestionMarginal_totalVariation_sum_le_sqrt | |
| (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) : | |
| (∑ i : {i : Fin n // i ∉ selected}, | |
| (selectedQuestionMarginal G strategy selected positive i.1).totalVariation G.questions) ≤ | |
| Real.sqrt ((Fintype.card {i : Fin n // i ∉ selected} : ℝ) * | |
| Real.log (1 / G.selectedSuccess strategy selected)) := by | |
| classical | |
| let d : {i : Fin n // i ∉ selected} → ℝ := fun i => | |
| (selectedQuestionMarginal G strategy selected positive i.1).totalVariation G.questions | |
| have hsq := unselectedQuestionMarginal_totalVariation_sq_sum_le_log G strategy selected positive | |
| have hcs := Finset.sum_mul_sq_le_sq_mul_sq | |
| (Finset.univ : Finset {i : Fin n // i ∉ selected}) d (fun _ => (1 : ℝ)) | |
| simp only [mul_one, one_pow, Finset.sum_const, Finset.card_univ, nsmul_eq_mul, mul_one] at hcs | |
| have hln : 0 ≤ Real.log (1 / G.selectedSuccess strategy selected) := | |
| (Finset.sum_nonneg (fun _ _ => sq_nonneg _)).trans hsq | |
| have hcard : 0 ≤ (Fintype.card {i : Fin n // i ∉ selected} : ℝ) := Nat.cast_nonneg _ | |
| have hmul := mul_le_mul_of_nonneg_left hsq hcard | |
| have hsqrt := Real.sq_sqrt (mul_nonneg hcard hln) | |
| have hsqrtpos := Real.sqrt_nonneg | |
| ((Fintype.card {i : Fin n // i ∉ selected} : ℝ) * | |
| Real.log (1 / G.selectedSuccess strategy selected)) | |
| change (∑ i, d i) ≤ _ | |
| change (∑ i, d i ^ 2) ≤ _ at hsq | |
| change (Fintype.card {i : Fin n // i ∉ selected} : ℝ) * (∑ i, d i ^ 2) ≤ _ at hmul | |
| nlinarith | |
| theorem unselectedQuestionMarginal_totalVariation_sum_le_sqrt_sub_card | |
| (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) : | |
| (∑ i : {i : Fin n // i ∉ selected}, | |
| (selectedQuestionMarginal G strategy selected positive i.1).totalVariation G.questions) ≤ | |
| Real.sqrt (((n - selected.card : Nat) : ℝ) * | |
| Real.log (1 / G.selectedSuccess strategy selected)) := by | |
| classical | |
| have hcard : Fintype.card {i : Fin n // i ∉ selected} = n - selected.card := by | |
| simp [Fintype.card_subtype_compl] | |
| simpa only [hcard] using | |
| unselectedQuestionMarginal_totalVariation_sum_le_sqrt G strategy selected positive | |
| end | |
| end MinUncutGames.Foundations.Repetition | |
| end OAI | |
Xet Storage Details
- Size:
- 27.1 kB
- Xet hash:
- 98839a36bafab8f1114d1fe7ea5c44ae2431f1b60fab6d76dab241e0a1fc6bdc
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.