@@ -14,6 +14,8 @@ in what generality.
14
14
15
15
namespace OreLocalization
16
16
17
+ section CommMagma
18
+
17
19
variable {R A : Type *} [CommMonoid R] [CommMagma A] [MulAction R A] [IsScalarTower R A A]
18
20
{S : Submonoid R}
19
21
@@ -72,8 +74,85 @@ protected def mul : A[S⁻¹] → A[S⁻¹] → A[S⁻¹] :=
72
74
instance : Mul (A[S⁻¹]) where
73
75
mul := OreLocalization.mul
74
76
77
+ protected def mul_def (a : A) (s : { x // x ∈ S }) (b : A) (t : { x // x ∈ S }) :
78
+ a /ₒ s * (b /ₒ t) = a * b /ₒ (t * s) := rfl
79
+
75
80
unseal OreLocalization.smul in
76
81
example (as bt : R[S⁻¹]) : as * bt = as • bt := rfl
82
+
83
+ end CommMagma
84
+
85
+ section One
86
+
87
+ variable {R A : Type *} [CommMonoid R] [MulAction R A] [One A] --[MulAction R A] [IsScalarTower R A A]
88
+ {S : Submonoid R}
89
+
90
+ instance : One (A[S⁻¹]) where
91
+ one := 1 /ₒ 1
92
+
93
+ protected lemma one_def' : (1 : A[S⁻¹]) = 1 /ₒ 1 := rfl
94
+
95
+ end One
96
+
97
+ section CommMonoid
98
+
99
+ variable {R A : Type *} [CommMonoid R] [CommMonoid A] [MulAction R A] [IsScalarTower R A A]
100
+ {S : Submonoid R}
101
+
102
+ instance commMonoid : CommMonoid (A[S⁻¹]) where
103
+ mul_assoc a b c := by
104
+ induction' a with a
105
+ induction' b with b
106
+ induction' c with c
107
+ change (a * b * c) /ₒ _ = (a * (b * c)) /ₒ _
108
+ simp [mul_assoc]
109
+ one_mul a := by
110
+ induction' a with a
111
+ change (1 * a) /ₒ _ = a /ₒ _
112
+ simp
113
+ mul_one a := by
114
+ induction' a with a s
115
+ simp [OreLocalization.mul_def, OreLocalization.one_def']
116
+ mul_comm a b := by
117
+ induction' a with a
118
+ induction' b with b
119
+ simp only [OreLocalization.mul_def, mul_comm]
120
+
121
+ end CommMonoid
122
+
123
+ section CommSemiring
124
+
125
+ variable {R A : Type *} [CommMonoid R] [CommRing A] [DistribMulAction R A] [IsScalarTower R A A]
126
+ {S : Submonoid R}
127
+
128
+ lemma left_distrib' (a b c : A[S⁻¹]) :
129
+ a * (b + c) = a * b + a * c := by
130
+ induction' a with a s
131
+ induction' b with b t
132
+ induction' c with c u
133
+ rcases oreDivAddChar' b c t u with ⟨r₁, s₁, h₁, q⟩; rw [q]; clear q
134
+ simp only [OreLocalization.mul_def]
135
+ rcases oreDivAddChar' (a * b) (a * c) (t * s) (u * s) with ⟨r₂, s₂, h₂, q⟩; rw [q]; clear q
136
+ rw [oreDiv_eq_iff]
137
+ sorry
138
+
139
+ instance : CommSemiring A[S⁻¹] where
140
+ __ := commMonoid
141
+ left_distrib := left_distrib'
142
+ right_distrib a b c := by
143
+ rw [mul_comm, mul_comm a, mul_comm b, left_distrib']
144
+ zero_mul a := by
145
+ induction' a with a s
146
+ rw [OreLocalization.zero_def, OreLocalization.mul_def]
147
+ simp
148
+ mul_zero a := by
149
+ induction' a with a s
150
+ rw [OreLocalization.zero_def, OreLocalization.mul_def]
151
+ simp
152
+
153
+ end CommSemiring
154
+
155
+
77
156
-- fails on mathlib master;
78
157
-- works if irreducibiliy of OreLocalization.smul is removed
79
158
@@ -90,4 +169,22 @@ units of `T`, to a ring homomorphism `R[S⁻¹] →+* T`. This extends the const
90
169
monoids. -/
91
170
def universalHom : R[ S⁻¹ ] →+* T :=
92
171
-/
172
+
173
+
174
+ section first_goal
175
+
176
+ variable {R A : Type *} [CommRing R] [CommRing A] [Algebra R A] {S : Submonoid R}
177
+
178
+ abbrev SR := R[S⁻¹]
179
+ abbrev SA := A[S⁻¹]
180
+
181
+
182
+ unseal OreLocalization.smul in
183
+ instance : Algebra (R[S⁻¹]) (A[S⁻¹]) where
184
+ /-
185
+ error:
186
+ failed to synthesize
187
+ Semiring (OreLocalization S A)
188
+ -/
189
+
93
190
end OreLocalization
0 commit comments