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

Mapping for int_div, int_rem and bunch of other int notions #6

Merged
merged 31 commits into from
Feb 18, 2025
Merged

Conversation

TheoWinterhalter
Copy link
Contributor

@TheoWinterhalter TheoWinterhalter commented Feb 12, 2025

This PR proposes multiple alignments, mostly for integers, and sometimes for some real notions that are required as dependencies.

I also proved some util lemmas for COND and I don't know where to put them. Maybe the code should be refactored to use other COND lemmas instead.


This PR also introduces some handy tactics such as ext to perform apply fun_ext followed by intro and a tactic align_ε to prove equalities where the RHS is ε applied to an arbitrary number of arguments, and getting rid of those that are useless like tags (then the proof doesn't have to even mention it).


The work on Z.lcm was a collaboration with @NotBad4U.

@TheoWinterhalter TheoWinterhalter changed the title Mapping for Zdiv and Zrem Mapping for int_div and int_rem Feb 13, 2025
@TheoWinterhalter TheoWinterhalter changed the title Mapping for int_div and int_rem Mapping for int_div, int_rem and bunch of other int notions Feb 13, 2025
@TheoWinterhalter TheoWinterhalter force-pushed the div branch 2 times, most recently from 732b937 to bf3658e Compare February 14, 2025 13:15
TheoWinterhalter and others added 3 commits February 14, 2025 14:16
Co-authored-by: Alessio Coltellacci <[email protected]>
Co-authored-by: Alessio Coltellacci <[email protected]>
Co-authored-by: Alessio Coltellacci <[email protected]>
@fblanqui fblanqui merged commit 695cd91 into main Feb 18, 2025
8 of 12 checks passed
@fblanqui fblanqui deleted the div branch February 18, 2025 09:15
@fblanqui
Copy link
Member

Thank you @TheoWinterhalter !


Lemma int_lcm_def :
int_lcm =
(fun _30961 : prod Z Z => @COND Z ((Z.mul (@fst Z Z _30961) (@snd Z Z _30961)) = (Z_of_N (NUMERAL 0%N))) (Z_of_N (NUMERAL 0%N)) (Z.div (Z.abs (Z.mul (@fst Z Z _30961) (@snd Z Z _30961))) (int_gcd (@pair Z Z (@fst Z Z _30961) (@snd Z Z _30961))))).
Copy link
Member

Choose a reason for hiding this comment

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

Hi. In fact, there is a problem with this lemma as div is mapped above to Zdiv and not Z.div. What is the difference between these two functions? How to fix this lemma if one replaces Z.div by Zdiv?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Solved in #9.

@TheoWinterhalter TheoWinterhalter mentioned this pull request Feb 18, 2025
fblanqui added a commit to Deducteam/coq-hol-light-real-with-N that referenced this pull request Feb 19, 2025
* add tactics developed by Théo (Deducteam/coq-hol-light#6)
* structure proof scripts
* add alignments of even, odd and WF
* add alignment of factorial

Co-authored-by: Théo Winterhalter <[email protected]>
Co-authored-by: Frédéric Blanqui <[email protected]>
fblanqui added a commit that referenced this pull request Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants