@@ -2026,6 +2026,8 @@ apply: (subset_trans (closed_ball_subset _ _) xrB) => //=.
20262026by rewrite lter_pdivrMr // ltr_pMr // ltr1n.
20272027Qed .
20282028
2029+ End Closed_Ball_normedModType.
2030+
20292031Lemma open_subball {R : numFieldType} {M : normedModType R} (A : set M)
20302032 (x : M) : open A -> A x -> \forall e \near 0^'+, ball x e `<=` A.
20312033Proof .
@@ -2047,13 +2049,6 @@ move=> x /= + x0; rewrite sub0r normrN gtr0_norm// => xe.
20472049by move: ze2K0; apply: subsetI_eq0 => //=; exact: closed_ball_subset.
20482050Qed .
20492051
2050- Lemma locally_compactR (R : realType) : locally_compact [set: R].
2051- Proof .
2052- move=> x _; rewrite withinET; exists (closed_ball x 1).
2053- by apply/nbhs_closedballP; exists 1%:pos.
2054- by split; [apply: closed_ballR_compact | apply: closed_ball_closed].
2055- Qed .
2056-
20572052Lemma interior_closed_ballE (R : realType) (V : normedModType R) (x : V)
20582053 (r : R) : 0 < r -> (closed_ball x r)° = ball x r.
20592054Proof .
@@ -2078,4 +2073,251 @@ move=> r0; split; first exact: open_interior.
20782073by rewrite interior_closed_ballE //; exact: ballxx.
20792074Qed .
20802075
2081- End Closed_Ball_normedModType.
2076+ Lemma locally_compactR (R : realType) : locally_compact [set: R].
2077+ Proof .
2078+ move=> x _; rewrite withinET; exists (closed_ball x 1).
2079+ by apply/nbhs_closedballP; exists 1%:pos.
2080+ by split; [apply: closed_ballR_compact | apply: closed_ball_closed].
2081+ Qed .
2082+
2083+ Section bigcup_ointsub_lemmas.
2084+ Context {R : realType} {U : set R}.
2085+
2086+ Lemma bigcup_ointsubxx q : open U -> U (ratr q) ->
2087+ ratr q \in bigcup_ointsub U q.
2088+ Proof .
2089+ move=> oU Uq.
2090+ have [e /= e0 eU] := open_subball oU Uq.
2091+ pose B := ball (@ratr R q) (e / 2).
2092+ have Bq : B (ratr q) by apply: ballxx; rewrite divr_gt0.
2093+ apply/mem_set; exists B => //; split => //; split.
2094+ - by apply: ball_open; rewrite divr_gt0.
2095+ - by rewrite /B ball_itv; exact: interval_is_interval.
2096+ - apply: eU => //; last by rewrite divr_gt0.
2097+ rewrite ball_normE/= /ball/= sub0r normrN gtr0_norm ?divr_gt0//.
2098+ by rewrite gtr_pMr// invf_lt1// ltr1n.
2099+ Qed .
2100+
2101+ Lemma nondisjoint_bigcup_ointsub (p q : rat) :
2102+ bigcup_ointsub U p `&` bigcup_ointsub U q !=set0 ->
2103+ bigcup_ointsub U p = bigcup_ointsub U q.
2104+ Proof .
2105+ move=> [x /= [[A [[oA itvA AU Ap Ax]]] [B [[oB itvB BU Bq Bx]]]]].
2106+ rewrite eqEsubset; split.
2107+ - apply: bigcup_ointsub_sup.
2108+ + exact: open_bigcup_ointsub.
2109+ + exact: is_interval_bigcup_ointsub.
2110+ + exact: bigcup_ointsub_sub.
2111+ + exists (A `|` B) => /= ; last by right.
2112+ split; last by left.
2113+ split; [exact: openU| |by rewrite subUset].
2114+ apply/connected_intervalP/connectedU; [|exact/connected_intervalP..].
2115+ by exists x.
2116+ - apply: bigcup_ointsub_sup.
2117+ + exact: open_bigcup_ointsub.
2118+ + exact: is_interval_bigcup_ointsub.
2119+ + exact: bigcup_ointsub_sub.
2120+ + exists (A `|` B) => /= ; last by left.
2121+ split; last by right.
2122+ split; [exact: openU| |by rewrite subUset].
2123+ apply/connected_intervalP/connectedU; [|exact/connected_intervalP..].
2124+ by exists x.
2125+ Qed .
2126+
2127+ End bigcup_ointsub_lemmas.
2128+
2129+ (**md proof that an open set of real numbers can be written as
2130+ the union of disjoint open intervals *)
2131+ Module OpenSetDisjointItvs.
2132+ Section opensetdisjointitvs.
2133+ Context {R : realType}.
2134+ Variable U : set R.
2135+ Hypothesis oU : open U.
2136+
2137+ (**md We first work out a proof where disjoint open intervals are indexed by
2138+ rational numbers. The "sequence" of open intervals in question is
2139+ `lt_disjoint_rat_seq`. This is the "sequence" of `bigcup_ointsub U` that
2140+ are non-overlapping. *)
2141+ Section rat_index.
2142+ Variables (f : rat -> nat) (g : nat -> rat).
2143+ Hypotheses (cfg : cancel f g) (cgf : cancel g f).
2144+
2145+ Definition lt_disjoint := [set q | forall p, U (ratr p) ->
2146+ (f p < f q)%N -> bigcup_ointsub U q `&` bigcup_ointsub U p = set0].
2147+
2148+ Let bigcup_lt_disjoint :
2149+ U = \bigcup_(q in lt_disjoint) bigcup_ointsub U q.
2150+ Proof .
2151+ rewrite [LHS]open_bigcup_rat//; apply/seteqP; split => /=; last first.
2152+ by move=> r [q/= ?] Uqr; exists q => //=; exact: bigcup_ointsub_mem Uqr.
2153+ move=> r [q/= Uq] Uqr.
2154+ suff [p_idx [pUq Up]] : exists p_idx,
2155+ let p := g p_idx in ratr p \in bigcup_ointsub U q /\
2156+ forall q', ratr q' \in bigcup_ointsub U q -> (f p <= f q')%N.
2157+ have q_p : bigcup_ointsub U q `&` bigcup_ointsub U (g p_idx) !=set0.
2158+ exists (ratr (g p_idx)); split; first exact/set_mem.
2159+ apply/set_mem; rewrite bigcup_ointsubxx//.
2160+ by move/set_mem : pUq; exact: bigcup_ointsub_sub.
2161+ exists (g p_idx).
2162+ - rewrite /= => q' Uq' q'p.
2163+ apply/notP => /eqP/set0P[s [ps ts]].
2164+ suff : ratr q' \in bigcup_ointsub U q by move/Up; rewrite leqNgt q'p.
2165+ rewrite (@nondisjoint_bigcup_ointsub _ _ _ (g p_idx))//.
2166+ rewrite (@nondisjoint_bigcup_ointsub _ _ _ q') ?bigcup_ointsubxx//.
2167+ by exists s.
2168+ - by rewrite (@nondisjoint_bigcup_ointsub _ _ _ q)// setIC.
2169+ pose P := [pred i : 'I_(f q).+1 | ratr (g i) \in bigcup_ointsub U q].
2170+ have Pord_max : P ord_max.
2171+ by rewrite /P/= cfg// bigcup_ointsubxx//; exact/set_mem.
2172+ pose min : 'I_(f q).+1 := [arg min_(i < ord_max | P i) idfun i].
2173+ exists min => /=; split.
2174+ - by rewrite /min; case: arg_minnP.
2175+ - move=> q' pUp; rewrite /min; case: arg_minnP => //= i giq ismall.
2176+ rewrite cgf.
2177+ have [fq'fq|fqfq'] := ltnP (f q') (f q).+1.
2178+ have := ismall (Ordinal fq'fq).
2179+ by rewrite cfg => /(_ pUp).
2180+ by rewrite (leq_trans _ (ltnW fqfq'))// (ismall ord_max).
2181+ Qed .
2182+
2183+ Let lt_disjoint_rat_seq0 q : set R :=
2184+ if pselect (lt_disjoint q) then bigcup_ointsub U q else set0.
2185+
2186+ Let lt_disjoint_rat_seq0_trivIset : trivIset (U \o ratr) lt_disjoint_rat_seq0.
2187+ Proof .
2188+ apply/trivIsetP => /= i j Ui Uj.
2189+ wlog : i j Ui Uj / i < j.
2190+ move=> wlg; rewrite neq_lt => /orP[|] ij.
2191+ by rewrite wlg// lt_eqF.
2192+ by rewrite setIC wlg// lt_eqF.
2193+ move=> ij _.
2194+ rewrite /lt_disjoint_rat_seq0/=.
2195+ case: pselect => disj_i; case: pselect => disj_j; rewrite ?(setI0,set0I)//.
2196+ have [?|fjfi] := ltnP (f i) (f j); first by rewrite setIC disj_j.
2197+ rewrite disj_i// ltn_neqAle fjfi andbT.
2198+ have : i != j by rewrite lt_eqF.
2199+ apply: contra => /eqP.
2200+ by move/can_inj : cfg => /[apply] => /esym/eqP.
2201+ Qed .
2202+
2203+ Let lt_disjoint_rat_seq0_comp_trivIset :
2204+ trivIset (U \o ratr \o g) (lt_disjoint_rat_seq0 \o g).
2205+ Proof .
2206+ apply/trivIsetP => i j/= Ugi Ugj ij.
2207+ move/trivIsetP : lt_disjoint_rat_seq0_trivIset => /(_ (g i) (g j)) /=.
2208+ by apply => //; apply: contra ij; move/eqP/(can_inj cgf)/eqP.
2209+ Qed .
2210+
2211+ Let lt_disjoint_rat_seq0_set0 q :
2212+ ratr q \notin U -> lt_disjoint_rat_seq0 q = set0.
2213+ Proof .
2214+ move=> qU.
2215+ rewrite /lt_disjoint_rat_seq0; case: pselect => //= disj_q.
2216+ rewrite /bigcup_ointsub bigcup0// => B/=[[]oB iB].
2217+ by move=> /[apply] /mem_set; rewrite (negPf qU).
2218+ Qed .
2219+
2220+ Let lt_disjoint_rat_seq0_open_itv q :
2221+ open (lt_disjoint_rat_seq0 q) /\ is_interval (lt_disjoint_rat_seq0 q).
2222+ Proof .
2223+ split.
2224+ - rewrite /lt_disjoint_rat_seq0; case: pselect => //= _.
2225+ + exact: open_bigcup_ointsub.
2226+ + exact: open0.
2227+ - rewrite /lt_disjoint_rat_seq0; case: pselect => //= _.
2228+ + exact: is_interval_bigcup_ointsub.
2229+ + by [].
2230+ Qed .
2231+
2232+ Let bigcup_lt_disjoint_rat_seq0 : U = \bigcup_q lt_disjoint_rat_seq0 q.
2233+ Proof .
2234+ rewrite bigcup_lt_disjoint bigcup_mkcond; apply: eq_bigcup => // q _.
2235+ rewrite /lt_disjoint_rat_seq0; case: pselect => //= Icondq.
2236+ - by rewrite mem_set.
2237+ - by rewrite memNset.
2238+ Qed .
2239+
2240+ Let bigcup_U_lt_disjoint_rat_seq :
2241+ U = \bigcup_(q in [set n | U (ratr n)]) lt_disjoint_rat_seq0 q.
2242+ Proof .
2243+ rewrite [LHS]bigcup_lt_disjoint_rat_seq0 [RHS]bigcup_mkcond.
2244+ apply: eq_bigcupr => q _; case: ifPn => //.
2245+ rewrite notin_setE/= => Uq.
2246+ by rewrite lt_disjoint_rat_seq0_set0// memNset.
2247+ Qed .
2248+
2249+ Definition lt_disjoint_rat_seq q : set R :=
2250+ if ratr q \in U then lt_disjoint_rat_seq0 q else set0.
2251+
2252+ Lemma lt_disjoint_rat_seq_open_itv q :
2253+ open (lt_disjoint_rat_seq q) /\ is_interval (lt_disjoint_rat_seq q).
2254+ Proof . by rewrite /lt_disjoint_rat_seq; case: ifPn => qU//; split. Qed .
2255+
2256+ Lemma lt_disjoint_rat_seq_trivIset : trivIset setT (lt_disjoint_rat_seq \o g).
2257+ Proof .
2258+ move/trivIset_mkcond: lt_disjoint_rat_seq0_trivIset => // /trivIsetP H.
2259+ apply/trivIsetP => i j/= _ _ ij.
2260+ rewrite /lt_disjoint_rat_seq; case: ifPn => //; rewrite ?(setI0,set0I)//.
2261+ rewrite /lt_disjoint_rat_seq0; case: pselect => /=; rewrite ?(setI0,set0I)//.
2262+ case: ifPn => //; rewrite ?(setI0,set0I)//.
2263+ case: pselect => /=; rewrite ?(setI0,set0I)//.
2264+ move=> disj_gj gjU K3 K4.
2265+ have := H (g i) (g j) Logic.I Logic.I.
2266+ rewrite !ifT//.
2267+ rewrite /lt_disjoint_rat_seq0/=; case: pselect => //=; case: pselect => //= _ _.
2268+ apply.
2269+ by apply: contra ij => /eqP/(can_inj cgf)/eqP.
2270+ Qed .
2271+
2272+ Lemma bigcup_lt_disjoint_rat_seq : U = \bigcup_q lt_disjoint_rat_seq q.
2273+ Proof .
2274+ rewrite [LHS]bigcup_U_lt_disjoint_rat_seq.
2275+ rewrite [in LHS]bigcup_mkcond [in RHS]bigcup_mkcond.
2276+ apply: eq_bigcupr => q _.
2277+ by rewrite [in RHS]mem_set.
2278+ Qed .
2279+
2280+ End rat_index.
2281+
2282+ (**md now the proof where disjoint open intervals are indexed by
2283+ natural numbers *)
2284+ Lemma open_disjoint_itv : exists I : nat -> set R,
2285+ [/\ forall q, open (I q) /\ is_interval (I q),
2286+ trivIset setT I & U = \bigcup_q I q].
2287+ Proof .
2288+ have /card_set_bijP[/= f] := card_rat.
2289+ rewrite setTT_bijective => -[g cfg cgf].
2290+ exists (lt_disjoint_rat_seq f \o g); split.
2291+ - by move=> n; exact: lt_disjoint_rat_seq_open_itv.
2292+ - exact: lt_disjoint_rat_seq_trivIset.
2293+ - rewrite (bigcup_lt_disjoint_rat_seq cfg cgf) [LHS](reindex_bigcup g setT)//.
2294+ by move=> q/= _; exists (f q).
2295+ Qed .
2296+
2297+ End opensetdisjointitvs.
2298+ End OpenSetDisjointItvs.
2299+
2300+ (* proof that an open set of real numbers can be written as
2301+ the union of disjoint open intervals *)
2302+ Section open_set_disjoint_real_intervals.
2303+ Context {R : realType}.
2304+ Variable U : set R.
2305+ Hypothesis oU : open U.
2306+
2307+ (* the sequence of non-overlapping open intervals that cover U *)
2308+ Definition open_disjoint_itv : nat -> set R :=
2309+ sval (cid (OpenSetDisjointItvs.open_disjoint_itv oU)).
2310+
2311+ Lemma open_disjoint_itv_open i : open (open_disjoint_itv i).
2312+ Proof . by rewrite /open_disjoint_itv; case: cid => //= I [/(_ i)[]]. Qed .
2313+
2314+ Lemma open_disjoint_itv_is_interval i : is_interval (open_disjoint_itv i).
2315+ Proof . by rewrite /open_disjoint_itv; case: cid => //= I [/(_ i)[]]. Qed .
2316+
2317+ Lemma open_disjoint_itv_trivIset : trivIset [set: nat] open_disjoint_itv.
2318+ Proof . by rewrite /open_disjoint_itv; case: cid => //= I [_]. Qed .
2319+
2320+ Lemma open_disjoint_itv_bigcup : U = \bigcup_q open_disjoint_itv q.
2321+ Proof . by rewrite /open_disjoint_itv; case: cid => //= I [_]. Qed .
2322+
2323+ End open_set_disjoint_real_intervals.
0 commit comments