-
Notifications
You must be signed in to change notification settings - Fork 245
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
proposal to reorganize the divisibility relation _|_
#679
Comments
As I said in the email thread I believe that RightQuotient : C → C → Set (α ⊔ α=)
RightQuotient a b = ∃ (\q → (b ∙ q) ≈ a) belongs in We already have
I think that the question of whether we replace the implementations in |
The whole Algebra needs to be like this. The files in Algebra/ to include the contents of Algebra/Structures.agda of the current standard. Algebra/Structures0.agda to contain the definition Further, Structures0.agda contains Structures1.agda is a continuation. It will contain the theory modules for Semiring, Ring, CommutativeRing, DecCommutativeRing, DecIntegralRing, GCDRing. Structures2.agda to contain the theory modules for Field and (may be) for LeftModule, VectorSpace. No more files are needed there, because standard library must not be large. It is needed to add Data/Fraction/ containing the modules Fraction.agda, F0.agda F1.agda This can be called "reorganizing the Algebra part". |
Two more notes: |
To separate "Properties" and "Operations" and such to other folders is a wrong idea. These are intermingled wit the domain constructors: Nat, Integer, Fraction. In the textbooks, the instances for them are in paragraphs that can be scattered among the paragraphs for abstract theories. Say, Ring is defined in one paragraph, and the instance of Ring for Integer is described in another paragraph, which can be neighbor or can be in another chapter. Generally, we need to follow textbooks on science, this is a reliable approach. |
I'm afraid I'm not a fan of the
I'm also not sure I'd agree with this. Textbooks work at a considerably higher level of abstraction than a library of formal proofs and therefore can take liberties with organising their content that a library cannot. This is because introducing assumptions is nearly cost free in text, whereas if assumptions are handled in a program incorrectly it can often add considerable code bloat and usage cost. Textbooks also don't have to worry about pseudo-dependency cycles. For example if you have two modules Also, just to note, @mechvel you can click the |
But currently you have a single name Algebra for all the hierarchy.
As usual, the modules are split into X1, Y1, X2, Y2, so that the ones more close to the head do not import further ones. If this is not possible, then they need join, and may be the `mutual' construct to apply.
This .agda file contains a piece of the generic theory for CommutativeMonoid. |
I completely agree with @MatthewDaggitt that textbooks are not a good model for structuring libraries. The requirements are completely different. For one, textbooks are optimized by pedagogy, while libraries should be optimized for scalability and re-use. These are radically different "forces", and thus good solutions are quite different. Plus classical mathematics in textbooks picks and chooses so very few structures to talk about, while the zoo is a couple of orders of magnitude larger. On Wikipedia, both the Algebraic Structures and List of algebraic Structures are still small, Jipsen's list with > 300 entries gets better. |
Well that list is terrifying 😨 |
If you're going to do it "by hand" the current way things are done? Yes, yes it is. I'm not going to suggest/ask that it be done that way... Working with others to create a sane way to get there. Hope to be able to report on it in a couple of months. |
This isn't going to happen for v2.0 unfortunately... |
Matthew wrote
All right, I open it.
I think, standard library needs a generic divisibility notion
_|_
.Currently there exists
_|_
for Nat and ℤ.I suggest to remove it, and to replace it with a generic divisibility defined for Magma:
First, the notion of a quotient is related to any
_≈_, _∙_
:And the notion of divisibility is via RightQuotient:
In particular, it will serve also for
ℕ, ℤ
, for pairs, for polynomials, and so on.The existing divisibility for
ℕ, ℤ
to be replaced with_|_
imported fromAlgebra.Properties.Magma (Nat.Properties *-magma)
and fromAlgebra.Properties.Magma (Integer.Properties *-magma)
.The modules
Algebra.Properties.Magma
,Algebra.Properties.Monoid
, ...to be parametrized by Magma, Monoid, and so on. They contain theories related to Magma, Monoid, and so on. In particular, there are proved properties of
_|_
related to these structures.This notion of
_|_
will serve the generic definition of GCD, etc.How precisely is this all organized will be demonstrated in BFLib-0.01, which has to appear after the release of Agda-2.6.0.
But BFLib-0.01 will try to merge into standard so, that it modules to distribute their parts between the modules of standard library.
The text was updated successfully, but these errors were encountered: