Skip to content

Conversation

@LorenzoMolena
Copy link
Contributor

@LorenzoMolena LorenzoMolena commented Dec 16, 2025

See #1276.
I have decided to change the organization of the modules by introducing a common Fast directory, hosting the fast Int modules and, in the future, fast rationals as well. The same change has been made for instances of algebraic structures.
In my opinion, this organization seems conceptually clearer.
For example, in #1276 the instances of fast integers as AbGroup are in Cubical.Algebra.AbGroup.Instances.Int.Fast, with the file named Fast, whereas in this PR we have Cubical.Algebra.AbGroup.Instances.Fast.Int, with the file named Int.

Moreover, since in these PRs they are consistently referred to as "fast integers", having them under Fast.Int appears more natural than the current Int.Fast.

Finally, the only fast Int module already merged is the Base file, so this reorganization is minimal.

This PR depends on #1270, #1271, and #1272.

LorenzoMolena and others added 9 commits November 19, 2025 09:52
* add fast implementation of integers and their properties

* move properties of min and max over `ℕ` to the appropriate file

* reorganize and format code

* remove `--safe` flag

* remove `--safe` flag

* Fast int (#2)

* direct solver application

* direct solver application

---------

Co-authored-by: Marcin Jan Turek-Grzybowski <marcinjangrzybowski@gmail.com>

* add fast implementation of integers and their properties

* move properties of min and max over `ℕ` to the appropriate file

* reorganize and format code

* remove `--safe` flag

* remove `--safe` flag

* remove `--safe` flag

* Fast int (#2)

* direct solver application

* direct solver application

---------

Co-authored-by: Marcin Jan Turek-Grzybowski <marcinjangrzybowski@gmail.com>

* fix compatibility with the library

* fix compatibility after rebase, start proving properties of fast integer min and max

* add instances of `Nat` and `Int` as `Pseudolattice`, and of `Int` as `OrderedCommRing`

* fix typo, add better make from Posets to Pseudolattices

* update `makePseudolatticeFromPoset` and instances built using it

* move `maxLUB` and `minGLB` to `Data.Nat.Order`, remove unnecessary imports

* rewrite properties from `minAssoc` to `-max`, add temporary lemmas in `Nat`, add `UsingEq` into `min` and `max` over the Naturals

* fix naming clash on import

* rewrite properties from `pos+posLposMin` to `·DistNegsucLMax`

* start work on Order: adapt properties from `isProp≤` to `≤SumLeftPos`, add boolean order, suggest alternative definition `_≤'_`

* use more efficient implementation of quotient and remainder in `Int.Fast.Divisibility`

* adapt properties from `pred-≤-pred` to `0≤o→≤-·o`, move import of `Bool.Base` together with the other imports

* adapt properties from `<-·o` to `predℤ-≤-predℤ`

* adapt properties from `¬m+posk<m` to `<-+pos-trans`

* adapt properties from `<-pos+-trans` to `0<o→≤-·o-cancel`

* adapt properties from `≤-o·-cancel` to `≤→min` ; add conversions between the order over the integers and the one over the naturals ; add `maxLUB`, `minGLB` , `≤→max` , `≤→min` to `Data.Nat.Order`

* adapt properties from `≤MonotoneMin` to `_≟'_` ; add faster `_≟_` and tests. This finishes (a first but complete version) of `Data.Int.Fast`

* edit `_≤'_` using recursive order, add `_≤ᵇ_` and `_≤''_`

* update `minIdem`

* clean comments, reorganize `Fast` modules, add more properties in `Int.Fast.Order`, add `Trichotomy` and `Ordering` in `BinaryRelation`

* add fixity for `_≤_` in `PseudolatticeStr`, add `Properties` file

* edit Fast using PL and OCR instances

* remove `minIdem`, use PL instance of `Nat` in the `Int.Fast.Order` module

* simplify some proofs, with additional converions between the order on Nat and the integer order between negsuc

* Add order related instances of `Fast.Int`

* revert addition of `Trichotomy` to `BinaryRelation`, add more tests to `Int.Fast.Order`

* add missing `'` on commented test code

* adapt instances of `Int` and `Int.Fast` as `OCR`, to the branch `ocr+pl-instances'`

---------

Co-authored-by: Ettore Forigo <ettore.forigo@gmail.com>
Co-authored-by: Marcin Jan Turek-Grzybowski <marcinjangrzybowski@gmail.com>
…seudolattices and simplify some proofs about min/max in `Int.Fast.Properties`
@anshwad10
Copy link
Contributor

"Fast" doesn't feel like a word to me anymore, after reading that 😄

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