Skip to content
This repository was archived by the owner on Nov 6, 2026. It is now read-only.

[Merged by Bors] - feat(algebra/order/interval): Interval arithmetic - #16761

Closed
YaelDillies wants to merge 15 commits into
masterfrom
interval_arithmetic
Closed

YaelDillies wants to merge 15 commits into
masterfrom
interval_arithmetic

Conversation

@YaelDillies

@YaelDillies YaelDillies commented Oct 2, 2022 •

Copy link
Copy Markdown
Collaborator

Define arithmetic operations on interval/nonempty_interval and prove their correctness.


Open in Gitpod

@YaelDillies YaelDillies added awaiting-review The author would like community review of the PR t-order Order hierarchy t-algebra Algebra (groups, rings, fields etc) WIP Work in progress blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. and removed awaiting-review The author would like community review of the PR labels Oct 2, 2022
@ghost ghost removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Oct 25, 2022
@ghost

ghost commented Oct 25, 2022

Copy link
Copy Markdown

This PR/issue depends on:

@YaelDillies YaelDillies added awaiting-review The author would like community review of the PR and removed WIP Work in progress labels Nov 5, 2022

@Vierkantor Vierkantor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There are still a few TODOs in the code, are you planning to deal with them yourself or would you like suggestions?

Comment thread src/algebra/order/interval.lean Outdated
rw [pure_mul_pure, h, pure_one] }
end

-- @[to_additive]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are you planning on adding the corresponding additive instance (I assume manually, based on the comments on subtraction)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Whoops, I completely forgot about those.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Btw, the reason we need this duplication is because interval.has_div (purposefully) doesn't match interval.has_sub. I guess if we had has_ordered_div, the problem would also be fixed, but the consensus is that we don't need it.

Comment thread src/algebra/order/interval.lean Resolved
@YaelDillies

Copy link
Copy Markdown
Collaborator Author

I fixed the ones I could, and I don't know whether the last one is fixable.

@Vierkantor Vierkantor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

bors d+

Comment thread src/algebra/order/interval.lean Resolved
Comment thread src/algebra/order/interval.lean Resolved
/-!
# Interval arithmetic

This file defines arithmetic operations on intervals and prove their correctness. Note that this is

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As for correctness: are you planning to prove results like a ∈ s → b ∈ t → a + b ∈ s + t?

@YaelDillies YaelDillies Nov 16, 2022 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I am split between showing these and defining an "interval operation" as something like

structure interval_hom (f : α → β) :=
(to_fun : interval α → interval β)
(mem_map' := ∀ a s, a ∈ s → f a ∈ to_fun s)

and then bundling operations as interval_homs. I guess both is an answer.

@bors

bors Bot commented Nov 16, 2022

Copy link
Copy Markdown

✌️ YaelDillies can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@leanprover-community-bot-assistant leanprover-community-bot-assistant added delegated The PR author may merge after reviewing final suggestions. and removed awaiting-review The author would like community review of the PR labels Nov 16, 2022
@YaelDillies

Copy link
Copy Markdown
Collaborator Author

bors merge

bors Bot pushed a commit that referenced this pull request Nov 30, 2022
Define arithmetic operations on `interval`/`nonempty_interval` and prove their correctness.
@bors

bors Bot commented Nov 30, 2022

Copy link
Copy Markdown

Build failed:

@Vierkantor

Copy link
Copy Markdown
Collaborator

bors d+

@bors

bors Bot commented Nov 30, 2022

Copy link
Copy Markdown

✌️ YaelDillies can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@YaelDillies

Copy link
Copy Markdown
Collaborator Author

bors merge

bors Bot pushed a commit that referenced this pull request Nov 30, 2022
Define arithmetic operations on `interval`/`nonempty_interval` and prove their correctness.
@bors

bors Bot commented Nov 30, 2022

Copy link
Copy Markdown

Pull request successfully merged into master.

Build succeeded:

@bors bors Bot changed the title feat(algebra/order/interval): Interval arithmetic [Merged by Bors] - feat(algebra/order/interval): Interval arithmetic Nov 30, 2022
@bors bors Bot closed this Nov 30, 2022
@bors

bors Bot commented Nov 30, 2022

Copy link
Copy Markdown

Pull request successfully merged into master.

Build succeeded:

@bors bors Bot changed the title [Merged by Bors] - feat(algebra/order/interval): Interval arithmetic [Merged by Bors] - [Merged by Bors] - feat(algebra/order/interval): Interval arithmetic Nov 30, 2022
@YaelDillies
YaelDillies deleted the interval_arithmetic branch December 1, 2022 00:20
@YaelDillies YaelDillies changed the title [Merged by Bors] - [Merged by Bors] - feat(algebra/order/interval): Interval arithmetic [Merged by Bors] - feat(algebra/order/interval): Interval arithmetic Dec 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

delegated The PR author may merge after reviewing final suggestions. t-algebra Algebra (groups, rings, fields etc) t-order Order hierarchy

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants