Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 4b92a46

Browse files
committed
chore(ring_theory/kaehler): cleanup instances (#19234)
The previous module instance has the wrong defeqs, and was more work to construct. The new one remains propositionally equal to the old one.
1 parent 88fcdc3 commit 4b92a46

2 files changed

Lines changed: 21 additions & 36 deletions

File tree

src/ring_theory/ideal/cotangent.lean

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,10 @@ instance cotangent.module_of_tower : module S I.cotangent :=
3838
submodule.quotient.module' _
3939

4040
instance : is_scalar_tower S S' I.cotangent :=
41-
begin
42-
delta cotangent,
43-
constructor,
44-
intros s s' x,
45-
rw [← @is_scalar_tower.algebra_map_smul S' R, ← @is_scalar_tower.algebra_map_smul S' R,
46-
← smul_assoc, ← is_scalar_tower.to_alg_hom_apply S S' R, map_smul],
47-
refl
48-
end
41+
submodule.quotient.is_scalar_tower _ _
4942

50-
instance [is_noetherian R I] : is_noetherian R I.cotangent := by { delta cotangent, apply_instance }
43+
instance [is_noetherian R I] : is_noetherian R I.cotangent :=
44+
submodule.quotient.is_noetherian _
5145

5246
/-- The quotient map from `I` to `I ⧸ I ^ 2`. -/
5347
@[simps apply (lemmas_only)]

src/ring_theory/kaehler.lean

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -145,31 +145,23 @@ notation `Ω[`:100 S `⁄`:0 R `]`:0 := kaehler_differential R S
145145

146146
instance : nonempty Ω[S⁄R] := ⟨0
147147

148-
instance kaehler_differential.module' {R' : Type*} [comm_ring R'] [algebra R' S] :
148+
instance kaehler_differential.module' {R' : Type*} [comm_ring R'] [algebra R' S]
149+
[smul_comm_class R R' S] :
149150
module R' Ω[S⁄R] :=
150-
(module.comp_hom (kaehler_differential.ideal R S).cotangent (algebra_map R' S) : _)
151+
submodule.quotient.module' _
151152

152153
instance : is_scalar_tower S (S ⊗[R] S) Ω[S⁄R] :=
153154
ideal.cotangent.is_scalar_tower _
154155

155156
instance kaehler_differential.is_scalar_tower_of_tower {R₁ R₂ : Type*} [comm_ring R₁] [comm_ring R₂]
156-
[algebra R₁ S] [algebra R₂ S] [algebra R₁ R₂] [is_scalar_tower R₁ R₂ S] :
157+
[algebra R₁ S] [algebra R₂ S] [has_smul R₁ R₂]
158+
[smul_comm_class R R₁ S] [smul_comm_class R R₂ S] [is_scalar_tower R₁ R₂ S] :
157159
is_scalar_tower R₁ R₂ Ω[S⁄R] :=
158-
begin
159-
convert restrict_scalars.is_scalar_tower R₁ R₂ Ω[S⁄R] using 1,
160-
ext x m,
161-
show algebra_map R₁ S x • m = algebra_map R₂ S (algebra_map R₁ R₂ x) • m,
162-
rw ← is_scalar_tower.algebra_map_apply,
163-
end
160+
submodule.quotient.is_scalar_tower _ _
164161

165162
instance kaehler_differential.is_scalar_tower' :
166163
is_scalar_tower R (S ⊗[R] S) Ω[S⁄R] :=
167-
begin
168-
convert restrict_scalars.is_scalar_tower R (S ⊗[R] S) Ω[S⁄R] using 1,
169-
ext x m,
170-
show algebra_map R S x • m = algebra_map R (S ⊗[R] S) x • m,
171-
simp_rw [is_scalar_tower.algebra_map_apply R S (S ⊗[R] S), is_scalar_tower.algebra_map_smul]
172-
end
164+
submodule.quotient.is_scalar_tower _ _
173165

174166
/-- The quotient map `I → Ω[S⁄R]` with `I` being the kernel of `S ⊗[R] S → S`. -/
175167
def kaehler_differential.from_ideal : kaehler_differential.ideal R S →ₗ[S ⊗[R] S] Ω[S⁄R] :=
@@ -190,13 +182,14 @@ rfl
190182
/-- The universal derivation into `Ω[S⁄R]`. -/
191183
def kaehler_differential.D : derivation R S Ω[S⁄R] :=
192184
{ map_one_eq_zero' := begin
193-
dsimp [kaehler_differential.D_linear_map_apply],
185+
dsimp only [kaehler_differential.D_linear_map_apply],
194186
rw [ideal.to_cotangent_eq_zero, subtype.coe_mk, sub_self],
195187
exact zero_mem _
196188
end,
197189
leibniz' := λ a b, begin
198-
dsimp [kaehler_differential.D_linear_map_apply],
199-
rw [← linear_map.map_smul_of_tower, ← linear_map.map_smul_of_tower, ← map_add,
190+
dsimp only [kaehler_differential.D_linear_map_apply],
191+
rw [← linear_map.map_smul_of_tower ((kaehler_differential.ideal R S).to_cotangent) a,
192+
← linear_map.map_smul_of_tower ((kaehler_differential.ideal R S).to_cotangent) b, ← map_add,
200193
ideal.to_cotangent_eq, pow_two],
201194
convert submodule.mul_mem_mul (kaehler_differential.one_smul_sub_smul_one_mem_ideal R a : _)
202195
(kaehler_differential.one_smul_sub_smul_one_mem_ideal R b : _) using 1,
@@ -205,7 +198,7 @@ def kaehler_differential.D : derivation R S Ω[S⁄R] :=
205198
submodule.coe_smul_of_tower, smul_sub, tensor_product.smul_tmul', smul_eq_mul, mul_one],
206199
ring_nf,
207200
end,
208-
..(kaehler_differential.D_linear_map R S) }
201+
to_linear_map := kaehler_differential.D_linear_map R S }
209202

210203
lemma kaehler_differential.D_apply (s : S) :
211204
kaehler_differential.D R S s = (kaehler_differential.ideal R S).to_cotangent
@@ -373,9 +366,9 @@ into `(kaehler_differential.ideal R S).cotangent_ideal` -/
373366
-- `derivation R S Ω[S⁄R] ≃ₗ[R] derivation R S (kaehler_differential.ideal R S).cotangent_ideal`
374367
-- But lean times-out if this is given explicitly.
375368
noncomputable
376-
def kaehler_differential.End_equiv_derivation' :=
377-
@linear_equiv.comp_der R _ _ _ _ Ω[S⁄R] _ _ _ _ _ _ _ _ _
378-
((kaehler_differential.ideal R S).cotangent_equiv_ideal.restrict_scalars S)
369+
def kaehler_differential.End_equiv_derivation' :
370+
derivation R S Ω[S⁄R] ≃ₗ[R] derivation R S _ :=
371+
linear_equiv.comp_der ((kaehler_differential.ideal R S).cotangent_equiv_ideal.restrict_scalars S)
379372

380373
/-- (Implementation) An `equiv` version of `kaehler_differential.End_equiv_aux`.
381374
Used in `kaehler_differential.End_equiv`. -/
@@ -538,7 +531,7 @@ variables (A B : Type*) [comm_ring A] [comm_ring B] [algebra R A] [algebra S B]
538531
variables [algebra A B] [is_scalar_tower R S B] [is_scalar_tower R A B]
539532

540533
-- The map `(A →₀ A) →ₗ[A] (B →₀ B)`
541-
local notation `finsupp_map` := ((finsupp.map_range.linear_map (algebra.of_id A B).to_linear_map)
534+
local notation `finsupp_map` := ((finsupp.map_range.linear_map (algebra.linear_map A B))
542535
.comp (finsupp.lmap_domain A A (algebra_map A B)))
543536

544537
lemma kaehler_differential.ker_total_map (h : function.surjective (algebra_map A B)) :
@@ -552,7 +545,7 @@ begin
552545
set.image_univ, map_sub, map_add],
553546
simp only [linear_map.comp_apply, finsupp.map_range.linear_map_apply, finsupp.map_range_single,
554547
finsupp.lmap_domain_apply, finsupp.map_domain_single, alg_hom.to_linear_map_apply,
555-
algebra.of_id_apply, ← is_scalar_tower.algebra_map_apply, map_one, map_add, map_mul],
548+
algebra.linear_map_apply, ← is_scalar_tower.algebra_map_apply, map_one, map_add, map_mul],
556549
simp_rw [sup_assoc, ← (h.prod_map h).range_comp],
557550
congr' 3,
558551
rw [sup_eq_right],
@@ -565,8 +558,6 @@ end presentation
565558

566559
section exact_sequence
567560

568-
local attribute [irreducible] kaehler_differential
569-
570561
/- We have the commutative diagram
571562
A --→ B
572563
↑ ↑
@@ -585,7 +576,7 @@ def derivation.comp_algebra_map [module A M] [module B M] [is_scalar_tower A B M
585576
leibniz' := λ a b, by simp,
586577
to_linear_map := d.to_linear_map.comp (is_scalar_tower.to_alg_hom R A B).to_linear_map }
587578

588-
variables (R B)
579+
variables (R B) [smul_comm_class S A B]
589580

590581
/-- The map `Ω[A⁄R] →ₗ[A] Ω[B⁄R]` given a square
591582
A --→ B

0 commit comments

Comments
 (0)