Download data/lean/OAI/Probability/SATComputability/IncidentMasks.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.55 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SATComputability/IncidentMasks.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/SATComputability/IncidentMasks.lean
-
curl -L -o IncidentMasks.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SATComputability/IncidentMasks.lean
5.55 kB
| import OAI.Probability.SATComputability.ObstructionMoment | |
| namespace OAI | |
| namespace FixedClauseThreshold.Computability | |
| open DilutedSpinGlass MeasureTheory ProbabilityTheory | |
| open scoped BigOperators Classical NNReal | |
| noncomputable def finiteMap {Ξ© Ξ : Type*} [Fintype Ξ©] [Fintype Ξ] | |
| [DecidableEq Ξ] (P : FiniteLaw Ξ©) (f : Ξ© β Ξ) : FiniteLaw Ξ where | |
| weight y := P.expect (fun x => if f x = y then 1 else 0) | |
| nonneg y := P.expect_nonneg (fun x => by split_ifs <;> norm_num) | |
| total := by | |
| rw [β FiniteLaw.expect_fintype_sum] | |
| simp | |
| theorem finiteMap_expect {Ξ© Ξ : Type*} [Fintype Ξ©] [Fintype Ξ] | |
| [DecidableEq Ξ] (P : FiniteLaw Ξ©) (f : Ξ© β Ξ) (g : Ξ β β) : | |
| (finiteMap P f).expect g = P.expect (fun x => g (f x)) := by | |
| simp only [FiniteLaw.expect, finiteMap, Finset.sum_mul, mul_ite, mul_one, mul_zero] | |
| rw [Finset.sum_comm] | |
| apply Finset.sum_congr rfl | |
| intro x _ | |
| simp | |
| noncomputable def unionMaskLaw {n : β} | |
| (P Q : FiniteLaw (Finset (DeletionCandidate n))) : FiniteLaw (Finset (DeletionCandidate n)) := | |
| finiteMap (P.bind (fun _ => Q)) (fun p => p.1 βͺ p.2) | |
| theorem unionMaskLaw_killing {n : β} | |
| (P Q : FiniteLaw (Finset (DeletionCandidate n))) (U : Finset (DeletionCandidate n)) : | |
| (unionMaskLaw P Q).expect (fun I => if U β© I = β then 1 else 0) = | |
| P.expect (fun I => if U β© I = β then 1 else 0) * | |
| Q.expect (fun I => if U β© I = β then 1 else 0) := by | |
| rw [unionMaskLaw, finiteMap_expect, FiniteLaw.expect_bind] | |
| have he (I J : Finset (DeletionCandidate n)) : | |
| (if U β© (I βͺ J) = β then (1 : β) else 0) = | |
| (if U β© I = β then 1 else 0) * (if U β© J = β then 1 else 0) := by | |
| simp only [Finset.inter_union_distrib_left, Finset.union_eq_empty] | |
| split_ifs <;> simp_all | |
| simp only [he, FiniteLaw.expect_mul_left, FiniteLaw.expect_mul_right] | |
| noncomputable def catastropheLaw (n : β) (Ο : ββ₯0) : FiniteLaw (Finset (DeletionCandidate n)) := | |
| poissonMixture Ο (fun d => finiteMap (FiniteLaw.uniform : FiniteLaw Unit) | |
| (fun _ => if d = 0 then Finset.univ else β )) | |
| theorem catastropheLaw_bound (n : β) (Ο : ββ₯0) : | |
| (catastropheLaw n Ο).expect (fun I => if I = Finset.univ then 0 else 1) β€ Ο := by | |
| rw [catastropheLaw, poissonMixture_expect] | |
| simp only [finiteMap_expect, FiniteLaw.expect_const] | |
| have hi : Integrable (fun d : β => | |
| if (if d = 0 then (Finset.univ : Finset (DeletionCandidate n)) else β ) = Finset.univ | |
| then (0 : β) else 1) (poissonMeasure Ο) := by | |
| apply Integrable.of_bound (measurable_of_countable _).aestronglyMeasurable 1 | |
| filter_upwards [] with d | |
| split_ifs <;> norm_num | |
| apply (integral_mono hi (poisson_integrable_count Ο) (fun d => ?_)).trans_eq (poisson_mean Ο) | |
| by_cases hd : d = 0 | |
| Β· simp [hd] | |
| Β· have hd' : (1 : β) β€ d := by exact_mod_cast (Nat.pos_of_ne_zero hd) | |
| split_ifs <;> linarith | |
| noncomputable def incidentSignLaw {n : β} [NeZero n] (Ο : ββ₯0) : | |
| FiniteLaw (Finset (DeletionCandidate n)) := | |
| finiteMap ((candidateBlock 60 2 Finset.univ).bind (fun _ => catastropheLaw n Ο)) | |
| (fun p => p.1 β© p.2) | |
| theorem incidentSignLaw_killing {n : β} [NeZero n] (Ο : ββ₯0) | |
| (U : Finset (DeletionCandidate n)) : | |
| (incidentSignLaw Ο).expect (fun I => if U β© I = β then 1 else 0) β€ | |
| poissonKillProbability U 2 60 + Ο := by | |
| rw [incidentSignLaw, finiteMap_expect, FiniteLaw.expect_bind] | |
| have hb (I J : Finset (DeletionCandidate n)) : | |
| (if U β© (I β© J) = β then (1 : β) else 0) β€ | |
| (if U β© I = β then 1 else 0) + (if J = Finset.univ then 0 else 1) := by | |
| by_cases hJ : J = Finset.univ | |
| Β· simp [hJ] | |
| Β· split_ifs <;> norm_num | |
| have h := (candidateBlock (n := n) 60 2 Finset.univ).expect_mono (fun I => | |
| (catastropheLaw n Ο).expect_mono (hb I)) | |
| simp only [FiniteLaw.expect_add, FiniteLaw.expect_const] at h | |
| have he : (candidateBlock 60 2 (Finset.univ : Finset (DeletionCandidate n))).expect | |
| (fun I => if U β© I = β then 1 else 0) = poissonKillProbability U 2 60 := by | |
| rw [candidateBlock_mask 60 2 U (fun V => if V = β then 1 else 0), candidateBlock_kill] | |
| rw [he] at h | |
| exact h.trans (add_le_add le_rfl (catastropheLaw_bound n Ο)) | |
| noncomputable def dominatingIncidentLaw {n : β} [NeZero n] (Ο : ββ₯0) : | |
| FiniteLaw (Finset (DeletionCandidate n)) := unionMaskLaw (incidentSignLaw Ο) (incidentSignLaw Ο) | |
| theorem dominatingIncidentLaw_killing {n : β} [NeZero n] (Ο : ββ₯0) | |
| (U : Finset (DeletionCandidate n)) : | |
| (dominatingIncidentLaw Ο).expect (fun I => if U.Nonempty β§ U β© I = β then 1 else 0) β€ | |
| (poissonKillProbability U 2 60 + Ο)^2 := by | |
| by_cases hU : U.Nonempty | |
| Β· simp only [hU, true_and, dominatingIncidentLaw, unionMaskLaw_killing] | |
| rw [β pow_two] | |
| exact pow_le_pow_leftβ (FiniteLaw.expect_nonneg _ (fun I => by split_ifs <;> norm_num)) | |
| (incidentSignLaw_killing Ο U) 2 | |
| Β· simp only [hU, false_and, ite_false, FiniteLaw.expect_const] | |
| exact sq_nonneg _ | |
| theorem dominatingIncidentLaw_delay {n : β} [NeZero n] | |
| (r : ββ₯0) (hr : (1 : β)/8 β€ r) (M : β) (Ο : ββ₯0) | |
| (U : Finset (DeletionCandidate n)) : | |
| (dominatingIncidentLaw Ο).expect (fun I => maskDelayMoment r 3 M U I) β€ | |
| (48/5 : β) * (β' j, dyadicMomentCoefficient j) + | |
| (12/5 : β)*(Ο : β)^2*(M : β)^(6/5 : β) := | |
| maskDelayMoment_of_obstruction r hr M (dominatingIncidentLaw Ο) Ο | |
| (dominatingIncidentLaw_killing Ο) U | |
| end FixedClauseThreshold.Computability | |
| end OAI | |