Skip to content

Commit a2ffd60

Browse files
committed
move rational definitions into reals.v
1 parent c71633b commit a2ffd60

File tree

4 files changed

+65
-71
lines changed

4 files changed

+65
-71
lines changed

CHANGELOG_UNRELEASED.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
### Added
66

7-
### Changed
8-
97
- in `sequences.v`:
108
+ lemma `subset_seqDU`
119

@@ -17,13 +15,23 @@
1715
+ lemma `ae_foralln`
1816
+ lemma `ae_eqe_mul2l`
1917

18+
- in `reals.v`:
19+
+ definition `irrational`
20+
+ lemmas `irrationalE`, `rationalP`
21+
22+
- file `borel_hierarchy.v`:
23+
+ lemmas ``
24+
2025
### Changed
2126

2227
- in `measure.v`:
2328
+ notation `{ae mu, P}` (near use `{near _, _}` notation)
2429
+ definition `ae_eq`
2530
+ `ae_eq` lemmas now for `ringType`-valued functions (instead of `\bar R`)
2631

32+
- moved from `pi_irrational.v` to `reals.v` and changed
33+
+ definition `rational`
34+
2735
### Renamed
2836

2937
### Generalized

theories/Make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ forms.v
6060
derive.v
6161
measure.v
6262
numfun.v
63+
borel_hierarchy.v
6364

6465
lebesgue_integral_theory/simple_functions.v
6566
lebesgue_integral_theory/lebesgue_integral_definition.v

theories/borel_hierarchy.v

Lines changed: 53 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ From mathcomp Require Import reals ereal topology normedtype sequences.
55
From mathcomp Require Import real_interval esum measure lebesgue_measure numfun.
66

77
(**md**************************************************************************)
8+
(* # Basic facts about G-delta and F-sigma sets *)
9+
(* *)
810
(* ``` *)
9-
(* Gdelta S == S is a set of countable intersection of open sets *)
11+
(* Gdelta S == S is countable intersection of open sets *)
12+
(* Gdelta_dense S == S is a countable intersection of dense open sets *)
13+
(* Fsigma S == S is countable union of closed sets *)
1014
(* ``` *)
1115
(* *)
1216
(******************************************************************************)
@@ -20,17 +24,21 @@ Import numFieldNormedType.Exports.
2024

2125
Local Open Scope classical_set_scope.
2226

23-
Definition irrational (R : realType) : set R := ~` (ratr @` [set: rat]).
24-
Arguments irrational : clear implicits.
25-
26-
Definition rational (R : realType) : set R := (ratr @` [set: rat]).
27+
Lemma denseI (T : topologicalType) (A B : set T) :
28+
open A -> dense A -> dense B -> dense (A `&` B).
29+
Proof.
30+
move=> oA dA dB C C0 oC.
31+
have CA0 : C `&` A !=set0 by exact: dA.
32+
suff: (C `&` A) `&` B !=set0 by rewrite setIA.
33+
by apply: dB => //; exact: openI.
34+
Qed.
2735

28-
Lemma irratE (R : realType) :
29-
irrational R = \bigcap_(q : rat) ~` (ratr @` [set q]).
36+
Lemma dense0 {R : ptopologicalType} : ~ dense (@set0 R).
3037
Proof.
31-
apply/seteqP; split => [r/= rE q _/=|r/= rE [q] _ qr]; last first.
32-
by apply: (rE q Logic.I) => /=; exists q.
33-
by apply: contra_not rE => -[_ -> <-{r}]; exists q.
38+
apply/existsNP; exists setT.
39+
apply/not_implyP; split; first exact/set0P/setT0.
40+
apply/not_implyP; split; first exact: openT.
41+
by rewrite setTI => -[].
3442
Qed.
3543

3644
Lemma dense_set1C {R : realType} (r : R) : dense (~` [set r]).
@@ -49,53 +57,49 @@ rewrite in_itv/= !ltrD2l; apply/andP; split.
4957
by rewrite gtr_pMr// invf_lt1// ltr1n.
5058
Unshelve. all: by end_near. Qed.
5159

52-
Lemma denseI (T : topologicalType) (A B : set T) :
53-
open A -> dense A -> dense B -> dense (A `&` B).
54-
Proof.
55-
move=> oA dA dB C C0 oC.
56-
have CA0 : C `&` A !=set0 by exact: dA.
57-
suff: (C `&` A) `&` B !=set0 by rewrite setIA.
58-
by apply: dB => //; exact: openI.
59-
Qed.
60+
Section Gdelta_Fsigma.
61+
Context {T : topologicalType}.
62+
Implicit Type S : set T.
6063

61-
Lemma dense0 {R : realType} : ~ dense (@set0 R).
62-
Proof.
63-
apply/existsNP; exists setT.
64-
apply/not_implyP; split; first exact/set0P/setT0.
65-
apply/not_implyP; split; first exact: openT.
66-
by rewrite setTI => -[].
67-
Qed.
64+
Definition Gdelta S :=
65+
exists2 F : (set T)^nat, (forall i, open (F i)) & S = \bigcap_i (F i).
6866

69-
Section Fsigma.
67+
Lemma open_Gdelta S : open S -> Gdelta S.
68+
Proof. by exists (fun=> S)=> //; rewrite bigcap_const. Qed.
7069

71-
Definition Fsigma (R : topologicalType) (S : set R) :=
72-
exists2 A_ : (set R)^nat,
73-
(forall i : nat, closed (A_ i)) & S = \bigcup_i (A_ i).
70+
Definition Gdelta_dense S :=
71+
exists2 F : (set T)^nat,
72+
(forall i, open (F i) /\ dense (F i)) & S = \bigcap_i (F i).
7473

75-
Lemma closed_Fsigma (R : topologicalType) (S : set R) : closed S -> Fsigma S.
76-
Proof. by exists (fun=> S)=> //; rewrite bigcup_const. Qed.
74+
Definition Fsigma S :=
75+
exists2 F : (set T)^nat, (forall i, closed (F i)) & S = \bigcup_i (F i).
7776

78-
End Fsigma.
77+
Lemma closed_Fsigma S : closed S -> Fsigma S.
78+
Proof. by exists (fun=> S)=> //; rewrite bigcup_const. Qed.
7979

80-
Section Gdelta.
80+
End Gdelta_Fsigma.
8181

82-
Definition Gdelta (R : topologicalType) (S : set R) :=
83-
exists2 A_ : (set R)^nat,
84-
(forall i : nat, open (A_ i)) & S = \bigcap_i (A_ i).
82+
Lemma Gdelta_measurable {R : realType} (S : set R) : Gdelta S -> measurable S.
83+
Proof.
84+
move=> [] B oB ->; apply: bigcapT_measurable => i.
85+
exact: open_measurable.
86+
Qed.
8587

86-
Lemma open_Gdelta (R : topologicalType) (S : set R) : open S -> Gdelta S.
87-
Proof. by exists (fun=> S)=> //; rewrite bigcap_const. Qed.
88+
Lemma Gdelta_subspace_open {R : realType} (A : set R) (S : set (subspace A)) :
89+
open A -> Gdelta S -> Gdelta (A `&` S).
90+
Proof.
91+
move=> oA [/= S_ oS_ US].
92+
exists (fun n => A `&` (S_ n)).
93+
by move=> ?; rewrite open_setSI.
94+
by rewrite bigcapIr// US.
95+
Qed.
8896

89-
Section irrat_Gdelta.
97+
Section irrational_Gdelta.
9098
Context {R : realType}.
9199

92-
Definition Gdelta_dense (R : topologicalType) (S : set R) :=
93-
exists2 A_ : (set R)^nat,
94-
(forall i, open (A_ i) /\ dense (A_ i)) & S = \bigcap_i (A_ i).
95-
96-
Lemma irrat_Gdelta : Gdelta_dense (irrational R).
100+
Lemma irrational_Gdelta : Gdelta_dense (irrational R).
97101
Proof.
98-
rewrite irratE.
102+
rewrite irrationalE.
99103
have /pcard_eqP/bijPex[f bijf] := card_rat.
100104
pose f1 := 'pinv_(fun => 0%R) [set: rat] f.
101105
exists (fun n => ~` [set ratr (f1 n)]).
@@ -110,9 +114,9 @@ rewrite /f1 pinvKV ?inE//=.
110114
exact: set_bij_inj bijf.
111115
Qed.
112116

113-
End irrat_Gdelta.
117+
End irrational_Gdelta.
114118

115-
Lemma rat_not_Gdelta (R : realType) : ~ Gdelta (@rational R).
119+
Lemma not_rational_Gdelta (R : realType) : ~ Gdelta (@rational R).
116120
Proof.
117121
apply/forall2NP => A.
118122
apply/not_andP => -[oA ratrA].
@@ -123,10 +127,9 @@ have dense_A n : dense (A n).
123127
apply: setIS.
124128
rewrite -/(@rational R) ratrA.
125129
exact: bigcap_inf.
126-
have [/= B oB irratB] := @irrat_Gdelta R.
130+
have [/= B oB irratB] := @irrational_Gdelta R.
127131
pose C : (set R)^nat := fun n => A n `&` B n.
128-
have C0 : set0 = \bigcap_i C i.
129-
by rewrite bigcapI -ratrA -irratB setICr.
132+
have C0 : set0 = \bigcap_i C i by rewrite bigcapI -ratrA -irratB setICr.
130133
have : forall n, open (C n) /\ dense (C n).
131134
move=> n; split.
132135
by apply: openI => //; apply oB.
@@ -135,18 +138,3 @@ move/Baire.
135138
rewrite -C0.
136139
exact: dense0.
137140
Qed.
138-
139-
Lemma Gdelta_measurable {R : realType} (S : set R) : Gdelta S -> (@measurable _ R) S.
140-
Proof.
141-
move=> [] B oB ->; apply: bigcapT_measurable => i.
142-
exact: open_measurable.
143-
Qed.
144-
145-
Lemma Gdelta_subspace_open {R : realType} (A : set R) (S : set (subspace A)) :
146-
open A -> Gdelta S -> @Gdelta R (A `&` S).
147-
Proof.
148-
move=> oA [/= S_ oS_ US].
149-
exists (fun n => A `&` (S_ n)).
150-
by move=> ?; rewrite open_setSI.
151-
by rewrite bigcapIr// US.
152-
Qed.

theories/pi_irrational.v

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ apply/measurable_funTS; apply: continuous_measurable_fun.
2828
exact/continuous_horner.
2929
Qed.
3030

31-
(* TODO: move somewhere to classical *)
32-
Definition rational {R : realType} (x : R) := exists m n, x = (m%:~R / n%:R)%R.
33-
3431
Module pi_irrational.
3532
Local Open Scope ring_scope.
3633

@@ -409,7 +406,7 @@ End pi_irrational.
409406

410407
Lemma pi_irrationnal {R : realType} : ~ rational (pi : R).
411408
Proof.
412-
move=> [a [b]]; have [->|b0 piratE] := eqVneq b O.
409+
move/rationalP => [a [b]]; have [->|b0 piratE] := eqVneq b O.
413410
by rewrite invr0 mulr0; apply/eqP; rewrite gt_eqF// pi_gt0.
414411
have [na ana] : exists na, (a%:~R = na %:R :> R)%R.
415412
exists `|a|; rewrite natr_absz gtr0_norm//.

0 commit comments

Comments
 (0)