Skip to content

Commit 0cf8316

Browse files
committed
use gauss_integral to complete another example
1 parent 5cb70a9 commit 0cf8316

File tree

8 files changed

+166
-587
lines changed

8 files changed

+166
-587
lines changed

theories/kernel.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,14 +1565,14 @@ Definition mkproduct :=
15651565

15661566
End kproduct_measure.
15671567

1568-
(* [Theorem 14.22, Klenke 2014] (3/3): the composition of finite transition
1569-
kernels is sigma-finite *)
15701568
HB.instance Definition _ d0 d1 d2 (T0 : measurableType d0)
15711569
(T1 : measurableType d1) (T2 : measurableType d2) {R : realType}
15721570
(k1 : R.-ftker T0 ~> T1) (k2 : R.-ftker (T0 * T1) ~> T2) :=
15731571
@isKernel.Build _ _ T0 (T1 * T2)%type R
15741572
(mkproduct k1 k2) (measurable_kproduct k1 k2).
15751573

1574+
(* [Theorem 14.22, Klenke 2014] (3/3): the composition of finite transition
1575+
kernels is sigma-finite *)
15761576
Section sigma_finite_kproduct.
15771577
Context d0 d1 d2 (T0 : measurableType d0)
15781578
(T1 : measurableType d1) (T2 : measurableType d2) {R : realType}

theories/lang_syntax.v

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ From mathcomp Require Import ring lra.
1818
(* Probabilistic Programming Language in Coq using s-finite kernels in Coq. *)
1919
(* APLAS 2023 *)
2020
(* *)
21-
(* beta distribution specialized to nat *)
21+
(* beta distribution *)
22+
(* ``` *)
2223
(* beta_pdf == probability density function for beta *)
2324
(* beta_prob == beta probability measure *)
25+
(* ``` *)
2426
(* *)
27+
(* ``` *)
2528
(* typ == syntax for types of data structures *)
2629
(* measurable_of_typ t == the measurable type corresponding to type t *)
2730
(* It is of type {d & measurableType d} *)
@@ -58,6 +61,7 @@ From mathcomp Require Import ring lra.
5861
(* measurable *)
5962
(* execP e == a s-finite kernel corresponding to the evaluation *)
6063
(* of the probabilistic expression e *)
64+
(* ``` *)
6165
(* *)
6266
(******************************************************************************)
6367

@@ -1337,7 +1341,8 @@ Lemma beta_pdf_uniq_ae (a b : nat) :
13371341
(EFin \o (beta_pdf a b)).
13381342
Proof.
13391343
apply: integral_ae_eq => //.
1340-
- apply: integrableS (Radon_Nikodym_integrable _) => //.
1344+
- apply: (@integrableS _ _ _ _ setT) => //=.
1345+
apply: Radon_Nikodym_integrable => //=.
13411346
exact: beta_prob_dom.
13421347
- apply/measurable_funTS/measurableT_comp => //.
13431348
exact: measurable_beta_pdf.
@@ -1366,9 +1371,9 @@ move=> mU mf finf.
13661371
rewrite -(Radon_Nikodym_change_of_variables (beta_prob_dom a b)) //=; last first.
13671372
by apply/integrableP; split.
13681373
apply: ae_eq_integral => //.
1369-
- apply: emeasurable_funM => //; apply: measurable_int.
1370-
apply: integrableS (Radon_Nikodym_integrable _) => //=.
1371-
exact: beta_prob_dom.
1374+
- apply: emeasurable_funM => //; apply: (measurable_int mu).
1375+
apply: (integrableS _ _ (@subsetT _ _)) => //=.
1376+
by apply: Radon_Nikodym_integrable; exact: beta_prob_dom.
13721377
- apply: emeasurable_funM => //=; apply/measurableT_comp => //=.
13731378
by apply/measurable_funTS; exact: measurable_beta_pdf.
13741379
- apply: ae_eq_mul2l => /=.

theories/lang_syntax_examples.v

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
(* mathcomp analysis (c) 2025 Inria and AIST. License: CeCILL-C. *)
12
From Coq Require Import String.
23
From HB Require Import structures.
34
From mathcomp Require Import all_ssreflect ssralg ssrnum ssrint interval.

theories/lang_syntax_table_game.v

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
(* mathcomp analysis (c) 2025 Inria and AIST. License: CeCILL-C. *)
12
Require Import String.
23
From HB Require Import structures.
34
From mathcomp Require Import all_ssreflect ssralg ssrnum ssrint interval.
@@ -554,7 +555,7 @@ under eq_integral.
554555
rewrite /XMonemX01 patchE x0 XMonemX0.
555556
over.
556557
rewrite /= => ->; congr bernoulli.
557-
by rewrite /div_betafun addn0 !betafunE/= !factE/= !factE; field.
558+
by rewrite /div_betafun addn0 !betafunE/= !factE/= ?factE; field.
558559
Qed.
559560

560561
Lemma dirac_bool {R : realType} (U : set bool) :

theories/lang_syntax_toy.v

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1+
(* mathcomp analysis (c) 2025 Inria and AIST. License: CeCILL-C. *)
12
From Coq Require Import String Classical.
23
From HB Require Import structures.
34
From mathcomp Require Import all_ssreflect ssralg.
45
From mathcomp Require Import mathcomp_extra boolp.
56
From mathcomp Require Import signed reals topology normedtype.
67
From mathcomp Require Import lang_syntax_util.
78

8-
(******************************************************************************)
9-
(* Intrinsically-typed concrete syntax for a toy language *)
9+
(**md**************************************************************************)
10+
(* # Intrinsically-typed concrete syntax for a toy language *)
1011
(* *)
1112
(* The main module provided by this file is "lang_intrinsic_tysc" which *)
1213
(* provides an example of intrinsically-typed concrete syntax for a toy *)
1314
(* language (a simplification of the syntax/evaluation formalized in *)
1415
(* lang_syntax.v). Other modules provide even more simplified language for *)
1516
(* pedagogical purposes. *)
1617
(* *)
18+
(* ``` *)
1719
(* lang_extrinsic == non-intrinsic definition of expression *)
1820
(* lang_intrinsic_ty == intrinsically-typed syntax *)
1921
(* lang_intrinsic_sc == intrinsically-scoped syntax *)
2022
(* lang_intrinsic_tysc == intrinsically-typed/scoped syntax *)
23+
(* ``` *)
2124
(* *)
2225
(******************************************************************************)
2326

theories/lang_syntax_util.v

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
(* mathcomp analysis (c) 2025 Inria and AIST. License: CeCILL-C. *)
12
From Coq Require Import String.
23
From HB Require Import structures.
34
Require Import Classical_Prop. (* NB: to compile with Coq 8.17 *)
45
From mathcomp Require Import all_ssreflect.
56
From mathcomp Require Import signed.
67

7-
(******************************************************************************)
8-
(* Shared by lang_syntax_*.v files *)
8+
(**md**************************************************************************)
9+
(* Shared by lang_syntax_*.v files *)
910
(******************************************************************************)
1011

1112
HB.instance Definition _ := hasDecEq.Build string eqb_spec.

0 commit comments

Comments
 (0)