@@ -360,29 +360,21 @@ def add_comm_group.int_module.unique : unique (module ℤ M) :=
360360
361361end add_comm_group
362362
363- namespace add_monoid_hom
364-
365- lemma map_nat_module_smul [add_monoid M] [add_monoid M₂]
366- (f : M →+ M₂) (x : ℕ) (a : M) : f (x • a) = x • f a :=
367- f.map_nsmul a x
368-
369- lemma map_int_module_smul [add_group M] [add_group M₂]
370- (f : M →+ M₂) (x : ℤ) (a : M) : f (x • a) = x • f a :=
371- f.map_zsmul a x
372-
373- lemma map_int_cast_smul [add_comm_group M] [add_comm_group M₂]
374- (f : M →+ M₂) (R S : Type *) [ring R] [ring S] [module R M] [module S M₂]
363+ lemma map_int_cast_smul [add_comm_group M] [add_comm_group M₂] {F : Type *}
364+ [add_monoid_hom_class F M M₂] (f : F) (R S : Type *) [ring R] [ring S] [module R M] [module S M₂]
375365 (x : ℤ) (a : M) : f ((x : R) • a) = (x : S) • f a :=
376- by simp only [←zsmul_eq_smul_cast, f. map_zsmul]
366+ by simp only [←zsmul_eq_smul_cast, map_zsmul]
377367
378- lemma map_nat_cast_smul [add_comm_monoid M] [add_comm_monoid M₂] (f : M →+ M₂)
368+ lemma map_nat_cast_smul [add_comm_monoid M] [add_comm_monoid M₂] {F : Type *}
369+ [add_monoid_hom_class F M M₂] (f : F)
379370 (R S : Type *) [semiring R] [semiring S] [module R M] [module S M₂] (x : ℕ) (a : M) :
380371 f ((x : R) • a) = (x : S) • f a :=
381- by simp only [←nsmul_eq_smul_cast, f. map_nsmul]
372+ by simp only [←nsmul_eq_smul_cast, map_nsmul]
382373
383- lemma map_inv_int_cast_smul {E F : Type *} [add_comm_group E] [add_comm_group F] (f : E →+ F)
384- (R S : Type *) [division_ring R] [division_ring S] [module R E] [module S F]
385- (n : ℤ) (x : E) :
374+ lemma map_inv_int_cast_smul [add_comm_group M] [add_comm_group M₂] {F : Type *}
375+ [add_monoid_hom_class F M M₂] (f : F)
376+ (R S : Type *) [division_ring R] [division_ring S] [module R M] [module S M₂]
377+ (n : ℤ) (x : M) :
386378 f ((n⁻¹ : R) • x) = (n⁻¹ : S) • f x :=
387379begin
388380 by_cases hR : (n : R) = 0 ; by_cases hS : (n : S) = 0 ,
@@ -394,65 +386,79 @@ begin
394386 { rw [← inv_smul_smul₀ hS (f _), ← map_int_cast_smul f R S, smul_inv_smul₀ hR] }
395387end
396388
397- lemma map_inv_nat_cast_smul {E F : Type *} [add_comm_group E] [add_comm_group F] (f : E →+ F)
398- (R S : Type *) [division_ring R] [division_ring S] [module R E] [module S F]
399- (n : ℕ) (x : E) :
389+ lemma map_inv_nat_cast_smul [add_comm_group M] [add_comm_group M₂] {F : Type *}
390+ [add_monoid_hom_class F M M₂] (f : F)
391+ (R S : Type *) [division_ring R] [division_ring S] [module R M] [module S M₂]
392+ (n : ℕ) (x : M) :
400393 f ((n⁻¹ : R) • x) = (n⁻¹ : S) • f x :=
401- f. map_inv_int_cast_smul R S n x
394+ map_inv_int_cast_smul f R S n x
402395
403- lemma map_rat_cast_smul {E F : Type *} [add_comm_group E] [add_comm_group F] (f : E →+ F)
404- (R S : Type *) [division_ring R] [division_ring S] [module R E] [module S F]
405- (c : ℚ) (x : E) :
396+ lemma map_rat_cast_smul [add_comm_group M] [add_comm_group M₂] {F : Type *}
397+ [add_monoid_hom_class F M M₂] (f : F)
398+ (R S : Type *) [division_ring R] [division_ring S] [module R M] [module S M₂]
399+ (c : ℚ) (x : M) :
406400 f ((c : R) • x) = (c : S) • f x :=
407401by rw [rat.cast_def, rat.cast_def, div_eq_mul_inv, div_eq_mul_inv, mul_smul, mul_smul,
408402 map_int_cast_smul f R S, map_inv_nat_cast_smul f R S]
409403
410- lemma map_rat_module_smul {E : Type *} [add_comm_group E ] [module ℚ E]
411- {F : Type *} [add_comm_group F] [module ℚ F ] (f : E →+ F) (c : ℚ) (x : E ) :
404+ lemma map_rat_smul [add_comm_group M] [add_comm_group M₂ ] [module ℚ M] [module ℚ M₂] {F : Type *}
405+ [add_monoid_hom_class F M M₂ ] (f : F) (c : ℚ) (x : M ) :
412406 f (c • x) = c • f x :=
413- rat.cast_id c ▸ f.map_rat_cast_smul ℚ ℚ c x
414-
415- end add_monoid_hom
407+ rat.cast_id c ▸ map_rat_cast_smul f ℚ ℚ c x
416408
417409/-- There can be at most one `module ℚ E` structure on an additive commutative group. This is not
418410an instance because `simp` becomes very slow if we have many `subsingleton` instances,
419411see [ gh-6025 ] . -/
420412lemma subsingleton_rat_module (E : Type *) [add_comm_group E] : subsingleton (module ℚ E) :=
421413⟨λ P Q, module.ext' P Q $ λ r x,
422- @add_monoid_hom.map_rat_module_smul E ‹_› P E ‹_› Q (add_monoid_hom.id _ ) r x⟩
414+ @map_rat_smul _ _ _ _ P Q _ _ (add_monoid_hom.id E ) r x⟩
423415
424416/-- If `E` is a vector space over two division rings `R` and `S`, then scalar multiplications
425417agree on inverses of integer numbers in `R` and `S`. -/
426418lemma inv_int_cast_smul_eq {E : Type *} (R S : Type *) [add_comm_group E] [division_ring R]
427419 [division_ring S] [module R E] [module S E] (n : ℤ) (x : E) :
428420 (n⁻¹ : R) • x = (n⁻¹ : S) • x :=
429- (add_monoid_hom.id E).map_inv_int_cast_smul R S n x
421+ map_inv_int_cast_smul (add_monoid_hom.id E) R S n x
430422
431423/-- If `E` is a vector space over two division rings `R` and `S`, then scalar multiplications
432424agree on inverses of natural numbers in `R` and `S`. -/
433425lemma inv_nat_cast_smul_eq {E : Type *} (R S : Type *) [add_comm_group E] [division_ring R]
434426 [division_ring S] [module R E] [module S E] (n : ℕ) (x : E) :
435427 (n⁻¹ : R) • x = (n⁻¹ : S) • x :=
436- (add_monoid_hom.id E).map_inv_nat_cast_smul R S n x
428+ map_inv_nat_cast_smul (add_monoid_hom.id E) R S n x
429+
430+ /-- If `E` is a vector space over a division rings `R` and has a monoid action by `α`, then that
431+ action commutes by scalar multiplication of inverses of integers in `R` -/
432+ lemma inv_int_cast_smul_comm {α E : Type *} (R : Type *) [add_comm_group E] [division_ring R]
433+ [monoid α] [module R E] [distrib_mul_action α E] (n : ℤ) (s : α) (x : E) :
434+ (n⁻¹ : R) • s • x = s • (n⁻¹ : R) • x :=
435+ (map_inv_int_cast_smul (distrib_mul_action.to_add_monoid_hom E s) R R n x).symm
436+
437+ /-- If `E` is a vector space over a division rings `R` and has a monoid action by `α`, then that
438+ action commutes by scalar multiplication of inverses of natural numbers in `R`. -/
439+ lemma inv_nat_cast_smul_comm {α E : Type *} (R : Type *) [add_comm_group E] [division_ring R]
440+ [monoid α] [module R E] [distrib_mul_action α E] (n : ℕ) (s : α) (x : E) :
441+ (n⁻¹ : R) • s • x = s • (n⁻¹ : R) • x :=
442+ (map_inv_nat_cast_smul (distrib_mul_action.to_add_monoid_hom E s) R R n x).symm
437443
438444/-- If `E` is a vector space over two division rings `R` and `S`, then scalar multiplications
439445agree on rational numbers in `R` and `S`. -/
440446lemma rat_cast_smul_eq {E : Type *} (R S : Type *) [add_comm_group E] [division_ring R]
441447 [division_ring S] [module R E] [module S E] (r : ℚ) (x : E) :
442448 (r : R) • x = (r : S) • x :=
443- (add_monoid_hom.id E).map_rat_cast_smul R S r x
449+ map_rat_cast_smul (add_monoid_hom.id E) R S r x
444450
445451instance add_comm_group.int_is_scalar_tower {R : Type u} {M : Type v} [ring R] [add_comm_group M]
446452 [module R M]: is_scalar_tower ℤ R M :=
447- { smul_assoc := λ n x y, ((smul_add_hom R M).flip y).map_int_module_smul n x }
453+ { smul_assoc := λ n x y, ((smul_add_hom R M).flip y).map_zsmul x n }
448454
449455instance is_scalar_tower.rat {R : Type u} {M : Type v} [ring R] [add_comm_group M]
450456 [module R M] [module ℚ R] [module ℚ M] : is_scalar_tower ℚ R M :=
451- { smul_assoc := λ r x y, ((smul_add_hom R M).flip y).map_rat_module_smul r x }
457+ { smul_assoc := λ r x y, map_rat_smul ((smul_add_hom R M).flip y) r x }
452458
453459instance smul_comm_class.rat {R : Type u} {M : Type v} [semiring R] [add_comm_group M]
454460 [module R M] [module ℚ M] : smul_comm_class ℚ R M :=
455- { smul_comm := λ r x y, ((smul_add_hom R M x).map_rat_module_smul r y).symm }
461+ { smul_comm := λ r x y, (map_rat_smul (smul_add_hom R M x) r y).symm }
456462
457463instance smul_comm_class.rat' {R : Type u} {M : Type v} [semiring R] [add_comm_group M]
458464 [module R M] [module ℚ M] : smul_comm_class R ℚ M :=
0 commit comments