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

Wochoice #1198

Merged
merged 2 commits into from
Aug 6, 2024
Merged

Wochoice #1198

merged 2 commits into from
Aug 6, 2024

Conversation

Tragicus
Copy link
Collaborator

@Tragicus Tragicus commented Mar 28, 2024

(reopening of #1173 )

Adds a proof of Zorn's lemma, Hausdorff maximal principle and the well ordering principle.

Motivation for this change
Checklist
  • added corresponding entries in CHANGELOG_UNRELEASED.md
  • added corresponding documentation in the headers

Reference: How to document

Reminder to reviewers

@Tragicus Tragicus mentioned this pull request Mar 28, 2024
2 tasks
@proux01
Copy link
Collaborator

proux01 commented Mar 28, 2024

FTR, this is a reopening of #1173 following my unwanted merge there.

@affeldt-aist affeldt-aist added the enhancement ✨ This issue/PR is about adding new features enhancing the library label Apr 1, 2024
@affeldt-aist
Copy link
Member

I think that we'd like to use wochoice.v in classical_sets.v but the simple fact of Require Importing wochoice in classical_sets.v leads to:

File "./theories/derive.v", line 5, characters 0-79:
Error: Universe inconsistency. Cannot enforce
mathcomp.field.algebraics_fundamentals.48897 <= Coq.ssr.ssrfun.107 because
Coq.ssr.ssrfun.107 < Num.ArchimedeanField.type.u0
<= mathcomp.field.algebraics_fundamentals.48897.

I vaguely remember that we already ran into that kind of problem. What can I do?

@affeldt-aist
Copy link
Member

@proux01 @CohenCyril any quick hint? (We are in the process of deriving our Zorn's lemmas from Georges'.)

@proux01
Copy link
Collaborator

proux01 commented Apr 11, 2024

The first difficulty is to understand where the universe constraint(s) comes from. The best way I know to find out is to use Print Universes Subgraph a b. https://coq.inria.fr/doc/V8.19.0/refman/addendum/universe-polymorphism.html#coq:cmd.Print-Universes with a and b the two problematic universes and perform a dichotomy with requires (then inlining the problematic one or pursuing the dichotomy in the given file, and so on). Once the source of the issue is found, it should be understood if it is intrinsic to the statement or could be removed by modifying the proof / some definition.

@affeldt-aist
Copy link
Member

@proux01 Thank you for the pointer! (I didn't know.)

I was able to avoid the universe inconsistency without really understanding it by just removing useless Require Import's, which means that I have just postponed the problem. :-/

As far as the PR is concerned, I just tried to derive existing Zorn's lemmas using @ggonthier 's to avoid duplicates.

There is certainly more to do since some definitions in pred duplicate existing definitions in set (upper_bound vs. ubound, nonempty, etc.).

@affeldt-aist affeldt-aist added this to the 1.2.0 milestone Apr 11, 2024
@affeldt-aist affeldt-aist modified the milestones: 1.2.0, 1.3.0 Jun 5, 2024
@affeldt-aist
Copy link
Member

There is certainly more to do since some definitions in pred duplicate existing definitions in set (upper_bound vs. ubound, nonempty, etc.).

This topic was discussed during a mathcomp-analysis-dev meeting:

https://github.com/math-comp/analysis/wiki/2024-04-16-Meeting

The conclusion was to integrate this PR, keeping bool/Prop duplicates, favoring Prop in general
and using local patches to connected with bool precicates.

@affeldt-aist affeldt-aist modified the milestones: 1.3.0, 1.4.0 Aug 1, 2024
@affeldt-aist affeldt-aist self-requested a review August 1, 2024 03:45
Copy link
Member

@affeldt-aist affeldt-aist left a comment

Choose a reason for hiding this comment

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

This PR newly introduces difficult standard lemmas that we have been able to use to revise and shorten classical_sets.v. Sure, it introduces definitions that are likely to move to MathComp and that are bool-variants of existing definitions in Prop but we won't clear that up in the very near future so we'd better merge and come back to it imo.

@affeldt-aist affeldt-aist modified the milestones: 1.4.0, 1.3.0 Aug 1, 2024
@affeldt-aist
Copy link
Member

@ggonthier ok with merging?

Co-authored-by: Georges Gonthier <[email protected]>
@affeldt-aist
Copy link
Member

@Tragicus had a look (including the changelog) so I might merge today to release.

- CI fix to please Coq 8.16
- change copyright after consulting georges
- changelog and doc
@affeldt-aist affeldt-aist merged commit 2362c9b into math-comp:master Aug 6, 2024
22 checks passed
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