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

[Merged by Bors] - fix(order/basic): fix subtype.linear_order #15056

Closed
wants to merge 11 commits into from

Conversation

urkud
Copy link
Member

@urkud urkud commented Jun 29, 2022

This makes subtype.lattice definitionally equal to linear_order.to_lattice, after unfolding some (which?) semireducible definitions.

  • Rewrite linear_order.lift to allow custom max and min fields. Move the old definition to linear_order.lift'.
  • Use the new linear_order.lift to fix a non-defeq diamond on subtype _.
  • Use the new linear_order.lift in various function.injective.linear_* definitions.

Open in Gitpod

@urkud urkud added awaiting-review The author would like community review of the PR awaiting-CI The author would like to see what CI has to say before doing more work. labels Jun 29, 2022
max := λ x y, ⟨max x y, max_rec' _ x.2 y.2⟩,
min := λ x y, ⟨min x y, min_rec' _ x.2 y.2⟩,
max_def := by { ext ⟨x, hx⟩ ⟨y, hy⟩, by_cases y ≤ x; simp [*, max_def, max_default] },
min_def := by { ext ⟨x, hx⟩ ⟨y, hy⟩, by_cases x ≤ y; simp [*, min_def, min_default] },
Copy link
Member

Choose a reason for hiding this comment

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

Does min_rec' work for this field?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm rewriting linear_order.lift.

@urkud urkud added WIP Work in progress and removed awaiting-review The author would like community review of the PR labels Jun 29, 2022
Copy link
Collaborator

@vihdzp vihdzp left a comment

Choose a reason for hiding this comment

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

What exactly is the idea here? I don't quite parse what's going on with has_sup and has_inf.

src/algebra/order/field.lean Outdated Show resolved Hide resolved
@@ -68,14 +65,6 @@ end

/- TODO: automatic construction of dual definitions / theorems -/
Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment doesn't seem relevant here anymore.

@urkud
Copy link
Member Author

urkud commented Jul 1, 2022

What exactly is the idea here? I don't quite parse what's going on with has_sup and has_inf.

Currently, there is a diamond : linear_order α -> linear_order (subtype p) -> lattice (subtype p) vs linear_order α -> lattice α -> lattice (subtype p). In the first case, we get x ⊔ y = max x y = if y ≤ x then x else y. In the second case, we get x ⊔ y = ⟨max (x : α) y, _⟩. With this PR, linear_order.lift etc take max and min on the domain as arguments.

@urkud urkud added awaiting-review The author would like community review of the PR and removed WIP Work in progress labels Jul 1, 2022
src/order/basic.lean Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the awaiting-CI The author would like to see what CI has to say before doing more work. label Jul 2, 2022
Copy link
Collaborator

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

Thanks!

bors r+

@leanprover-community-bot-assistant leanprover-community-bot-assistant added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Jul 11, 2022
bors bot pushed a commit that referenced this pull request Jul 11, 2022
This makes `subtype.lattice` definitionally equal to `linear_order.to_lattice`, after unfolding some (which?) semireducible definitions.

* Rewrite `linear_order.lift` to allow custom `max` and `min` fields. Move the old definition to `linear_order.lift'`.
* Use the new `linear_order.lift` to fix a non-defeq diamond on `subtype _`.
* Use the new `linear_order.lift` in various `function.injective.linear_*` definitions.
@bors
Copy link

bors bot commented Jul 11, 2022

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Jul 11, 2022
This makes `subtype.lattice` definitionally equal to `linear_order.to_lattice`, after unfolding some (which?) semireducible definitions.

* Rewrite `linear_order.lift` to allow custom `max` and `min` fields. Move the old definition to `linear_order.lift'`.
* Use the new `linear_order.lift` to fix a non-defeq diamond on `subtype _`.
* Use the new `linear_order.lift` in various `function.injective.linear_*` definitions.
@bors
Copy link

bors bot commented Jul 11, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title fix(order/basic): fix subtype.linear_order [Merged by Bors] - fix(order/basic): fix subtype.linear_order Jul 11, 2022
@bors bors bot closed this Jul 11, 2022
@bors bors bot deleted the YK-linear-subtype branch July 11, 2022 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants