Download data/lean/OAI/Probability/SATComputability/CandidateSurvival.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.51 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SATComputability/CandidateSurvival.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/SATComputability/CandidateSurvival.lean
-
curl -L -o CandidateSurvival.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SATComputability/CandidateSurvival.lean
6.51 kB
| import OAI.Probability.SATComputability.PoissonSemigroup | |
| import OAI.Probability.SATComputability.MarkovOccupation | |
| namespace OAI | |
| namespace FixedClauseThreshold.Computability | |
| open DilutedSpinGlass MeasureTheory ProbabilityTheory Filter | |
| open scoped BigOperators NNReal | |
| theorem candidateResidual_subset {n k d : β} (U : Finset (DeletionCandidate n)) | |
| (cs : Fin d β Fin k β SignedLiteral n) : candidateResidual U cs β U := by | |
| classical | |
| exact Finset.filter_subset _ _ | |
| theorem candidateResidual_mono {n k d : β} {U V : Finset (DeletionCandidate n)} | |
| (h : U β V) (cs : Fin d β Fin k β SignedLiteral n) : | |
| candidateResidual U cs β candidateResidual V cs := by | |
| classical | |
| exact Finset.filter_subset_filter _ h | |
| theorem candidateAlive_mono {n : β} : | |
| Monotone (candidateAlive (n := n)) := by | |
| intro U V h | |
| unfold candidateAlive | |
| split_ifs with hU hV | |
| Β· rfl | |
| Β· exact (hV (hU.mono h)).elim | |
| Β· norm_num | |
| Β· rfl | |
| theorem candidateBlock_expect_mono_state {n : β} [NeZero n] | |
| (r : ββ₯0) (k : β) {f : Finset (DeletionCandidate n) β β} | |
| (hf : Monotone f) : Monotone (fun U => (candidateBlock r k U).expect f) := by | |
| intro U V hUV | |
| simp only [candidateBlock, poissonMixture_expect] | |
| apply integral_mono (poissonMixture_integrable_expect r | |
| (fun d => candidateFixedBlock k d U) f) | |
| (poissonMixture_integrable_expect r (fun d => candidateFixedBlock k d V) f) | |
| intro d | |
| simp only [candidateFixedBlock_expect, candidateStep_iterate] | |
| exact FiniteLaw.expect_mono _ (fun cs => hf (candidateResidual_mono hUV cs)) | |
| theorem candidateBlock_expect_le_of_subset {n : β} [NeZero n] | |
| (r : ββ₯0) (k : β) (U : Finset (DeletionCandidate n)) | |
| (f g : Finset (DeletionCandidate n) β β) | |
| (h : β V β U, f V β€ g V) : | |
| (candidateBlock r k U).expect f β€ (candidateBlock r k U).expect g := by | |
| simp only [candidateBlock, poissonMixture_expect] | |
| apply integral_mono (poissonMixture_integrable_expect r _ f) | |
| (poissonMixture_integrable_expect r _ g) | |
| intro d | |
| simp only [candidateFixedBlock_expect, candidateStep_iterate] | |
| exact FiniteLaw.expect_mono _ (fun cs => h _ (candidateResidual_subset U cs)) | |
| theorem candidateBlock_expect_alive {n : β} [NeZero n] | |
| (r : ββ₯0) (k : β) (U : Finset (DeletionCandidate n)) : | |
| (candidateBlock r k U).expect candidateAlive = 1 - poissonKillProbability U k r := by | |
| have he : candidateAlive (n := n) = fun V => 1 - (if V = β then 1 else 0) := by | |
| classical | |
| funext V | |
| by_cases h : V = β <;> simp [candidateAlive, h, Finset.nonempty_iff_ne_empty] | |
| rw [he, FiniteLaw.expect_sub, FiniteLaw.expect_const, candidateBlock_kill] | |
| theorem candidateBlock_empty {n : β} [NeZero n] | |
| (r : ββ₯0) (k : β) (f : Finset (DeletionCandidate n) β β) : | |
| (candidateBlock r k β ).expect f = f β := by | |
| simp only [candidateBlock_expect, candidateStep_iterate, candidateResidual, | |
| Finset.filter_empty, FiniteLaw.expect_const, integral_const, probReal_univ, one_smul] | |
| theorem candidateBlock_survival_le {n : β} [NeZero n] | |
| (r : ββ₯0) (k : β) (U : Finset (DeletionCandidate n)) : | |
| (candidateBlock r k U).expect candidateAlive β€ candidateAlive U := by | |
| apply (candidateBlock_expect_le_of_subset r k U candidateAlive | |
| (fun _ => candidateAlive U) (fun _ h => candidateAlive_mono h)).trans_eq | |
| exact FiniteLaw.expect_const _ _ | |
| theorem candidateBlock_survival_submultiplicative {n : β} [NeZero n] | |
| (r s : ββ₯0) (k : β) (U : Finset (DeletionCandidate n)) : | |
| (candidateBlock (r+s) k U).expect candidateAlive β€ | |
| (candidateBlock r k U).expect candidateAlive * | |
| (candidateBlock s k U).expect candidateAlive := by | |
| rw [candidateBlock_comp] | |
| calc | |
| _ β€ (candidateBlock r k U).expect (fun V => | |
| candidateAlive V * (candidateBlock s k U).expect candidateAlive) := by | |
| apply candidateBlock_expect_le_of_subset | |
| intro V hV | |
| by_cases h : V.Nonempty | |
| Β· simpa only [candidateAlive, ite_eq_left h, one_mul] using | |
| candidateBlock_expect_mono_state s k candidateAlive_mono hV | |
| Β· have he : V = β := Finset.not_nonempty_iff_eq_empty.mp h | |
| subst V | |
| simp [candidateBlock_empty, candidateAlive] | |
| _ = _ := FiniteLaw.expect_mul_right _ _ _ | |
| theorem candidateBlock_survival_geometric {n : β} [NeZero n] | |
| (r : ββ₯0) (k : β) (U : Finset (DeletionCandidate n)) | |
| {Ξ΄ : β} (hΞ΄ : Ξ΄ β€ poissonKillProbability U k r) (m : β) : | |
| (candidateBlock (r*m) k U).expect candidateAlive β€ (1-Ξ΄)^m := by | |
| have hs := FiniteLaw.expect_nonneg (candidateBlock r k U) candidateAlive_nonneg | |
| have hb : (candidateBlock r k U).expect candidateAlive β€ 1-Ξ΄ := by | |
| rw [candidateBlock_expect_alive] | |
| linarith | |
| have hd : 0 β€ 1-Ξ΄ := hs.trans hb | |
| induction m with | |
| | zero => simp [candidateBlock_expect, integral_poissonMeasure, zero_pow_eq, ite_div, ite_mul, | |
| candidateAlive_le_one] | |
| | succ m ih => | |
| have he : r * ((m+1 : β) : ββ₯0) = r*m+r := by push_cast; ring | |
| rw [he, pow_succ] | |
| exact (candidateBlock_survival_submultiplicative (r*m) r k U).trans | |
| (mul_le_mul ih hb hs (pow_nonneg hd m)) | |
| theorem candidateBlock_occupation {n : β} [NeZero n] | |
| (r : ββ₯0) (k L M : β) (bin : Finset (DeletionCandidate n) β Prop) | |
| [DecidablePred bin] {Ξ΄ : β} (hΞ΄ : 0 < Ξ΄) | |
| (hbin : β U, bin U β U.Nonempty β§ Ξ΄ β€ poissonKillProbability U k (r*L)) | |
| (U : Finset (DeletionCandidate n)) : | |
| (β t β Finset.range M, | |
| (candidateBlock (r*t) k U).expect (fun V => if bin V then 1 else 0)) β€ | |
| (L : β)/Ξ΄ := by | |
| have hi (m : β) (f : Finset (DeletionCandidate n) β β) : | |
| (finiteKernelStep (candidateBlock r k))^[m] f U = | |
| (candidateBlock (r*m) k U).expect f := poissonCandidateStep_iterate r k m U f | |
| have h := finiteKernel_occupation (candidateBlock r k) candidateAlive | |
| (fun V => if bin V then 1 else 0) candidateAlive_nonneg candidateAlive_le_one hΞ΄ L | |
| (fun V => ?_) M U | |
| Β· simpa only [hi] using h | |
| Β· change Ξ΄ * (if bin V then 1 else 0) β€ candidateAlive V - | |
| (poissonCandidateStep r k)^[L] candidateAlive V | |
| rw [poissonCandidateStep_iterate] | |
| by_cases hb : bin V | |
| Β· obtain β¨hne, hkβ© := hbin V hb | |
| rw [ite_eq_left hb, mul_one, candidateAlive, ite_eq_left hne, | |
| candidateBlock_expect_alive] | |
| linarith | |
| Β· rw [ite_eq_right hb, mul_zero] | |
| exact sub_nonneg.mpr (candidateBlock_survival_le _ _ _) | |
| end FixedClauseThreshold.Computability | |
| end OAI | |