Skip to content

Commit 9a1fe77

Browse files
authored
Merge pull request #1776 from affeldt-aist/fixes_1775
isolated points
2 parents 51b709c + 8706715 commit 9a1fe77

File tree

9 files changed

+179
-16
lines changed

9 files changed

+179
-16
lines changed

CHANGELOG_UNRELEASED.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,23 @@
7171
+ lemmas `nondecreasing_measurable`, `nonincreasing_measurable`
7272
- in `subspace_topology.v`:
7373
+ definition `from_subspace`
74+
- in `topology_structure.v`:
75+
+ definition `isolated`
76+
+ lemma `isolatedS`
77+
+ lemma `disjoint_isolated_limit_point`
78+
+ lemma `closure_isolated_limit_point`
79+
80+
- in `separation_axioms.v`:
81+
+ lemma `perfectP`
82+
83+
- in `cardinality.v`:
84+
+ lemmas `finite_setX_or`, `infinite_setX`
85+
+ lemmas `infinite_prod_rat`, ``card_rat2`
86+
87+
- in `normed_module.v`:
88+
+ lemma `open_subball_rat`
89+
+ fact `isolated_rat_ball`
90+
+ lemma `countable_isolated`
7491

7592
### Changed
7693

@@ -121,6 +138,9 @@
121138

122139
### Deprecated
123140

141+
- in `topology_structure.v`:
142+
+ lemma `closure_limit_point` (use `closure_limit_point_isolated` instead)
143+
124144
### Removed
125145

126146
- in `lebesgue_stieltjes_measure.v`:

classical/cardinality.v

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(* mathcomp analysis (c) 2017 Inria and AIST. License: CeCILL-C. *)
1+
(* mathcomp analysis (c) 2025 Inria and AIST. License: CeCILL-C. *)
22
From HB Require Import structures.
33
From mathcomp Require Import all_ssreflect finmap ssralg ssrnum ssrint rat.
44
From mathcomp Require Import mathcomp_extra boolp classical_sets functions.
@@ -632,6 +632,21 @@ Proof. by apply: subset_card_le; rewrite setDE; apply: subIset; left. Qed.
632632
Lemma finite_image T T' A (f : T -> T') : finite_set A -> finite_set (f @` A).
633633
Proof. exact/card_le_finite/card_image_le. Qed.
634634

635+
Lemma finite_setX_or T T' (A : set T) (B : set T') :
636+
finite_set (A `*` B) -> finite_set A \/ finite_set B.
637+
Proof.
638+
have [->|/set0P[a Aa]] := eqVneq A set0; first by left.
639+
have /sub_finite_set : [set a] `*` B `<=` A `*` B by move=> x/= [] -> ?; split.
640+
move => /[apply]/(finite_image snd); rewrite (_ : _ @` _ = B); first by right.
641+
by apply/seteqP; split=> [b [[? ?] [? ?] <-//]|b ?]/=; exists (a, b).
642+
Qed.
643+
644+
Lemma infinite_setX {T} {A B : set T} :
645+
infinite_set A -> infinite_set B -> infinite_set (A `*` B).
646+
Proof.
647+
by move=> iA iB; have /not_orP := conj iA iB; exact/contra_not/finite_setX_or.
648+
Qed.
649+
635650
Lemma finite_set1 T (x : T) : finite_set [set x].
636651
Proof.
637652
elim/Pchoice: T => T in x *.
@@ -1099,9 +1114,7 @@ Lemma infinite_nat : ~ finite_set [set: nat].
10991114
Proof. exact/infiniteP/card_lexx. Qed.
11001115

11011116
Lemma infinite_prod_nat : infinite_set [set: nat * nat].
1102-
Proof.
1103-
by apply/infiniteP/pcard_leTP/injPex; exists (pair 0%N) => // m n _ _ [].
1104-
Qed.
1117+
Proof. by rewrite -setXTT; apply: infinite_setX; exact: infinite_nat. Qed.
11051118

11061119
Lemma card_nat2 : [set: nat * nat] #= [set: nat].
11071120
Proof. exact/eq_card_nat/infinite_prod_nat/countableP. Qed.
@@ -1117,6 +1130,12 @@ Qed.
11171130
Lemma card_rat : [set: rat] #= [set: nat].
11181131
Proof. exact/eq_card_nat/infinite_rat/countableP. Qed.
11191132

1133+
Lemma infinite_prod_rat : infinite_set [set: rat * rat].
1134+
Proof. by rewrite -setXTT; apply: infinite_setX; exact: infinite_rat. Qed.
1135+
1136+
Lemma card_rat2 : ([set: rat * rat] #= [set: nat])%card.
1137+
Proof. exact/eq_card_nat/infinite_prod_rat/countableP. Qed.
1138+
11201139
Lemma choicePcountable {T : choiceType} : countable [set: T] ->
11211140
{T' : countType | T = T' :> Type}.
11221141
Proof.

classical/classical_sets.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
(* mathcomp analysis (c) 2017 Inria and AIST. License: CeCILL-C. *)
1+
(* mathcomp analysis (c) 2025 Inria and AIST. License: CeCILL-C. *)
22
From HB Require Import structures.
33
From mathcomp Require Import all_ssreflect ssralg matrix finmap ssrnum.
4-
From mathcomp Require Import ssrint interval.
4+
From mathcomp Require Import ssrint rat interval.
55
From mathcomp Require Import mathcomp_extra boolp wochoice.
66

77
(**md**************************************************************************)

theories/function_spaces.v

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(* mathcomp analysis (c) 2017 Inria and AIST. License: CeCILL-C. *)
1+
(* mathcomp analysis (c) 2025 Inria and AIST. License: CeCILL-C. *)
22
From HB Require Import structures.
33
From mathcomp Require Import all_ssreflect all_algebra finmap generic_quotient.
44
From mathcomp Require Import boolp classical_sets functions.
@@ -1218,8 +1218,7 @@ have C : compact R.
12181218
by apply: tychonoff => x; rewrite -precompactE; move: ptwsPreW; exact.
12191219
apply: (subclosed_compact _ C); first exact: closed_closure.
12201220
have WsubR : (fW @` W) `<=` R.
1221-
move=> f Wf x; rewrite /R /K closure_limit_point; left.
1222-
by case: Wf => i ? <-; exists i.
1221+
by move=> f [i Wi <-] x; rewrite /K; apply: subset_closure; exists i.
12231222
rewrite closureE; apply: smallest_sub (compact_closed _ C) WsubR.
12241223
exact: hausdorff_product.
12251224
Qed.

theories/normedtype_theory/normed_module.v

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,6 +2088,85 @@ apply: filterS => e xeA y exy; apply: xeA.
20882088
by rewrite -ball_normE/= in exy; exact: ltW.
20892089
Qed.
20902090

2091+
Lemma open_subball_rat {R : realType} (S : set R) x : open S -> x \in S ->
2092+
exists c r, let B : set R := ball (@ratr R c) (ratr r) in x \in B /\ B `<=` S.
2093+
Proof.
2094+
move=> oS /set_mem/(open_subball oS)[r/= r0 rS].
2095+
have [y yxr] : exists y, ball x (r / 4) (ratr y).
2096+
suff : ball x (r / 4) `&` range ratr !=set0.
2097+
by move=> [/= _ []] /[swap] -[y _ <-]; exists y.
2098+
apply: dense_rat; last by apply: ball_open; rewrite divr_gt0.
2099+
by exists x; apply: ballxx; rewrite divr_gt0.
2100+
have [q /andP[rq qr]] : exists q, r / 4 < ratr q < r / 2.
2101+
have : ball (r / 3) (r / 12) `&` range ratr !=set0.
2102+
apply: dense_rat; last by apply: ball_open; rewrite divr_gt0.
2103+
by exists (r / 3); apply: ballxx; rewrite divr_gt0.
2104+
move=> [/= _ []] /[swap] -[z _ <-].
2105+
rewrite ball_itv/= in_itv/= => /andP[rz zr]; exists z; apply/andP; split.
2106+
- rewrite (le_lt_trans _ rz)// -mulrBr ler_pM2l// -(@ler_pM2l _ 12)//.
2107+
rewrite mulrBr divff// (@natrM _ 3 4) -mulrA divff// mulr1.
2108+
by rewrite mulrAC divff// mul1r -lerBlDr opprK natr1.
2109+
- rewrite (lt_le_trans zr)// -mulrDr ler_pM2l// -(@ler_pM2l _ 12)//.
2110+
rewrite mulrDr divff// (@natrM _ 3 4) mulrAC divff// mul1r.
2111+
by rewrite natr1 (@natrM _ 2 2) -!mulrA divff// mulr1 -natrM ler_nat.
2112+
have [yqxr xrS] : ball (@ratr R y) (ratr q) `<=` ball x r /\ ball x r `<=` S.
2113+
split => [z yqz|z /rat_in_itvoo[p]].
2114+
- rewrite /ball/= -(subrK (ratr y) x) -(addrA _ (ratr y)).
2115+
rewrite (le_lt_trans (ler_normD _ _))// (splitr r) ltrD//.
2116+
by apply: le_ball yxr; rewrite ler_pM2l// lef_pV2 ?posrE// ler_nat.
2117+
by rewrite (lt_trans yqz).
2118+
- rewrite in_itv/= => /andP[xzp pr]; apply: (rS (ratr p)) => //=.
2119+
+ by rewrite sub0r normrN gtr0_norm// (le_lt_trans _ xzp).
2120+
+ exact: le_lt_trans xzp.
2121+
exists y, q; split; last exact: subset_trans xrS.
2122+
exact/mem_set/ball_sym/(le_ball _ yxr)/ltW.
2123+
Qed.
2124+
2125+
Section countable_isolated.
2126+
Context {R : realType}.
2127+
Variable S : set R.
2128+
2129+
Fact isolated_rat_ball (x : R) : isolated S x -> exists cr,
2130+
let B : set R := ball (@ratr R cr.1) (ratr cr.2) in
2131+
x \in B /\ (forall y : R, isolated S y -> y \in B -> x = y).
2132+
Proof.
2133+
move=> Sx.
2134+
have [e Sxe] : exists e : {posnum R},
2135+
forall y : R, isolated S y -> y \in (ball x e%:num : set R) -> x = y.
2136+
case: Sx => [xS/= [V xV /seteqP[VSx _]]].
2137+
have [e /= e0 exV] : \forall e \near 0^'+, ball x e `<=` V°.
2138+
apply: open_subball; first exact: open_interior.
2139+
by move/nbhs_interior : xV; exact: nbhs_singleton.
2140+
have e20 : 0 < e / 2 by rewrite divr_gt0.
2141+
exists (PosNum e20) => y [Sy [/= U yU USy /set_mem xey]].
2142+
apply/eqP/negPn/negP => xy.
2143+
suff : (V `&` S) y by move/VSx/esym; exact/eqP.
2144+
split => //; last exact/set_mem.
2145+
apply: interior_subset; apply: exV xey => //.
2146+
by rewrite /ball_/= sub0r normrN gtr0_norm// gtr_pMr// invf_lt1// ltr1n.
2147+
have [c [r [xcr crxe]]] : exists c r,
2148+
let B : set R := ball (@ratr R c) (ratr r) in x \in B /\ B `<=` ball x e%:num.
2149+
by apply: open_subball_rat; [exact: ball_open|exact/mem_set/ballxx].
2150+
by exists (c, r); split=> //= y /Sxe /[!inE] /[swap] /crxe /[swap] /[apply].
2151+
Qed.
2152+
2153+
Lemma countable_isolated : countable (isolated S).
2154+
Proof.
2155+
apply/pcard_injP => /=.
2156+
pose g r := if pselect (isolated S r) is left H then
2157+
sval (cid (isolated_rat_ball H)) else 0.
2158+
have /card_bijP[h /bij_inj injh] := card_rat2.
2159+
exists (set_val \o h \o to_setT \o g) => x y /set_mem xS /set_mem yS /=.
2160+
rewrite /= /g; case: pselect => // xS'; case: pselect => // yS'.
2161+
case: cid => //= [ar [xar Nxar]]{xS'}; case: cid => //= [bd [ybd Nybd]]{yS'} ab.
2162+
have /injh/(congr1 (fun x => \val x)) : h (to_setT ar) = h (to_setT bd).
2163+
move: (h (to_setT ar)) (h (to_setT bd)) ab => [n nT] [m mT].
2164+
by rewrite !set_valE/= => ->; congr exist.
2165+
by rewrite -inv_to_setT !funK ?inE// => {}ab; apply: Nxar => //; rewrite ab.
2166+
Qed.
2167+
2168+
End countable_isolated.
2169+
20912170
Lemma closed_disjoint_closed_ball {R : realFieldType} {M : normedModType R}
20922171
(K : set M) z : closed K -> ~ K z ->
20932172
\forall d \near 0^'+, closed_ball z d `&` K = set0.

theories/normedtype_theory/vitali_lemma.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(* mathcomp analysis (c) 2025 Inria and AIST. License: CeCILL-C. *)
22
From HB Require Import structures.
33
From mathcomp Require Import all_ssreflect finmap ssralg ssrnum ssrint interval.
4-
From mathcomp Require Import archimedean.
4+
From mathcomp Require Import archimedean rat.
55
From mathcomp Require Import boolp classical_sets functions cardinality.
66
From mathcomp Require Import set_interval interval_inference ereal reals.
77
From mathcomp Require Import topology function_spaces tvs num_normedtype.

theories/topology_theory/num_topology.v

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ Lemma closure_sup (R : realType) (A : set R) :
149149
A !=set0 -> has_ubound A -> closure A (sup A).
150150
Proof.
151151
move=> A0 ?; have [|AsupA] := pselect (A (sup A)); first exact: subset_closure.
152-
rewrite closure_limit_point; right => U /nbhs_ballP[_ /posnumP[e]] supAeU.
152+
rewrite closure_isolated_limit_point.
153+
right => U /nbhs_ballP[_ /posnumP[e]] supAeU.
153154
suff [x [Ax /andP[sAex xsA]]] : exists x, A x /\ sup A - e%:num < x < sup A.
154155
exists x; split => //; first by rewrite lt_eqF.
155156
apply supAeU; rewrite /ball /= ltr_distl (addrC x e%:num) -ltrBlDl sAex.

theories/topology_theory/separation_axioms.v

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,17 @@ Implicit Types (T : topologicalType).
10781078

10791079
Definition perfect_set {T} (A : set T) := closed A /\ limit_point A = A.
10801080

1081+
Lemma perfectP {T} (A : set T) :
1082+
perfect_set A <-> closed A /\ isolated A = set0.
1083+
Proof.
1084+
split=> [[cA limA]|[cA isoA]]; have := closure_isolated_limit_point A.
1085+
- move=> /(congr1 (fun x => x `\` limit_point A)).
1086+
rewrite setUDK.
1087+
by rewrite limA -(closure_id A).1// setDv.
1088+
by apply/disj_setPS; rewrite disj_set_sym disjoint_isolated_limit_point.
1089+
- by rewrite isoA set0U -(closure_id A).1.
1090+
Qed.
1091+
10811092
Lemma perfectTP {T} : perfect_set [set: T] <-> forall x : T, ~ open [set x].
10821093
Proof.
10831094
split.

theories/topology_theory/topology_structure.v

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(* mathcomp analysis (c) 2017 Inria and AIST. License: CeCILL-C. *)
1+
(* mathcomp analysis (c) 2025 Inria and AIST. License: CeCILL-C. *)
22
From HB Require Import structures.
33
From mathcomp Require Import all_ssreflect all_algebra finmap all_classical.
44
From mathcomp Require Export filter.
@@ -40,6 +40,7 @@ From mathcomp Require Export filter.
4040
(* x^' == set of neighbourhoods of x where x is *)
4141
(* excluded (a "deleted neighborhood") *)
4242
(* limit_point E == the set of limit points of E *)
43+
(* isolated A == the set of isolated points of A *)
4344
(* dense S == the set (S : set T) is dense in T, with T of *)
4445
(* type topologicalType *)
4546
(* continuousType == type of continuous functions *)
@@ -687,12 +688,43 @@ Proof. by rewrite limit_pointEnbhs; under eq_fun do rewrite meets_openr. Qed.
687688
Lemma subset_limit_point E : limit_point E `<=` closure E.
688689
Proof. by move=> t Et U tU; have [p [? ? ?]] := Et _ tU; exists p. Qed.
689690

690-
Lemma closure_limit_point E : closure E = E `|` limit_point E.
691+
Definition isolated (A : set T) (x : T) :=
692+
x \in A /\ exists2 V, nbhs x V & V `&` A = [set x].
693+
694+
Lemma isolatedS (A : set T) : isolated A `<=` A.
695+
Proof. by move=> x [/set_mem]. Qed.
696+
697+
Lemma disjoint_isolated_limit_point (A : set T) :
698+
[disjoint isolated A & limit_point A].
699+
Proof.
700+
apply/disj_setPS => t [[At [V tV]]] /[swap].
701+
move/(_ _ tV) => [x [xt Ax Vx]].
702+
have /[swap] -> : [set x] `<=` V `&` A by move=> ? ->; split.
703+
move/subset_set1 => [/seteqP[/(_ _ erefl)//]|].
704+
by move=> /seteqP[_ /(_ _ erefl)/=]; apply/eqP; rewrite eq_sym.
705+
Qed.
706+
707+
Lemma closure_isolated_limit_point (A : set T) :
708+
closure A = isolated A `|` limit_point A.
709+
Proof.
710+
apply/seteqP; split=> [t At0|t [|]].
711+
- rewrite /setU/= -implyNp => /not_andP[tA U /At0[x [Ux Ax]]|+ U tU].
712+
by exists x; split => //; contra: tA => <-; exact/mem_set.
713+
move/forall2NP => /(_ U)[//|/seteqP/not_andP[|]].
714+
by contra => H x [Ux Ax]; apply/eqP/negPn/negP => /H /(_ Ax).
715+
have [At tUA|At _] := pselect (A t).
716+
by absurd: tUA => _ ->; split => //; exact: nbhs_singleton.
717+
have [x [Ax Ux]] := At0 _ tU.
718+
by exists x; split => //; contra: At => <-.
719+
- by move/isolatedS; exact: subset_closure.
720+
- exact: subset_limit_point.
721+
Qed.
722+
723+
Lemma __deprecated__closure_limit_point E : closure E = E `|` limit_point E.
691724
Proof.
692-
rewrite predeqE => t; split => [cEt|]; last first.
725+
apply/seteqP; split => [|x]; last first.
693726
by case; [exact: subset_closure|exact: subset_limit_point].
694-
have [?|Et] := pselect (E t); [by left|right=> U tU; have [p []] := cEt _ tU].
695-
by exists p; split => //; apply/eqP => pt; apply: Et; rewrite -pt.
727+
by rewrite closure_isolated_limit_point => x [/isolatedS|]; [left|right].
696728
Qed.
697729

698730
Definition closed (D : set T) := closure D `<=` D.
@@ -749,6 +781,8 @@ Lemma closed_closure (A : set T) : closed (closure A).
749781
Proof. by move=> p clclAp B /nbhs_interior /clclAp [q [clAq /clAq]]. Qed.
750782

751783
End Closed.
784+
#[deprecated(since="mathcomp-analysis 1.15.0", note="use `closure_limit_point_isolated` instead")]
785+
Notation closure_limit_point := __deprecated__closure_limit_point (only parsing).
752786

753787
Lemma closed_comp {T U : topologicalType} (f : T -> U) (D : set U) :
754788
{in ~` f @^-1` D, continuous f} -> closed D -> closed (f @^-1` D).

0 commit comments

Comments
 (0)