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] - feat(analysis/seminorm): Add has_add and has_scalar nnreal #11414

Closed
wants to merge 13 commits into from

Conversation

mcdoll
Copy link
Member

@mcdoll mcdoll commented Jan 13, 2022

Add instances of has_add and has_scalar nnreal type classes for seminorm.

Co-authored-by: Eric Wieser wieser.eric@gmail.com


I will do the additional structure in a second PR (after #11329 is merged).

Open in Gitpod

mcdoll and others added 2 commits January 13, 2022 02:05
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@mcdoll mcdoll changed the title feat(analysis/seminorm) add has_add and has_scalar nnreal feat(analysis/seminorm): Add has_add and has_scalar nnreal Jan 13, 2022
mcdoll and others added 2 commits January 13, 2022 15:39
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Jan 14, 2022
@mcdoll
Copy link
Member Author

mcdoll commented Jan 15, 2022

@YaelDillies I stole your two lines for showing the ordered_cancel_add_comm_monoid instance. Should I add you as co-author?

@YaelDillies
Copy link
Collaborator

As you want, but it's really not much.

@mcdoll mcdoll added the awaiting-review The author would like community review of the PR label Jan 15, 2022
fun_like.coe_injective.add_monoid_smul _ rfl coe_add (λ p n, coe_smul n p)

instance : ordered_cancel_add_comm_monoid (seminorm 𝕜 E) :=
fun_like.coe_injective.ordered_cancel_add_comm_monoid _ rfl coe_add
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately this now forms a diamond with the instance above it. You need something like:

Suggested change
fun_like.coe_injective.ordered_cancel_add_comm_monoid _ rfl coe_add
{ nsmul := (•),
..seminorm.add_monoid,
..fun_like.coe_injective.ordered_cancel_add_comm_monoid _ rfl coe_add }

You might have to fight lean a little to make it accept that.

Copy link
Member Author

Choose a reason for hiding this comment

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

This compiles, but I don't know enough about how this instancing stuff works to judge whether it gets rid of the diamond:

def ordered_cancel_add_comm_monoid_aux : ordered_cancel_add_comm_monoid (seminorm 𝕜 E) :=
fun_like.coe_injective.ordered_cancel_add_comm_monoid _ rfl coe_add

instance : ordered_cancel_add_comm_monoid (seminorm 𝕜 E) :=
{nsmul := (•), ..seminorm.add_monoid, ..seminorm.ordered_cancel_add_comm_monoid_aux }

Copy link
Member

Choose a reason for hiding this comment

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

That works, but you don't need the auxiliary definition. I pushed a commit.

Copy link
Member Author

Choose a reason for hiding this comment

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

thank you. By the way, where are instances for stuff like mul_action (E → ℝ)?

Copy link
Member

Choose a reason for hiding this comment

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

They're in group_theory.group_action.pi, I think. The instance in question is pi.mul_action.

Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

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

bors d+

Thanks!

@bors
Copy link

bors bot commented Jan 16, 2022

✌️ mcdoll 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 Jan 16, 2022
@mcdoll
Copy link
Member Author

mcdoll commented Jan 16, 2022

bors merge

bors bot pushed a commit that referenced this pull request Jan 16, 2022
Add instances of `has_add` and `has_scalar nnreal` type classes for `seminorm`.

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>



Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@bors
Copy link

bors bot commented Jan 16, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(analysis/seminorm): Add has_add and has_scalar nnreal [Merged by Bors] - feat(analysis/seminorm): Add has_add and has_scalar nnreal Jan 16, 2022
@bors bors bot closed this Jan 16, 2022
@bors bors bot deleted the mcdoll/seminorm_smul branch January 16, 2022 13:30
bors bot pushed a commit that referenced this pull request Mar 12, 2022
…12624)

Move `balanced`, `absorbs`, `absorbent` to a new file.

For `analysis.seminorm`, I'm crediting
* Jean for #4827
* myself for
  * #9097
  * #11487
* Moritz for
  * #11329
  * #11414
  * #11477

For `analysis.locally_convex.basic`, I'm crediting
* Jean for #4827
* Bhavik for
  * #7358
  * #9097
* myself for
  * #9097
  * #10999
  * #11487
laurentbartholdi pushed a commit that referenced this pull request Mar 17, 2022
…12624)

Move `balanced`, `absorbs`, `absorbent` to a new file.

For `analysis.seminorm`, I'm crediting
* Jean for #4827
* myself for
  * #9097
  * #11487
* Moritz for
  * #11329
  * #11414
  * #11477

For `analysis.locally_convex.basic`, I'm crediting
* Jean for #4827
* Bhavik for
  * #7358
  * #9097
* myself for
  * #9097
  * #10999
  * #11487
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated The PR author may merge after reviewing final suggestions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants