@@ -4,7 +4,6 @@ Released under Apache 2.0 license as described in the file LICENSE.
44Authors: Kenny Lau, Yury Kudryashov
55-/
66import Mathlib.Algebra.Algebra.Defs
7- import Mathlib.Algebra.GroupWithZero.Action.Basic
87import Mathlib.Algebra.Module.Equiv.Defs
98import Mathlib.Data.Rat.Cast.CharZero
109
@@ -28,24 +27,7 @@ theorem map_rat_algebraMap [Semiring R] [Semiring S] [Algebra ℚ R] [Algebra
2827end RingHom
2928
3029namespace NNRat
31- variable [DivisionSemiring R] [CharZero R]
32-
33- section Semiring
34- variable [Semiring S] [Module ℚ≥0 S]
35-
36- variable (R) in
37- /-- `nnqsmul` is equal to any other module structure via a cast. -/
38- lemma cast_smul_eq_nnqsmul [Module R S] (q : ℚ≥0 ) (a : S) : (q : R) • a = q • a := by
39- refine MulAction.injective₀ (G₀ := ℚ≥0 ) (Nat.cast_ne_zero.2 q.den_pos.ne') ?_
40- dsimp
41- rw [← mul_smul, den_mul_eq_num, Nat.cast_smul_eq_nsmul, Nat.cast_smul_eq_nsmul, ← smul_assoc,
42- nsmul_eq_mul q.den, ← cast_natCast, ← cast_mul, den_mul_eq_num, cast_natCast,
43- Nat.cast_smul_eq_nsmul]
44-
45- end Semiring
46-
47- section DivisionSemiring
48- variable [DivisionSemiring S] [CharZero S]
30+ variable [DivisionSemiring R] [CharZero R] [DivisionSemiring S] [CharZero S]
4931
5032instance _root_.DivisionSemiring.toNNRatAlgebra : Algebra ℚ≥0 R where
5133 smul_def' := smul_def
@@ -64,28 +46,10 @@ instance instSMulCommClass [SMulCommClass R S S] : SMulCommClass ℚ≥0 R S whe
6446instance instSMulCommClass' [SMulCommClass S R S] : SMulCommClass R ℚ≥0 S :=
6547 have := SMulCommClass.symm S R S; SMulCommClass.symm _ _ _
6648
67- end DivisionSemiring
6849end NNRat
6950
7051namespace Rat
71- variable [DivisionRing R] [CharZero R]
72-
73- section Ring
74- variable [Ring S] [Module ℚ S]
75-
76- variable (R) in
77- /-- `qsmul` is equal to any other module structure via a cast. -/
78- lemma cast_smul_eq_qsmul [Module R S] (q : ℚ) (a : S) : (q : R) • a = q • a := by
79- refine MulAction.injective₀ (G₀ := ℚ) (Nat.cast_ne_zero.2 q.den_pos.ne') ?_
80- dsimp
81- rw [← mul_smul, den_mul_eq_num, Nat.cast_smul_eq_nsmul, Int.cast_smul_eq_zsmul, ← smul_assoc,
82- nsmul_eq_mul q.den, ← cast_natCast, ← cast_mul, den_mul_eq_num, cast_intCast,
83- Int.cast_smul_eq_zsmul]
84-
85- end Ring
86-
87- section DivisionRing
88- variable [DivisionRing S] [CharZero S]
52+ variable [DivisionRing R] [CharZero R] [DivisionRing S] [CharZero S]
8953
9054instance _root_.DivisionRing.toRatAlgebra : Algebra ℚ R where
9155 smul_def' := smul_def
@@ -108,8 +72,6 @@ instance instSMulCommClass [SMulCommClass R S S] : SMulCommClass ℚ R S where
10872instance instSMulCommClass' [SMulCommClass S R S] : SMulCommClass R ℚ S :=
10973 have := SMulCommClass.symm S R S; SMulCommClass.symm _ _ _
11074
111- end DivisionRing
112-
11375instance algebra_rat_subsingleton {R} [Semiring R] : Subsingleton (Algebra ℚ R) :=
11476 ⟨fun x y => Algebra.algebra_ext x y <| RingHom.congr_fun <| Subsingleton.elim _ _⟩
11577
0 commit comments