1010(* *)
1111(* Enriched by Chun Tian (Australian National University, 2024 - 2025) *)
1212(* ========================================================================= *)
13+
1314Theory distribution (* was: "normal_rv" *)
1415Ancestors
1516 combin arithmetic logroot pred_set topology pair cardinal real
@@ -19,8 +20,6 @@ Ancestors
1920Libs
2021 numLib hurdUtils pred_setLib tautLib jrhUtils realLib
2122
22-
23-
2423fun METIS ths tm = prove(tm,METIS_TAC ths);
2524val T_TAC = rpt (Q.PAT_X_ASSUM ‘T’ K_TAC);
2625
@@ -2984,6 +2983,86 @@ Proof
29842983 rw [ext_normal_rv_def, o_DEF, real_normal, ETA_AX]
29852984QED
29862985
2986+ Theorem integration_of_normal_rv :
2987+ !p X mu sig g.
2988+ prob_space p /\ normal_rv X p mu sig /\ g IN borel_measurable borel ==>
2989+ (integrable p (Normal o g o X) <=>
2990+ integrable lborel (\x. Normal (g x * normal_density mu sig x)) /\
2991+ integral p (Normal o g o X) =
2992+ integral lborel (\x. Normal (g x * normal_density mu sig x)))
2993+ Proof
2994+ rpt GEN_TAC
2995+ >> simp [normal_rv_def, distribution_distr, random_variable_def,
2996+ p_space_def, events_def, prob_def, prob_space_def]
2997+ >> STRIP_TAC
2998+ >> Know ‘Normal o g IN Borel_measurable borel’
2999+ >- (MATCH_MP_TAC IN_MEASURABLE_BOREL_IMP_BOREL' \\
3000+ simp [sigma_algebra_borel])
3001+ >> DISCH_TAC
3002+ (* NOTE: To use “normal_rv X p mu sig” (distr p X s = normal_pmeasure mu sig s),
3003+ we have no choice but to use integral_distr.
3004+ *)
3005+ >> MP_TAC (Q.SPECL [‘p’, ‘borel’, ‘X’, ‘Normal o g’]
3006+ (INST_TYPE [beta |-> “:real”] integral_distr))
3007+ >> simp [sigma_algebra_borel]
3008+ >> STRIP_TAC
3009+ >> NTAC 2 (POP_ASSUM (REWRITE_TAC o wrap o SYM))
3010+ >> qabbrev_tac ‘M = (space borel,subsets borel,distr p X)’
3011+ >> Know ‘measure_space M’
3012+ >- (qunabbrev_tac ‘M’ \\
3013+ MATCH_MP_TAC measure_space_distr >> simp [sigma_algebra_borel])
3014+ >> DISCH_TAC
3015+ (* Now convert M to N, replacing “distr p X” by “normal_pmeasure mu sig” *)
3016+ >> qabbrev_tac ‘N = (space borel,subsets borel,normal_pmeasure mu sig)’
3017+ >> ‘measure_space N’ by PROVE_TAC [normal_measure_space]
3018+ >> ‘measure_space_eq M N’ by rw [measure_space_eq_def, Abbr ‘M’, Abbr ‘N’]
3019+ >> ‘integrable M (Normal o g) <=> integrable N (Normal o g)’
3020+ by simp [integrable_cong_measure']
3021+ >> ‘integral M (Normal o g) = integral N (Normal o g)’
3022+ by simp [integral_cong_measure']
3023+ >> NTAC 2 POP_ORW
3024+ (* cleanups *)
3025+ >> Q.PAT_X_ASSUM ‘measure_space p’ K_TAC
3026+ >> Q.PAT_X_ASSUM ‘measure p (m_space p) = 1’ K_TAC
3027+ >> Q.PAT_X_ASSUM ‘X IN borel_measurable _’ K_TAC
3028+ >> Q.PAT_X_ASSUM ‘!s. s IN subsets borel ==> _’ K_TAC
3029+ >> Q.PAT_X_ASSUM ‘measure_space M’ K_TAC
3030+ >> Q.PAT_X_ASSUM ‘measure_space_eq M N’ K_TAC
3031+ >> qunabbrev_tac ‘M’
3032+ (* NOTE: now converting “normal_pmeasure” to “normal_density” *)
3033+ >> qabbrev_tac ‘f = Normal_density mu sig’
3034+ >> qabbrev_tac ‘M = density lborel f’
3035+ >> Know ‘measure_space M’
3036+ >- (qunabbrev_tac ‘M’ \\
3037+ MATCH_MP_TAC measure_space_density >> simp [lborel_def, space_lborel] \\
3038+ simp [Abbr ‘f’, extreal_of_num_def, normal_density_nonneg,
3039+ IN_MEASURABLE_BOREL_normal_density'])
3040+ >> DISCH_TAC
3041+ >> Know ‘measure_space_eq N M’
3042+ >- (rw [measure_space_eq_def, Abbr ‘M’, Abbr ‘N’, density_def,
3043+ lborel_def, space_lborel, sets_lborel, space_borel] \\
3044+ simp [normal_pmeasure_def, density_measure_def, sets_lborel])
3045+ >> DISCH_TAC
3046+ >> ‘integrable N (Normal o g) <=> integrable M (Normal o g)’
3047+ by simp [integrable_cong_measure']
3048+ >> ‘integral N (Normal o g) = integral M (Normal o g)’
3049+ by simp [integral_cong_measure']
3050+ >> NTAC 2 POP_ORW
3051+ >> Q.PAT_X_ASSUM ‘measure_space M’ K_TAC
3052+ >> Q.PAT_X_ASSUM ‘measure_space N’ K_TAC
3053+ >> Q.PAT_X_ASSUM ‘measure_space_eq N M’ K_TAC
3054+ >> qunabbrevl_tac [‘M’, ‘N’]
3055+ (* applying integral_density *)
3056+ >> MP_TAC (Q.SPECL [‘lborel’, ‘f’, ‘Normal o g’]
3057+ (INST_TYPE [alpha |-> “:real”] integral_density))
3058+ >> simp [lborel_def, IN_MEASURABLE_BOREL_NORMAL, space_lborel]
3059+ >> impl_tac
3060+ >- simp [Abbr ‘f’, extreal_of_num_def, normal_density_nonneg,
3061+ IN_MEASURABLE_BOREL_normal_density']
3062+ >> Rewr'
3063+ >> simp [Abbr ‘f’, extreal_mul_eq]
3064+ QED
3065+
29873066(* ------------------------------------------------------------------------- *)
29883067(* Weak convergence and its relation with convergence in distribution *)
29893068(* ------------------------------------------------------------------------- *)
@@ -3455,7 +3534,7 @@ Proof
34553534 >- (Q.X_GEN_TAC ‘n’ \\
34563535 MATCH_MP_TAC neg_add >> simp [])
34573536 >> Rewr'
3458- >> Know ‘--Y sp + -Y s0 = -(-Y sp + Y s0)’
3537+ >> Know ‘- -Y sp + -Y s0 = -(-Y sp + Y s0)’
34593538 >- (SYM_TAC >> MATCH_MP_TAC neg_add >> simp [])
34603539 >> simp [] >> DISCH_THEN K_TAC
34613540 >> simp [le_neg]
@@ -3559,7 +3638,7 @@ Proof
35593638 >- (Q.X_GEN_TAC ‘n’ \\
35603639 MATCH_MP_TAC neg_add >> simp [])
35613640 >> Rewr'
3562- >> Know ‘--Y sp + -Y s0 = -(-Y sp + Y s0)’
3641+ >> Know ‘- -Y sp + -Y s0 = -(-Y sp + Y s0)’
35633642 >- (SYM_TAC \\
35643643 MATCH_MP_TAC neg_add >> simp [])
35653644 >> simp []
0 commit comments