Download data/lean/OAI/Probability/MatroidProphet/Information.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.16 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/MatroidProphet/Information.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/MatroidProphet/Information.lean
-
curl -L -o Information.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/MatroidProphet/Information.lean
5.16 kB
| import OAI.Probability.MatroidProphet.Model | |
| namespace OAI | |
| open MeasureTheory | |
| open scoped BigOperators | |
| namespace MatroidProphet | |
| theorem decisionAt_congr {n bits : β} (A : OnlineRule n bits) (r : Seed bits) | |
| (s v v' : Weights n) (Ο Ο' : ArrivalOrder n) (k : Fin n) | |
| (h : history v Ο k = history v' Ο' k) : | |
| decisionAt A r s v Ο k = decisionAt A r s v' Ο' k := by | |
| simp only [decisionAt, h] | |
| theorem acceptedThrough_mono {n bits : β} (A : OnlineRule n bits) (r : Seed bits) | |
| (s v : Weights n) (Ο : ArrivalOrder n) {t t' : β} (h : t β€ t') : | |
| acceptedThrough A r s v Ο t β acceptedThrough A r s v Ο t' := by | |
| classical | |
| intro e he | |
| simp only [acceptedThrough, Finset.mem_filter, Finset.mem_univ, true_and] at he β’ | |
| exact β¨lt_of_lt_of_le he.1 h, he.2β© | |
| theorem acceptedThrough_arrived {n bits : β} (A : OnlineRule n bits) (r : Seed bits) | |
| (s v : Weights n) (Ο : ArrivalOrder n) (t : β) (e : Fin n) | |
| (he : e β acceptedThrough A r s v Ο t) : (Ο.symm e).val < t := by | |
| classical | |
| exact ((Finset.mem_filter.mp he).2).1 | |
| theorem acceptedThrough_iff_decision {n bits : β} (A : OnlineRule n bits) (r : Seed bits) | |
| (s v : Weights n) (Ο : ArrivalOrder n) (t : β) (e : Fin n) | |
| (he : (Ο.symm e).val < t) : | |
| e β acceptedThrough A r s v Ο t β decisionAt A r s v Ο (Ο.symm e) = true := by | |
| classical | |
| simp only [acceptedThrough, Finset.mem_filter, Finset.mem_univ, true_and, he] | |
| theorem sum_le_optimum {n : β} (M : Matroid (Fin n)) (v : Weights n) | |
| (I : Finset (Fin n)) (hI : M.Indep (I : Set (Fin n))) : | |
| (β e β I, v e) β€ optimum M v := by | |
| classical | |
| have h := Finset.le_sup' (s := (Finset.univ : Finset (Finset (Fin n)))) | |
| (f := fun J => if M.Indep (J : Set (Fin n)) then β e β J, v e else 0) | |
| (Finset.mem_univ I) | |
| change _ β€ Finset.univ.sup' Finset.univ_nonempty _ | |
| simpa only [ite_eq_left hI] using h | |
| theorem measurable_optimum {n : β} (M : Matroid (Fin n)) : Measurable (optimum M) := by | |
| classical | |
| have hm (I : Finset (Fin n)) : | |
| Measurable (fun v : Weights n => | |
| if M.Indep (I : Set (Fin n)) then β e β I, v e else 0) := by | |
| by_cases hI : M.Indep (I : Set (Fin n)) | |
| Β· simpa [hI] using I.measurable_sum (fun e _ => measurable_pi_apply e) | |
| Β· simp [hI] | |
| have hsup := Finset.measurable_sup' (s := (Finset.univ : Finset (Finset (Fin n)))) | |
| Finset.univ_nonempty (fun I _ => hm I) | |
| convert hsup using 1 | |
| ext v | |
| simp only [optimum, Finset.sup'_apply] | |
| theorem optimum_nonneg {n : β} (M : Matroid (Fin n)) (v : Weights n) : | |
| 0 β€ optimum M v := by | |
| simpa using sum_le_optimum M v β (by simp) | |
| theorem reward_nonneg {n bits : β} (A : OnlineRule n bits) (r : Seed bits) | |
| (s v : Weights n) (Ο : ArrivalOrder n) (hv : β e, 0 β€ v e) : | |
| 0 β€ reward A r s v Ο := by | |
| exact Finset.sum_nonneg fun e _ => hv e | |
| theorem reward_le_optimum {n bits : β} (M : Matroid (Fin n)) (A : OnlineRule n bits) | |
| (hA : Feasible M A) (r : Seed bits) (s v : Weights n) (Ο : ArrivalOrder n) | |
| (hs : β e, 0 β€ s e) (hv : β e, 0 β€ v e) : | |
| reward A r s v Ο β€ optimum M v := | |
| sum_le_optimum M v (accepted A r s v Ο) (hA r s v Ο n hs hv) | |
| lemma measurable_history {n : β} (Ο : ArrivalOrder n) (k : Fin n) : | |
| Measurable (fun v : Weights n => history v Ο k) := by | |
| apply Measurable.of_eval | |
| intro j | |
| exact measurable_const.prodMk (measurable_pi_apply (Ο (prefixIndex k j))) | |
| lemma measurable_decisionAt {n bits : β} (A : OnlineRule n bits) | |
| (Ο : ArrivalOrder n) (k : Fin n) : | |
| Measurable (fun x : Seed bits Γ (Weights n Γ Weights n) => | |
| decisionAt A x.1 x.2.1 x.2.2 Ο k) := | |
| (A.measurable_decide k).comp | |
| (measurable_fst.prodMk ((measurable_fst.comp measurable_snd).prodMk | |
| ((measurable_history Ο k).comp (measurable_snd.comp measurable_snd)))) | |
| lemma reward_eq_sum {n bits : β} (A : OnlineRule n bits) (r : Seed bits) | |
| (s v : Weights n) (Ο : ArrivalOrder n) : | |
| reward A r s v Ο = | |
| β e : Fin n, if decisionAt A r s v Ο (Ο.symm e) = true then v e else 0 := by | |
| classical | |
| unfold reward accepted acceptedThrough | |
| rw [Finset.sum_filter] | |
| apply Finset.sum_congr rfl | |
| intro e _ | |
| simp only [(Ο.symm e).isLt, true_and] | |
| lemma measurable_reward_fixed_order {n bits : β} (A : OnlineRule n bits) | |
| (Ο : ArrivalOrder n) : | |
| Measurable (fun x : Seed bits Γ (Weights n Γ Weights n) => | |
| reward A x.1 x.2.1 x.2.2 Ο) := by | |
| classical | |
| simp_rw [reward_eq_sum] | |
| apply Finset.measurable_sum | |
| intro e _ | |
| have hd := measurable_decisionAt A Ο (Ο.symm e) | |
| have ht : MeasurableSet {x : Seed bits Γ (Weights n Γ Weights n) | | |
| decisionAt A x.1 x.2.1 x.2.2 Ο (Ο.symm e) = true} := | |
| hd (measurableSet_singleton true) | |
| exact Measurable.ite ht | |
| ((measurable_pi_apply e).comp (measurable_snd.comp measurable_snd)) measurable_const | |
| theorem measurable_reward {n bits : β} (A : OnlineRule n bits) : | |
| Measurable (fun x : ArrivalOrder n Γ (Seed bits Γ (Weights n Γ Weights n)) => | |
| reward A x.2.1 x.2.2.1 x.2.2.2 x.1) := | |
| measurable_from_prod_countable_right (measurable_reward_fixed_order A) | |
| end MatroidProphet | |
| end OAI | |