Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Generalise monotonicity of multiplication lemmas to semirings (#…
…9369) Many lemmas about `BlahOrderedRing α` did not mention negation. I could generalise almost all those lemmas to `BlahOrderedSemiring α` + `ExistsAddOfLE α` except for a series of five lemmas (left a TODO about them). Now those lemmas apply to things like the naturals. This is not very useful on its own, because those lemmas are trivially true on canonically ordered semirings (they are about multiplication by negative elements, of which there are none, or nonnegativity of squares, but we already know everything is nonnegative), except that I will soon add more complicated inequalities that are based on those, and it would be a shame having to write two versions of each: one for ordered rings, one for canonically ordered semirings. A similar refactor could be made for scalar multiplication, but this PR is big enough already. From LeanAPAP
- Loading branch information
1 parent
bded32a
commit 0c9d411
Showing
14 changed files
with
354 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/- | ||
Copyright (c) 2021 Kevin Buzzard. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Kevin Buzzard | ||
-/ | ||
import Mathlib.Algebra.GroupPower.Basic | ||
import Mathlib.Algebra.Group.Hom.Defs | ||
|
||
/-! | ||
# Power as a monoid hom | ||
-/ | ||
|
||
variable {α : Type*} | ||
|
||
section CommMonoid | ||
variable [CommMonoid α] | ||
|
||
/-- The `n`th power map on a commutative monoid for a natural `n`, considered as a morphism of | ||
monoids. -/ | ||
@[to_additive (attr := simps) "Multiplication by a natural `n` on a commutative additive monoid, | ||
considered as a morphism of additive monoids."] | ||
def powMonoidHom (n : ℕ) : α →* α where | ||
toFun := (· ^ n) | ||
map_one' := one_pow _ | ||
map_mul' a b := mul_pow a b n | ||
#align pow_monoid_hom powMonoidHom | ||
#align nsmul_add_monoid_hom nsmulAddMonoidHom | ||
#align pow_monoid_hom_apply powMonoidHom_apply | ||
#align nsmul_add_monoid_hom_apply nsmulAddMonoidHom_apply | ||
|
||
end CommMonoid | ||
|
||
section DivisionCommMonoid | ||
variable [DivisionCommMonoid α] | ||
|
||
/-- The `n`-th power map (for an integer `n`) on a commutative group, considered as a group | ||
homomorphism. -/ | ||
@[to_additive (attr := simps) "Multiplication by an integer `n` on a commutative additive group, | ||
considered as an additive group homomorphism."] | ||
def zpowGroupHom (n : ℤ) : α →* α where | ||
toFun := (· ^ n) | ||
map_one' := one_zpow n | ||
map_mul' a b := mul_zpow a b n | ||
#align zpow_group_hom zpowGroupHom | ||
#align zsmul_add_group_hom zsmulAddGroupHom | ||
#align zpow_group_hom_apply zpowGroupHom_apply | ||
#align zsmul_add_group_hom_apply zsmulAddGroupHom_apply | ||
|
||
end DivisionCommMonoid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.