-
Notifications
You must be signed in to change notification settings - Fork 298
feat(algebra/field/basic): nnrat.cast
#16554
Conversation
@semorrison, here is the source of my splitting ideas. Basically it's:
|
src/algebra/group_power/lemmas.lean
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to this file are unrelated cleanup, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -143,6 +143,8 @@ alias even.zpow_pos_iff ↔ _ even.zpow_pos | |||
alias odd.zpow_neg_iff ↔ _ odd.zpow_neg | |||
alias odd.zpow_nonpos_iff ↔ _ odd.zpow_nonpos | |||
|
|||
@[simp] lemma abs_zpow (a : α) (n : ℤ) : |a ^ n| = |a| ^ n := map_zpow₀ (abs_hom : α →*₀ α) a n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like a weird place for this lemma; do we have abs_inv
and abs_div
already that it could go next to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do have the lemmas in algebra.order.field.basic
, but map_zpow₀
isn't available there. Also note that algebra.order.field.power
is precisely about zpow
and nothing else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, in which case I'll reduce my comment to "surely this doesn't belong in this PR"!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…ditive monoids While many of the lemmas cease to apply, the definitions of sequences and their sums are still perfectly well-behaved in additive monoids; no negation is needed. We could use this to generalize `NormedSpace.exp` such that it works with `NNReal`, but unless leanprover-community/mathlib3#16554 or similar lands and provides a `DivisionSemiring.nnqsmul` field, that would conflict with #8370.
Redone in leanprover-community/mathlib4#11203. |
Define the canonical coercion
ℚ≥0 → α
whereα
is adivision_semiring
. This involves a lot of import shuffling.The new fields are
ring
andfield
instances #17348int.cast
instead ofrat.of_int
#17392pow_minus_two_nonneg
#18591floor_ring
fromfield
#18596div
lemmas #18607