@@ -10,20 +10,25 @@ module Measures {
10
10
11
11
type Probability = x: real | 0. 0 <= x <= 1. 0
12
12
13
+ // States that given collection of sets is σ-algebra on the set of values of type `T`.
14
+ // In other words, the sample space is `SampleSpace<T>()`, i.e. the set of all values of type `T`,
15
+ // and `eventSpace` is the collection of measurable subsets.
16
+ ghost predicate IsSigmaAlgebra< T (!new)> (eventSpace: iset < iset < T>> ) {
17
+ && (iset {}) in eventSpace
18
+ && (forall e | e in eventSpace :: Complement (e) in eventSpace)
19
+ && (forall f: nat - > iset < T> | (forall n :: f (n) in eventSpace) :: (CountableUnion (f) in eventSpace))
20
+ }
21
+
22
+ // The set of all values of type `T` that are not in the given set.
13
23
ghost function Complement< T (!new)> (event: iset < T> ): iset < T> {
14
24
iset x: T | x ! in event
15
25
}
16
26
27
+ // The set of all values of type `T`.
17
28
ghost function SampleSpace< T (!new)> (): iset < T> {
18
29
Complement (iset{})
19
30
}
20
31
21
- ghost predicate IsSigmaAlgebra< T (!new)> (eventSpace: iset < iset < T>> ) {
22
- && (iset {}) in eventSpace
23
- && (forall e | e in eventSpace :: Complement (e) in eventSpace)
24
- && (forall f: nat - > iset < T> | (forall n :: f (n) in eventSpace) :: (CountableUnion (f) in eventSpace))
25
- }
26
-
27
32
ghost function CountableUnion< T (!new)> (f: nat - > iset < T> , i: nat := 0): iset < T> {
28
33
iset n: nat | n >= i, x < - f (n) :: x
29
34
}
@@ -33,6 +38,7 @@ module Measures {
33
38
f (i) + CountableSum (f, i+1)
34
39
}
35
40
41
+ // The σ-algebra that contains all subsets.
36
42
ghost function DiscreteSigmaAlgebra< A (!new)> (): iset < iset < A>> {
37
43
iset _: iset < A>
38
44
}
0 commit comments