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

Addition on #1307

Closed
wants to merge 203 commits into from
Closed

Addition on #1307

wants to merge 203 commits into from

Conversation

lowasser
Copy link
Contributor

@lowasser lowasser commented Feb 9, 2025

As requested, a big, self-contained larger review.

@fredrik-bakke
Copy link
Collaborator

fredrik-bakke commented Feb 9, 2025

The fact that you have to do so many long proofs just to be able to define addition tells us that we are in need of additional infrastructure. I believe a good starting point would be to do the following (but you're the expert on real numbers here):

  • Factor out a file on lower Dedekind real numbers/lower Dedekind cuts
  • Factor out a file on upper Dedekind real numbers/upper Dedekind cuts
  • Factor out a file on located cuts
  • Factor out a file about addition on lower Dedekind real numbers
  • Factor out a file about addition on upper Dedekind real numbers

lowasser and others added 2 commits February 9, 2025 09:06
Co-authored-by: Fredrik Bakke <fredrbak@gmail.com>
@fredrik-bakke
Copy link
Collaborator

fredrik-bakke commented Feb 9, 2025

You could also even start by writing a file on Minkowski sums of subsets of a monoid (that is what you're doing on the lower and upper cuts of the sum of two real numbers).

@lowasser
Copy link
Contributor Author

lowasser commented Feb 9, 2025

You could also even start by writing a file on Minkowski sums of subsets of a monoid (that is what you're doing on the lower and upper cuts of the sum of two real numbers).

Before I get too deep into this: I don't see what the advantage is of making this about monoids, as opposed to semigroups.

@fredrik-bakke
Copy link
Collaborator

You could also even start by writing a file on Minkowski sums of subsets of a monoid (that is what you're doing on the lower and upper cuts of the sum of two real numbers).

Before I get too deep into this: I don't see what the advantage is of making this about monoids, as opposed to semigroups.

Oh, yeah, sure. The agda-unimath way would be to have a file for each, who build on each other. But you don't have to go that far. Something like the following should be true though:

  • The Minkowski sum operation on a semigroup defines a semigroup
  • The Minkowski sum operation on a monoid defines a monoid
  • The Minkowski sum operation on a commutative monoid defines a commutative monoid

@lowasser
Copy link
Contributor Author

lowasser commented Feb 9, 2025

I'm going that far. But I think I will break Minkowski sums out into a separate review, just because that seems like a good self-contained unit. (Also, I'm calling it a Minkowski product, since semigroups and monoids both use mul terminology?)

@fredrik-bakke
Copy link
Collaborator

fredrik-bakke commented Feb 9, 2025

Great! Yes, that sounds like a good unit for a PR. Thank you for doing that. Actually, aren't the results I listed useful to you to show that addition of reals is associative, unital, and commutative respectively?

@fredrik-bakke
Copy link
Collaborator

Perhaps call it Monkowski multiplication. The term product is used a lot to denote cartesian products, and since Minkowski operations are about operations on subtypes, it sounds like it would be easy to confuse the two.

@EgbertRijke
Copy link
Collaborator

Perhaps call it Monkowski multiplication. The term product is used a lot to denote cartesian products, and since Minkowski operations are about operations on subtypes, it sounds like it would be easy to confuse the two.

This would be very neat! But I'd say the most decisive factor for what to name something is what it is commonly known as in the literature. Probably it is best to refer to a standard text on monoids, and see what they call the pointwise product of two subsets of a monoid, use that name in the library, and cite that text.

@lowasser
Copy link
Contributor Author

lowasser commented Feb 9, 2025

Minkowski stuff is now in #1309.

@fredrik-bakke
Copy link
Collaborator

I'll convert this PR to a draft. The approach seems to be that you will implement this in steps somewhat according to the discussion here. Is that correct?

@fredrik-bakke fredrik-bakke marked this pull request as draft February 9, 2025 22:53
@fredrik-bakke
Copy link
Collaborator

By the way, the typechecker has been stuck on addition-real-numbers for over 5 hours now. Clearly, performance needs to be considered for this implementation.

@lowasser
Copy link
Contributor Author

lowasser commented Feb 9, 2025

Yes. My bad.

@lowasser lowasser closed this Feb 9, 2025
@VojtechStep
Copy link
Collaborator

Did you close the PR because you're not working on addition of real numbers, or because there are some blockers? For WIP PRs and interdependent PRs we use Drafts, to make it clear that you have the intention of eventually having it merged. Closing a PR is more of a "I ran out of steam, someone else can pick this formalization target up"

@lowasser
Copy link
Contributor Author

I expect to rewrite it almost completely at this point, is what's going on, in terms of lower and upper Dedekind cuts. That can be a draft if that's more conventional.

@lowasser lowasser reopened this Feb 10, 2025
@lowasser
Copy link
Contributor Author

(The other reason I closed it was because, as stated, CI was stuck on it, and I didn't want it to consume resources. Actually, in retrospect, that convinced me to leave it closed unless you explicitly say so.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants