Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zorn lemma for inclusion #978

Merged
merged 2 commits into from
Jul 20, 2023
Merged

Conversation

affeldt-aist
Copy link
Member

@affeldt-aist affeldt-aist commented Jul 17, 2023

Motivation for this change

Corollary of Zorn's lemma.
It has a new on its own (https://fr.wikipedia.org/wiki/Lemme_de_Zorn#Principes_de_maximalit%C3%A9_pour_l'inclusion) and happens to be exactly what we need for Vitali's lemma (PR #973 )

@t6s

Things done/to do
  • added corresponding entries in CHANGELOG_UNRELEASED.md
  • added corresponding documentation in the headers
Compatibility with MathComp 2.0
  • I added the label TODO: HB port to make sure someone ports this PR to
    the hierarchy-builder branch or I already opened an issue or PR (please cross reference).
Automatic note to reviewers

Read this Checklist and put a milestone if possible.

Co-authored-by: Takafumi Saikawa <[email protected]>
@affeldt-aist affeldt-aist added enhancement ✨ This issue/PR is about adding new features enhancing the library TODO: MC2 port This PR must be ported to mathcomp 2 now that the. Remove this label when the port is done. labels Jul 17, 2023
@affeldt-aist affeldt-aist added this to the 0.6.4 milestone Jul 17, 2023
Comment on lines 2722 to 2744
Section Zorn_subset.
Variables (T : Type) (P : set T -> Prop).
Let sigP := {x | P x}.
Let R (sA sB : sigP) := sval sA `<=` sval sB.

Lemma Zorn_bigcup :
(forall F, total_on F R -> P (\bigcup_(x in F) sval x)) ->
exists A, P A /\ forall B, A `<` B -> ~ P B.
Proof.
move=> totR.
have {}totR F : total_on F R -> exists sB, forall sA, F sA -> R sA sB.
by move=> FR; exists (exist _ _ (totR _ FR)) => sA FsA; exact: bigcup_sup.
have [| | |sA sAmax] := Zorn _ _ _ totR.
- by move=> ?; exact: subset_refl.
- by move=> ? ? ?; exact: subset_trans.
- by move=> [A PA] [B PB]; rewrite /R /= => AB BA; exact/eq_exist/seteqP.
- exists (sval sA); case: sA => A PA in sAmax *; split => //= B AB PB.
have [BA] := sAmax (exist _ B PB) (properW AB).
by move: AB; rewrite BA; exact: properxx.
Qed.

End Zorn_subset.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks strange to me to introduce the artifact R in the statement.
I would rather phrase it like this:

Section Zorn_subset.
Variables (T : Type) (P : set (set T)).

Lemma Zorn_bigcup :
    (forall F : set (set T), F `<=` P -> total_on F subset -> P (\bigcup_(X in F) X)) ->
  exists A, P A /\ forall B, A `<` B -> ~ P B.
Proof.
move=> totP; pose R (sA sB : P) := sval sA `<=` sval sB.
have {}totR F (FR : total_on F R) : exists sB, forall sA, F sA -> R sA sB.
   have FP : [set val x | x in F] `<=` P.
     by move=> _ [X FX <-]; apply: set_mem; apply: valP.
   have totF : total_on [set val x | x in F] subset.
     by move=> _ _ [X FX <-] [Y FY <-]; apply: FR.
   exists (SigSub (mem_set (totP _ FP totF))) => A FA; rewrite /R/=.
   exact: (bigcup_sup (imageP val _)).
have [| | |sA sAmax] := Zorn _ _ _ totR.
- by move=> ?; exact: subset_refl.
- by move=> ? ? ?; exact: subset_trans.
- by move=> [A PA] [B PB]; rewrite /R /= => AB BA; exact/eq_exist/seteqP.
- exists (val sA); case: sA => A PA /= in sAmax *; split; first exact: set_mem.
  move=> B AB PB; have [BA] := sAmax (SigSub (mem_set PB)) (properW AB).
  by move: AB; rewrite BA; exact: properxx.
Qed.

End Zorn_subset.

Is it better or worse in the real usecases?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The effect of the change can be observed in the diff of the commit
f2a57df

file before: lines 2260-2270
file after: lines 2302-2311

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see... I still think it's worth it ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I guess we can merge?

Co-authored-by: Cyril Cohen <[email protected]>
@affeldt-aist affeldt-aist merged commit 5da813c into math-comp:master Jul 20, 2023
@affeldt-aist affeldt-aist deleted the Zorn_inclusion branch July 20, 2023 09:13
affeldt-aist added a commit to affeldt-aist/analysis that referenced this pull request Jul 20, 2023
* Zorn lemma for inclusion

Co-authored-by: Takafumi Saikawa <[email protected]>
Co-authored-by: Cyril Cohen <[email protected]>
proux01 pushed a commit that referenced this pull request Jul 21, 2023
* Zorn lemma for inclusion

Co-authored-by: Takafumi Saikawa <[email protected]>
Co-authored-by: Cyril Cohen <[email protected]>
@proux01 proux01 removed the TODO: MC2 port This PR must be ported to mathcomp 2 now that the. Remove this label when the port is done. label Jul 21, 2023
IshiguroYoshihiro pushed a commit to IshiguroYoshihiro/analysis that referenced this pull request Sep 7, 2023
* Zorn lemma for inclusion

Co-authored-by: Takafumi Saikawa <[email protected]>
Co-authored-by: Cyril Cohen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ This issue/PR is about adding new features enhancing the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants