Conversation
|
Congrats! This is great :-) |
|
I did not saw opaque utilised too much thru the library, did not considered it really :), will do now thanks! |
anshwad10
left a comment
There was a problem hiding this comment.
oops accidentally started a review
* 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 (agda#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 (agda#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>
* 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 (agda#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 (agda#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'` * add `Rationals.Fast` --------- Co-authored-by: Ettore Forigo <ettore.forigo@gmail.com> Co-authored-by: Marcin Jan Turek-Grzybowski <marcinjangrzybowski@gmail.com>
… `OrderedCommRing` (agda#28)
* add fixity for `_≤_` in `PseudolatticeStr`, add `Properties` file * add `≤→∧≡Left` and `≥→∧≡Right` into the `Properties` module. Add `isPropIsPseudolattice` into the the `Base` file * add equivalences of Pseudolattices and other basic properties, following similar modules * remove implicit universe levels in the type of `PseudolatticeEquiv`
* Fast int properties with pl and ocr instances (agda#23) * 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 (agda#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 (agda#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> * edit `zero-≤pos`, using an easier proof, add `zero-<possuc` --------- Co-authored-by: Ettore Forigo <ettore.forigo@gmail.com> Co-authored-by: Marcin Jan Turek-Grzybowski <marcinjangrzybowski@gmail.com>
…Order`, add `0<` and its property into `Int.Fast.Order`, add Fast Rationals. The module `Rationals.Fast.Order.Properties` is still WIP, but the uncommented code currently typechecks
…loor-frac` typechecks
24e5e8c to
fa8a793
Compare
|
this is result of explorative development, code is messy but everything typechecks
|
|
Wow, sounds very cool! Are you relying on any classical axioms or is everything constructive? |
|
everything constructive |
|
after implementing HoTT chapter on cauchy reals I roughly followed Bishop (as book was advising :)) |
|
and of course |
… nth root of reals without laousy unification and using solvers
This is an implementation of real numbers as defined in Chapter 11.3: Cauchy Reals of the HoTT Book.
(Note: results 11.3.11 and 11.3.50 are currently missing.)
Modules:
Cubical/HITs/CauchyReals/Base.agdaCubical/HITs/CauchyReals/Closeness.agdaCubical/HITs/CauchyReals/Continuous.agdaCubical/HITs/CauchyReals/Inverse.agdaCubical/HITs/CauchyReals/Lems.agdaCubical/HITs/CauchyReals/Lipschitz.agdaCubical/HITs/CauchyReals/Multiplication.agdaCubical/HITs/CauchyReals/Order.agdaThese modules closely follow the book. However, I had to adjust the order of definitions due to the issue discussed here: HoTT/book#899.
Additionally, the following modules:
Cubical/HITs/CauchyReals/Sequence.agdaCubical/HITs/CauchyReals/Derivative.agdaare attempts to benchmark the definitions and evaluate their behavior. In
Derivative.agda, I've managed to derive the Power rule (for natural exponents). InSequence.agda, I definedexp(currently only for ℚ₊), allowing the definition ofe.To implement these properly (assuming we want to continue without countable choice or LEM), I plan to consult some books on constructive analysis. The HoTT Book references "Errett Bishop. Foundations of Constructive Analysis," but I welcome other suggestions.
While the development is not yet up to library standards, everything currently type checks. I will likely split this into smaller PRs. There is one remaining definition,
invℝ, hidden behindabstract. However, I have a promising idea based on previous optimizations to expose it (or at least manage its evaluation more controllably by guarding it withlockUnit).There is some redundancy, as I am still experimenting with different versions of definitions.
TODO:
expto all reals and provide a characterizationCommRingSolver(temporary solution inCubical/HITs/CauchyReals/Lems.agda)