@@ -5,7 +5,7 @@ Authors: Kenny Lau, Yury Kudryashov
5
5
-/
6
6
import data.matrix.basic
7
7
import linear_algebra.tensor_product
8
- import ring_theory.subsemiring
8
+ import ring_theory.subring
9
9
import deprecated.subring
10
10
11
11
/-!
@@ -187,19 +187,33 @@ instance of_subsemiring (S : subsemiring R) : algebra S A :=
187
187
188
188
/-- Algebra over a subring. -/
189
189
instance of_subring {R A : Type *} [comm_ring R] [ring A] [algebra R A]
190
- (S : set R) [is_subring S] : algebra S A :=
190
+ (S : subring R) : algebra S A :=
191
191
{ smul := λ s x, (s : R) • x,
192
192
commutes' := λ r x, algebra.commutes r x,
193
193
smul_def' := λ r x, algebra.smul_def r x,
194
- .. (algebra_map R A).comp (⟨coe, rfl, λ _ _, rfl, rfl, λ _ _, rfl⟩ : S →+* R) }
194
+ .. (algebra_map R A).comp (subring.subtype S) }
195
+
196
+ lemma algebra_map_of_subring {R : Type *} [comm_ring R] (S : subring R) :
197
+ (algebra_map S R : S →+* R) = subring.subtype S := rfl
198
+
199
+ lemma coe_algebra_map_of_subring {R : Type *} [comm_ring R] (S : subring R) :
200
+ (algebra_map S R : S → R) = subtype.val := rfl
201
+
202
+ lemma algebra_map_of_subring_apply {R : Type *} [comm_ring R] (S : subring R) (x : S) :
203
+ algebra_map S R x = x := rfl
195
204
196
- lemma subring_coe_algebra_map_hom {R : Type *} [comm_ring R] (S : set R) [is_subring S] :
205
+ /-- Algebra over a set that is closed under the ring operations. -/
206
+ instance of_is_subring {R A : Type *} [comm_ring R] [ring A] [algebra R A]
207
+ (S : set R) [is_subring S] : algebra S A :=
208
+ algebra.of_subring S.to_subring
209
+
210
+ lemma is_subring_coe_algebra_map_hom {R : Type *} [comm_ring R] (S : set R) [is_subring S] :
197
211
(algebra_map S R : S →+* R) = is_subring.subtype S := rfl
198
212
199
- lemma subring_coe_algebra_map {R : Type *} [comm_ring R] (S : set R) [is_subring S] :
213
+ lemma is_subring_coe_algebra_map {R : Type *} [comm_ring R] (S : set R) [is_subring S] :
200
214
(algebra_map S R : S → R) = subtype.val := rfl
201
215
202
- lemma subring_algebra_map_apply {R : Type *} [comm_ring R] (S : set R) [is_subring S] (x : S) :
216
+ lemma is_subring_algebra_map_apply {R : Type *} [comm_ring R] (S : set R) [is_subring S] (x : S) :
203
217
algebra_map S R x = x := rfl
204
218
205
219
lemma set_range_subset {R : Type *} [comm_ring R] {T₁ T₂ : set R} [is_subring T₁] (hyp : T₁ ⊆ T₂) :
@@ -471,6 +485,19 @@ variables [algebra R A] [algebra R B] [algebra R C] (φ : A →ₐ[R] B)
471
485
472
486
end ring
473
487
488
+ section division_ring
489
+
490
+ variables [comm_ring R] [division_ring A] [division_ring B]
491
+ variables [algebra R A] [algebra R B] (φ : A →ₐ[R] B)
492
+
493
+ @[simp] lemma map_inv (x) : φ (x⁻¹) = (φ x)⁻¹ :=
494
+ φ.to_ring_hom.map_inv x
495
+
496
+ @[simp] lemma map_div (x y) : φ (x / y) = φ x / φ y :=
497
+ φ.to_ring_hom.map_div x y
498
+
499
+ end division_ring
500
+
474
501
theorem injective_iff {R A B : Type *} [comm_semiring R] [ring A] [semiring B]
475
502
[algebra R A] [algebra R B] (f : A →ₐ[R] B) :
476
503
function.injective f ↔ (∀ x, f x = 0 → x = 0 ) :=
@@ -744,20 +771,22 @@ instance algebra_rat {α} [division_ring α] [char_zero α] : algebra ℚ α :=
744
771
745
772
end rat
746
773
747
- /-- A subalgebra is a subring that includes the range of `algebra_map`. -/
774
+ /-- A subalgebra is a sub(semi)ring that includes the range of `algebra_map`. -/
748
775
structure subalgebra (R : Type u) (A : Type v)
749
- [comm_semiring R] [semiring A] [algebra R A] : Type v :=
750
- (carrier : subsemiring A)
776
+ [comm_semiring R] [semiring A] [algebra R A] extends subsemiring A : Type v :=
751
777
(algebra_map_mem' : ∀ r, algebra_map R A r ∈ carrier)
752
778
779
+ /-- Reinterpret a `subalgebra` as a `subsemiring`. -/
780
+ add_decl_doc subalgebra.to_subsemiring
781
+
753
782
namespace subalgebra
754
783
755
784
variables {R : Type u} {A : Type v} {B : Type w}
756
785
variables [comm_semiring R] [semiring A] [algebra R A] [semiring B] [algebra R B]
757
786
include R
758
787
759
788
instance : has_coe (subalgebra R A) (subsemiring A) :=
760
- ⟨λ S, S.carrier ⟩
789
+ ⟨λ S, { ..S } ⟩
761
790
762
791
instance : has_mem A (subalgebra R A) :=
763
792
⟨λ x S, x ∈ (S : set A)⟩
@@ -859,6 +888,12 @@ instance {R : Type u} {A : Type v} [comm_semiring R] [semiring A] [algebra R A]
859
888
{ one_mem := S.one_mem,
860
889
mul_mem := λ _ _, S.mul_mem }
861
890
891
+ /-- A subalgebra over a ring is also a `subring`. -/
892
+ def to_subring {R : Type u} {A : Type v} [comm_ring R] [ring A] [algebra R A] (S : subalgebra R A) :
893
+ subring A :=
894
+ { neg_mem' := λ _, S.neg_mem,
895
+ .. S.to_subsemiring }
896
+
862
897
instance {R : Type u} {A : Type v} [comm_ring R] [ring A] [algebra R A] (S : subalgebra R A) :
863
898
is_subring (S : set A) :=
864
899
{ neg_mem := λ _, S.neg_mem }
@@ -928,27 +963,27 @@ instance : partial_order (subalgebra R A) :=
928
963
def comap {R : Type u} {S : Type v} {A : Type w}
929
964
[comm_semiring R] [comm_semiring S] [semiring A] [algebra R S] [algebra S A]
930
965
(iSB : subalgebra S A) : subalgebra R (algebra.comap R S A) :=
931
- { carrier := ( iSB : subsemiring A ),
932
- algebra_map_mem' := λ r, iSB.algebra_map_mem (algebra_map R S r) }
966
+ { algebra_map_mem' := λ r, iSB.algebra_map_mem (algebra_map R S r ),
967
+ .. iSB }
933
968
934
969
/-- If `S` is an `R`-subalgebra of `A` and `T` is an `S`-subalgebra of `A`,
935
970
then `T` is an `R`-subalgebra of `A`. -/
936
971
def under {R : Type u} {A : Type v} [comm_semiring R] [comm_semiring A]
937
972
{i : algebra R A} (S : subalgebra R A)
938
973
(T : subalgebra S A) : subalgebra R A :=
939
- { carrier := T ,
940
- algebra_map_mem' := λ r, T.algebra_map_mem ⟨algebra_map R A r, S.algebra_map_mem r⟩ }
974
+ { algebra_map_mem' := λ r, T.algebra_map_mem ⟨algebra_map R A r, S.algebra_map_mem r⟩ ,
975
+ .. T }
941
976
942
977
/-- Transport a subalgebra via an algebra homomorphism. -/
943
978
def map (S : subalgebra R A) (f : A →ₐ[R] B) : subalgebra R B :=
944
- { carrier := subsemiring.map (f : A →+* B) S ,
945
- algebra_map_mem' := λ r, f.commutes r ▸ set.mem_image_of_mem _ (S.algebra_map_mem r) }
979
+ { algebra_map_mem' := λ r, f.commutes r ▸ set.mem_image_of_mem _ (S.algebra_map_mem r) ,
980
+ .. subsemiring.map (f : A →+* B) S, }
946
981
947
982
/-- Preimage of a subalgebra under an algebra homomorphism. -/
948
983
def comap' (S : subalgebra R B) (f : A →ₐ[R] B) : subalgebra R A :=
949
- { carrier := subsemiring.comap (f : A →+* B) S,
950
- algebra_map_mem' := λ r, show f (algebra_map R A r) ∈ S ,
951
- from (f.commutes r).symm ▸ S.algebra_map_mem r }
984
+ { algebra_map_mem' := λ r, show f (algebra_map R A r) ∈ S,
985
+ from (f.commutes r).symm ▸ S.algebra_map_mem r ,
986
+ .. subsemiring.comap (f : A →+* B) S, }
952
987
953
988
theorem map_le {S : subalgebra R A} {f : A →ₐ[R] B} {U : subalgebra R B} :
954
989
map S f ≤ U ↔ S ≤ comap' U f :=
@@ -972,13 +1007,14 @@ variables (φ : A →ₐ[R] B)
972
1007
973
1008
/-- Range of an `alg_hom` as a subalgebra. -/
974
1009
protected def range (φ : A →ₐ[R] B) : subalgebra R B :=
975
- { carrier :=
976
- { carrier := set.range φ,
977
- one_mem' := ⟨1 , φ.map_one⟩,
978
- mul_mem' := λ _ _ ⟨x, hx⟩ ⟨y, hy⟩, ⟨x * y, by rw [φ.map_mul, hx, hy]⟩,
979
- zero_mem' := ⟨0 , φ.map_zero⟩,
980
- add_mem' := λ _ _ ⟨x, hx⟩ ⟨y, hy⟩, ⟨x + y, by rw [φ.map_add, hx, hy]⟩ },
981
- algebra_map_mem' := λ r, ⟨algebra_map R A r, φ.commutes r⟩ }
1010
+ { algebra_map_mem' := λ r, ⟨algebra_map R A r, set.mem_univ _, φ.commutes r⟩,
1011
+ .. φ.to_ring_hom.srange }
1012
+
1013
+ @[simp] lemma mem_range (φ : A →ₐ[R] B) {y : B} :
1014
+ y ∈ φ.range ↔ ∃ x, φ x = y := ring_hom.mem_srange
1015
+
1016
+ @[simp] lemma coe_range (φ : A →ₐ[R] B) : (φ.range : set B) = set.range φ :=
1017
+ by { ext, rw [subalgebra.mem_coe, mem_range], refl }
982
1018
983
1019
/-- Restrict the codomain of an algebra homomorphism. -/
984
1020
def cod_restrict (f : A →ₐ[R] B) (S : subalgebra R B) (hf : ∀ x, f x ∈ S) : A →ₐ[R] S :=
@@ -1013,8 +1049,8 @@ variables [comm_semiring R] [semiring A] [algebra R A] [semiring B] [algebra R B
1013
1049
1014
1050
/-- The minimal subalgebra that includes `s`. -/
1015
1051
def adjoin (s : set A) : subalgebra R A :=
1016
- { carrier := subsemiring.closure (set.range (algebra_map R A) ∪ s) ,
1017
- algebra_map_mem' := λ r, subsemiring.subset_closure $ or.inl ⟨r, rfl⟩ }
1052
+ { algebra_map_mem' := λ r, subsemiring.subset_closure $ or.inl ⟨r, rfl⟩ ,
1053
+ .. subsemiring.closure (set.range (algebra_map R A) ∪ s) }
1018
1054
variables {R}
1019
1055
1020
1056
protected lemma gc : galois_connection (adjoin R : set A → subalgebra R A) coe :=
@@ -1034,8 +1070,9 @@ galois_insertion.lift_complete_lattice algebra.gi
1034
1070
instance : inhabited (subalgebra R A) := ⟨⊥⟩
1035
1071
1036
1072
theorem mem_bot {x : A} : x ∈ (⊥ : subalgebra R A) ↔ x ∈ set.range (algebra_map R A) :=
1037
- suffices (⊥ : subalgebra R A) = (of_id R A).range, by rw this ; refl,
1038
- le_antisymm bot_le $ subalgebra.range_le _
1073
+ suffices (of_id R A).range = (⊥ : subalgebra R A),
1074
+ by { rw [← this , ← subalgebra.mem_coe, alg_hom.coe_range], refl },
1075
+ le_bot_iff.mp (λ x hx, subalgebra.range_le _ ((of_id R A).coe_range ▸ hx))
1039
1076
1040
1077
theorem mem_top {x : A} : x ∈ (⊤ : subalgebra R A) :=
1041
1078
subsemiring.subset_closure $ or.inr trivial
@@ -1048,7 +1085,8 @@ theorem eq_top_iff {S : subalgebra R A} :
1048
1085
⟨λ h x, by rw h; exact mem_top, λ h, by ext x; exact ⟨λ _, mem_top, λ _, h x⟩⟩
1049
1086
1050
1087
@[simp] theorem map_top (f : A →ₐ[R] B) : subalgebra.map (⊤ : subalgebra R A) f = f.range :=
1051
- subalgebra.ext $ λ x, ⟨λ ⟨y, _, hy⟩, ⟨y, hy⟩, λ ⟨y, hy⟩, ⟨y, algebra.mem_top, hy⟩⟩
1088
+ subalgebra.ext $ λ x,
1089
+ ⟨λ ⟨y, _, hy⟩, ⟨y, set.mem_univ _, hy⟩, λ ⟨y, mem, hy⟩, ⟨y, algebra.mem_top, hy⟩⟩
1052
1090
1053
1091
@[simp] theorem map_bot (f : A →ₐ[R] B) : subalgebra.map (⊥ : subalgebra R A) f = ⊥ :=
1054
1092
eq_bot_iff.2 $ λ x ⟨y, hy, hfy⟩, let ⟨r, hr⟩ := mem_bot.1 hy in subalgebra.range_le _
@@ -1105,8 +1143,8 @@ instance algebra_nat : algebra ℕ R :=
1105
1143
variables {R}
1106
1144
/-- A subsemiring is a `ℕ`-subalgebra. -/
1107
1145
def subalgebra_of_subsemiring (S : subsemiring R) : subalgebra ℕ R :=
1108
- { carrier := S ,
1109
- algebra_map_mem' := λ i, S.coe_nat_mem i }
1146
+ { algebra_map_mem' := λ i, S.coe_nat_mem i ,
1147
+ .. S }
1110
1148
1111
1149
@[simp] lemma mem_subalgebra_of_subsemiring {x : R} {S : subsemiring R} :
1112
1150
x ∈ subalgebra_of_subsemiring S ↔ x ∈ S :=
@@ -1153,19 +1191,18 @@ def ring_hom.to_int_alg_hom {R S : Type*} [ring R] [ring S] (f : R →+* S) : R
1153
1191
.. f }
1154
1192
1155
1193
variables {R}
1194
+
1156
1195
/-- A subring is a `ℤ`-subalgebra. -/
1157
- def subalgebra_of_subring (S : set R) [is_subring S] : subalgebra ℤ R :=
1158
- { carrier :=
1159
- { carrier := S,
1160
- one_mem' := is_submonoid.one_mem,
1161
- mul_mem' := λ _ _, is_submonoid.mul_mem,
1162
- zero_mem' := is_add_submonoid.zero_mem,
1163
- add_mem' := λ _ _, is_add_submonoid.add_mem, },
1164
- algebra_map_mem' := λ i, int.induction_on i (show (0 : R) ∈ S, from is_add_submonoid.zero_mem)
1165
- (λ i ih, show (i + 1 : R) ∈ S, from is_add_submonoid.add_mem ih is_submonoid.one_mem)
1166
- (λ i ih, show ((-i - 1 : ℤ) : R) ∈ S, by { rw [int.cast_sub, int.cast_one],
1167
- exact is_add_subgroup.sub_mem S _ _ ih is_submonoid.one_mem }) }
1196
+ def subalgebra_of_subring (S : subring R) : subalgebra ℤ R :=
1197
+ { algebra_map_mem' := λ i, int.induction_on i S.zero_mem
1198
+ (λ i ih, S.add_mem ih S.one_mem)
1199
+ (λ i ih, show ((-i - 1 : ℤ) : R) ∈ S, by { rw [int.cast_sub, int.cast_one],
1200
+ exact S.sub_mem ih S.one_mem }),
1201
+ .. S }
1168
1202
1203
+ /-- A subset closed under the ring operations is a `ℤ`-subalgebra. -/
1204
+ def subalgebra_of_is_subring (S : set R) [is_subring S] : subalgebra ℤ R :=
1205
+ subalgebra_of_subring S.to_subring
1169
1206
1170
1207
section
1171
1208
variables {S : Type *} [ring S]
@@ -1181,10 +1218,14 @@ instance nat_algebra_subsingleton : subsingleton (algebra ℕ S) :=
1181
1218
⟨λ P Q, by { ext, simp, }⟩
1182
1219
end
1183
1220
1184
- @[simp] lemma mem_subalgebra_of_subring {x : R} {S : set R} [is_subring S] :
1221
+ @[simp] lemma mem_subalgebra_of_subring {x : R} {S : subring R} :
1185
1222
x ∈ subalgebra_of_subring S ↔ x ∈ S :=
1186
1223
iff.rfl
1187
1224
1225
+ @[simp] lemma mem_subalgebra_of_is_subring {x : R} {S : set R} [is_subring S] :
1226
+ x ∈ subalgebra_of_is_subring S ↔ x ∈ S :=
1227
+ iff.rfl
1228
+
1188
1229
section span_int
1189
1230
open submodule
1190
1231
0 commit comments