Skip to content

Commit 2283230

Browse files
committed
splitting in more elementary pieces + proof simplifications
1 parent 1209bec commit 2283230

File tree

3 files changed

+63
-56
lines changed

3 files changed

+63
-56
lines changed

classical/cardinality.v

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,9 @@ Lemma finite_set0 T : finite_set (set0 : set T).
531531
Proof. by apply/finite_setP; exists 0%N; rewrite II0. Qed.
532532
#[global] Hint Resolve finite_set0 : core.
533533

534+
Lemma infinite_setN0 {T} (A : set T) : infinite_set A -> A !=set0.
535+
Proof. by rewrite -set0P; apply: contra_not_neq => ->. Qed.
536+
534537
Lemma finite_seqP {T : eqType} A :
535538
finite_set A <-> exists s : seq T, A = [set` s].
536539
Proof.
@@ -565,6 +568,7 @@ Qed.
565568
Lemma finite_set_countable T (A : set T) : finite_set A -> countable A.
566569
Proof. by move=> /finite_setP[n /eq_countable->]. Qed.
567570

571+
568572
Lemma infiniteP T (A : set T) : infinite_set A <-> [set: nat] #<= A.
569573
Proof.
570574
elim/Ppointed: T => T in A *.
@@ -681,6 +685,14 @@ pose fP := @finite_fsetP {classic T}; rewrite propeqE; split.
681685
by case=> /fP[X->]/fP[Y->]; apply/fP; exists (X `|` Y)%fset; rewrite set_fsetU.
682686
Qed.
683687

688+
Lemma infinite_setI {T} (A B : set T) : infinite_set A -> finite_set B ->
689+
infinite_set (A `\` B).
690+
Proof.
691+
move=> + Bfin; apply: contra_not => ADBfin.
692+
have: finite_set ((A `\` B) `|` B) by rewrite finite_setU.
693+
by apply: sub_finite_set; rewrite setUDl setDv setD0.
694+
Qed.
695+
684696
Lemma finite_set2 T (x y : T) : finite_set [set x; y].
685697
Proof. by rewrite !finite_setU; split; apply: finite_set1. Qed.
686698
#[global] Hint Resolve finite_set2 : core.

classical/classical_sets.v

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,15 @@ Qed.
710710

711711
Lemma setDE A B : A `\` B = A `&` ~` B. Proof. by []. Qed.
712712

713+
Lemma setUDl A B C : (A `\` B) `|` C = (A `|` C) `\` (B `\` C).
714+
Proof.
715+
apply/seteqP; split => x /=; first tauto.
716+
by move=> [[a|c]]; rewrite not_andE notE; tauto.
717+
Qed.
718+
719+
Lemma setUDr A B C : A `|` (B `\` C) = (A `|` B) `\` (C `\` A).
720+
Proof. by rewrite setUC setUDl setUC. Qed.
721+
713722
Lemma setDUK A B : A `<=` B -> A `|` (B `\` A) = B.
714723
Proof.
715724
move=> AB; apply/seteqP; split=> [x [/AB//|[//]]|x Bx].

theories/sequences.v

Lines changed: 42 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2973,63 +2973,49 @@ Qed.
29732973
End adjacent_cut.
29742974

29752975
Section finite_range_sequence_constant.
2976-
Context {R : realFieldType}.
29772976

2978-
Lemma finite_range_cst (u_ : R^nat) : finite_set (range u_) ->
2979-
exists N, exists2 A, infinite_set A & (forall k, A k <-> u_ k = u_ N).
2980-
Proof.
2981-
case=> n; elim: n => [|n ih] in u_ *.
2982-
by rewrite card_eq_sym => /card_set_bijP[/= f [_ _ /(_ _ (imageT u_ 0))[]]].
2983-
move/eq_cardSP => -[r [N _ uNr]] urn.
2984-
apply: assume_not => /forallNP/(_ N) uN.
2985-
have {uN}[B finB BuN] : exists2 B, finite_set B &
2986-
(forall k, B k <-> u_ k = u_ N).
2987-
exists (u_ @^-1` [set u_ N]); last by move=> k; split.
2988-
by apply: contrapT => u_N; apply: uN; eexists; [exact: u_N|by []].
2989-
have [M BM] : exists M, ~ B M.
2990-
apply/existsNP => allB.
2991-
move: finB; rewrite (_ : B = setT); first exact/infinite_nat.
2992-
by rewrite -subTset => x _; exact: allB.
2993-
have uMuN : u_ M != u_ N by apply: contra_not_neq BM; exact: (BuN _).2.
2994-
pose v_ k := if k \in B then u_ M else u_ k.
2995-
have /ih[k [A infA Ak]] : (range v_ #= `I_n)%card.
2996-
suff : range v_ = (range u_) `\ u_ N by move=> ->; rewrite uNr.
2997-
apply/seteqP; split=> [_ [y] _ <-|_ [[y _ <-]] uyuN]; rewrite /v_.
2998-
- case: ifPn => [yB|]; first by split; [exists M|exact/eqP].
2999-
by rewrite notin_setE => /BuN.
3000-
- by exists y => //; case: ifPn => // /set_mem /BuN.
3001-
have [Bk|Bk] := pselect (B k).
3002-
- exists M, (A `\` B); [exact: infinite_setD|move=> m; split=> [[+ Bm]|]].
3003-
+ by move/(Ak _).1; rewrite /v_ memNset// mem_set.
3004-
+ apply: contraPP; rewrite -[~ _]/((~` (_ `\` _)) m) setCD => -[|/BuN ->].
3005-
* have /iff_not2[+ _] := Ak m.
3006-
by move/[apply]; rewrite /v_; case: ifPn => mB; rewrite mem_set// eqxx.
3007-
* exact/nesym/eqP.
3008-
- exists k, (A `\` B); [exact: infinite_setD|move=> m].
3009-
split=> [[+ Bm]|]; first by move/(Ak _).1; rewrite /v_ memNset// memNset.
3010-
apply: contraPP; rewrite -[~ _]/((~` (_ `\` _)) m) setCD => -[|Bm].
3011-
+ have /iff_not2[+ _] := Ak m.
3012-
move=> /[apply]; rewrite /v_; case: ifPn => mB; rewrite memNset//.
3013-
by move: mB Bk => /set_mem /BuN -> /BuN /nesym.
3014-
+ have /iff_not2[+ _] := BuN k.
3015-
by move=> /(_ Bk); apply: contra_not; rewrite ((BuN m).1 Bm).
3016-
Qed.
3017-
3018-
Lemma finite_range_cvg (x_ : R ^nat) : finite_set (range x_) ->
3019-
exists2 f : nat -> nat, increasing_seq f & cvgn (x_ \o f).
3020-
Proof.
3021-
move=> /finite_range_cst[k [A /infiniteP/pcard_leP/unsquash f Ak]].
3022-
have : forall n, {y | (n < y)%N /\ A y}.
3023-
move=> n; apply/cid.
3024-
have [m xfm] : exists m, (n < f m)%N by exact: injectiveT_ltn.
3025-
by exists (f m); split => //; exact: funS.
3026-
move/dependent_choice => /(_ 0)[g [g00 gincr]].
3027-
exists g; first by apply/increasing_seqP => n; exact: (gincr _).1.
3028-
apply/cvg_ex; exists (x_ k); apply/cvgrPdist_le => /= e e0.
3029-
near=> n.
3030-
have := (gincr n.-1).2; rewrite prednK; last by near: n; by exists 1%N.
3031-
by move/(Ak (g n)).1 => ->; rewrite subrr normr0 ltW.
3032-
Unshelve. all: end_near. Qed.
2977+
Lemma finite_range_cst {T} (u_ : T^nat) : finite_set (range u_) ->
2978+
exists x, exists2 A, infinite_set A & (forall k, A k <-> u_ k = x).
2979+
Proof.
2980+
move=> range_u_finite; pose A x := u_ @^-1` [set x].
2981+
suff [x Aoo] : exists x, infinite_set (A x) by exists x, (A x) => // k.
2982+
apply/existsNP => Afin.
2983+
have: finite_set (\bigcup_(x in range u_) A x) by exact: bigcup_finite.
2984+
rewrite -preimage_bigcup bigcup_imset1 image_id preimage_range.
2985+
exact: infinite_nat.
2986+
Qed.
2987+
2988+
Lemma infinite_increasing_seq {d} {T : orderType d} (A : set T) :
2989+
(forall x, infinite_set [set y | A y /\ (x < y)%O]) ->
2990+
forall x0 : T, exists f, [/\ increasing_seq f, forall n : nat, (x0 < f n)%O & forall n, A (f n)].
2991+
Proof.
2992+
pose R (x y : T) := A y /\ (x < y)%O => Roo x0.
2993+
have [x|f [f0 /all_and2[fA fS]]] := @dependent_choice T R _ x0.
2994+
by have /infinite_setN0/cid := Roo x.
2995+
exists (f \o S); split => //=; first by apply/increasing_seqP => n; apply: fS.
2996+
by elim=> /= [|n IHn]; rewrite (le_lt_trans _ (fS _)) ?f0//= ltW.
2997+
Qed.
2998+
2999+
Lemma infinite_increasing_seq_wf {d} {T : orderType d} (A : set T) :
3000+
(forall x : T, finite_set [set y | (y <= x)%O]) -> infinite_set A ->
3001+
forall x0 : T, exists f,[/\ increasing_seq f, forall n : nat, (x0 < f n)%O & forall n, A (f n)].
3002+
Proof.
3003+
move=> down_fin Aoo; apply: infinite_increasing_seq.
3004+
move=> x; suff -> : [set y | A y /\ (x < y)%O] = A `\` [set y | (y <= x)%O].
3005+
exact: infinite_setI.
3006+
by apply/seteqP; split => y /=; case: leP => _ [].
3007+
Qed.
3008+
3009+
Lemma finite_range_cvg {T : ptopologicalType} (x_ : T ^nat) :
3010+
finite_set (range x_) ->
3011+
exists2 f : nat -> nat, increasing_seq f & cvg ((x_ \o f) @ \oo).
3012+
Proof.
3013+
move=> /finite_range_cst[x [A Aoo Ax_]].
3014+
have /= [|f [fincr _ Af]] := infinite_increasing_seq_wf _ Aoo 0.
3015+
by move=> n; apply: sub_finite_set (finite_II n.+1) => m /=.
3016+
exists f => //=; suff -> : x_ \o f = fun=> x by apply: is_cvg_cst.
3017+
by apply/funext => k /=; rewrite (Ax_ _).1.
3018+
Qed.
30333019

30343020
End finite_range_sequence_constant.
30353021

0 commit comments

Comments
 (0)