-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(Algebra/Module): Move
Module.ofCore
to a MinimalAxioms fil…
…e, and rename it `ofMinimalAxioms` (#8853) This makes it consistent with Ring, Field and Group. Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
- Loading branch information
1 parent
a27d7b3
commit 49c5721
Showing
4 changed files
with
48 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/- | ||
Copyright (c) 2015 Nathaniel Thomas. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Nathaniel Thomas, Jeremy Avigad, Johannes Hölzl, Mario Carneiro, Martin C. Martin | ||
-/ | ||
import Mathlib.Algebra.Module.Basic | ||
|
||
/-! | ||
# Minimal Axioms for a Module | ||
This file defines a constructor to define a `Module` structure on a Type with an | ||
`AddCommGroup`, while proving a minimum number of equalities. | ||
## Main Definitions | ||
* `Module.ofMinimalAxioms`: Define a `Module` structure on a Type with an | ||
AddCommGroup by proving a minimized set of axioms | ||
-/ | ||
|
||
universe u v | ||
|
||
/-- Define a `Module` structure on a Type by proving a minimized set of axioms. -/ | ||
@[reducible] | ||
def Module.ofMinimalAxioms {R : Type u} {M : Type v} [Semiring R] [AddCommGroup M] [SMul R M] | ||
-- Scalar multiplication distributes over addition from the left. | ||
(smul_add : ∀ (r : R) (x y : M), r • (x + y) = r • x + r • y) | ||
-- Scalar multiplication distributes over addition from the right. | ||
(add_smul : ∀ (r s : R) (x : M), (r + s) • x = r • x + s • x) | ||
-- Scalar multiplication distributes over multiplication from the right. | ||
(mul_smul : ∀ (r s : R) (x : M), (r * s) • x = r • s • x) | ||
-- Scalar multiplication by one is the identity. | ||
(one_smul : ∀ x : M, (1 : R) • x = x) : Module R M := | ||
{ smul_add := smul_add, | ||
add_smul := add_smul, | ||
mul_smul := mul_smul, | ||
one_smul := one_smul, | ||
zero_smul := fun x => | ||
(AddMonoidHom.mk' (fun r : R => r • x) fun r s => add_smul r s x).map_zero | ||
smul_zero := fun r => (AddMonoidHom.mk' ((· • ·) r) (smul_add r)).map_zero } | ||
#align module.of_core Module.ofMinimalAxioms |
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