Skip to content

Commit b052147

Browse files
erdOnebjoernkjoshanssen
authored andcommitted
feat(RingTheory/Kaehler): Cotangent complex associated to an embedding into affine space. (#14859)
Co-authored-by: Andrew Yang <[email protected]>
1 parent f79581c commit b052147

File tree

7 files changed

+370
-17
lines changed

7 files changed

+370
-17
lines changed

Mathlib.lean

+1
Original file line numberDiff line numberDiff line change
@@ -3790,6 +3790,7 @@ import Mathlib.RingTheory.IsTensorProduct
37903790
import Mathlib.RingTheory.Jacobson
37913791
import Mathlib.RingTheory.JacobsonIdeal
37923792
import Mathlib.RingTheory.Kaehler.Basic
3793+
import Mathlib.RingTheory.Kaehler.CotangentComplex
37933794
import Mathlib.RingTheory.Kaehler.Polynomial
37943795
import Mathlib.RingTheory.LaurentSeries
37953796
import Mathlib.RingTheory.LittleWedderburn

Mathlib/Algebra/Exact.lean

+16
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,22 @@ theorem Exact.split_tfae
355355

356356
end split
357357

358+
section Prod
359+
360+
variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N]
361+
362+
lemma Exact.inr_fst : Function.Exact (LinearMap.inr R M N) (LinearMap.fst R M N) := by
363+
rintro ⟨x, y⟩
364+
simp only [LinearMap.fst_apply, @eq_comm _ x, LinearMap.coe_inr, Set.mem_range, Prod.mk.injEq,
365+
exists_eq_right]
366+
367+
lemma Exact.inl_snd : Function.Exact (LinearMap.inl R M N) (LinearMap.snd R M N) := by
368+
rintro ⟨x, y⟩
369+
simp only [LinearMap.snd_apply, @eq_comm _ y, LinearMap.coe_inl, Set.mem_range, Prod.mk.injEq,
370+
exists_eq_left]
371+
372+
end Prod
373+
358374
section Ring
359375

360376
open LinearMap Submodule

Mathlib/LinearAlgebra/Dual.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -1697,7 +1697,7 @@ theorem dualDistrib_dualDistribInvOfBasis_left_inverse (b : Basis ι R M) (c : B
16971697
Basis.tensorProduct_apply, coeFn_sum, Finset.sum_apply, smul_apply, LinearEquiv.coe_coe,
16981698
map_tmul, lid_tmul, smul_eq_mul, id_coe, id_eq]
16991699
rw [Finset.sum_eq_single i, Finset.sum_eq_single j]
1700-
· simp
1700+
· simpa using mul_comm _ _
17011701
all_goals { intros; simp [*] at * }
17021702

17031703
-- Porting note: introduced to help with timeout in dualDistribEquivOfBasis

Mathlib/LinearAlgebra/TensorProduct/Basis.lean

+24-5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ noncomputable section
1818

1919
open Set LinearMap Submodule
2020

21+
open scoped TensorProduct
22+
2123
section CommSemiring
2224

2325
variable {R : Type*} {S : Type*} {M : Type*} {N : Type*} {ι : Type*} {κ : Type*}
@@ -26,26 +28,43 @@ variable {R : Type*} {S : Type*} {M : Type*} {N : Type*} {ι : Type*} {κ : Type
2628

2729
/-- If `b : ι → M` and `c : κ → N` are bases then so is `fun i ↦ b i.1 ⊗ₜ c i.2 : ι × κ → M ⊗ N`. -/
2830
def Basis.tensorProduct (b : Basis ι S M) (c : Basis κ R N) :
29-
Basis (ι × κ) S (TensorProduct R M N) :=
31+
Basis (ι × κ) S (M ⊗[R] N) :=
3032
Finsupp.basisSingleOne.map
3133
((TensorProduct.AlgebraTensorModule.congr b.repr c.repr).trans <|
3234
(finsuppTensorFinsupp R S _ _ _ _).trans <|
3335
Finsupp.lcongr (Equiv.refl _) (TensorProduct.AlgebraTensorModule.rid R S S)).symm
3436

3537
@[simp]
36-
theorem Basis.tensorProduct_apply (b : Basis ι R M) (c : Basis κ R N) (i : ι) (j : κ) :
38+
theorem Basis.tensorProduct_apply (b : Basis ι S M) (c : Basis κ R N) (i : ι) (j : κ) :
3739
Basis.tensorProduct b c (i, j) = b i ⊗ₜ c j := by
3840
simp [Basis.tensorProduct]
3941

40-
theorem Basis.tensorProduct_apply' (b : Basis ι R M) (c : Basis κ R N) (i : ι × κ) :
42+
theorem Basis.tensorProduct_apply' (b : Basis ι S M) (c : Basis κ R N) (i : ι × κ) :
4143
Basis.tensorProduct b c i = b i.1 ⊗ₜ c i.2 := by
4244
simp [Basis.tensorProduct]
4345

4446
@[simp]
45-
theorem Basis.tensorProduct_repr_tmul_apply (b : Basis ι R M) (c : Basis κ R N) (m : M) (n : N)
47+
theorem Basis.tensorProduct_repr_tmul_apply (b : Basis ι S M) (c : Basis κ R N) (m : M) (n : N)
4648
(i : ι) (j : κ) :
47-
(Basis.tensorProduct b c).repr (m ⊗ₜ n) (i, j) = b.repr m i * c.repr n j := by
49+
(Basis.tensorProduct b c).repr (m ⊗ₜ n) (i, j) = c.repr n j • b.repr m i := by
4850
simp [Basis.tensorProduct, mul_comm]
4951

52+
variable (S)
53+
54+
/-- The lift of an `R`-basis of `M` to an `S`-basis of the base change `S ⊗[R] M`. -/
55+
noncomputable
56+
def Basis.baseChange (b : Basis ι R M) : Basis ι S (S ⊗[R] M) :=
57+
((Basis.singleton Unit S).tensorProduct b).reindex (Equiv.punitProd ι)
58+
59+
@[simp]
60+
lemma Basis.baseChange_repr_tmul (b : Basis ι R M) (x y i) :
61+
(b.baseChange S).repr (x ⊗ₜ y) i = b.repr y i • x := by
62+
simp [Basis.baseChange, Basis.tensorProduct]
63+
64+
@[simp]
65+
lemma Basis.baseChange_apply (b : Basis ι R M) (i) :
66+
b.baseChange S i = 1 ⊗ₜ b i := by
67+
simp [Basis.baseChange, Basis.tensorProduct]
68+
5069
end CommSemiring
5170
end

Mathlib/LinearAlgebra/TensorProduct/Matrix.lean

+9-10
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ theorem TensorProduct.toMatrix_map (f : M →ₗ[R] M') (g : N →ₗ[R] N') :
4040
ext ⟨i, j⟩ ⟨i', j'⟩
4141
simp_rw [Matrix.kroneckerMap_apply, toMatrix_apply, Basis.tensorProduct_apply,
4242
TensorProduct.map_tmul, Basis.tensorProduct_repr_tmul_apply]
43+
exact mul_comm _ _
4344

4445
/-- The matrix built from `Matrix.kronecker` corresponds to the linear map built from
4546
`TensorProduct.map`. -/
@@ -54,20 +55,18 @@ theorem TensorProduct.toMatrix_comm :
5455
toMatrix (bM.tensorProduct bN) (bN.tensorProduct bM) (TensorProduct.comm R M N) =
5556
(1 : Matrix (ι × κ) (ι × κ) R).submatrix Prod.swap _root_.id := by
5657
ext ⟨i, j⟩ ⟨i', j'⟩
57-
simp_rw [toMatrix_apply, Basis.tensorProduct_apply, LinearEquiv.coe_coe, TensorProduct.comm_tmul,
58-
Basis.tensorProduct_repr_tmul_apply, Matrix.submatrix_apply, Basis.repr_self,
59-
Finsupp.single_apply, @eq_comm _ j', @eq_comm _ i', mul_ite, mul_one, mul_zero,
60-
Matrix.one_apply, Prod.swap_prod_mk, _root_.id, Prod.ext_iff, ite_and]
58+
simp only [toMatrix_apply, Basis.tensorProduct_apply, LinearEquiv.coe_coe, comm_tmul,
59+
Basis.tensorProduct_repr_tmul_apply, Basis.repr_self, Finsupp.single_apply, @eq_comm _ i',
60+
@eq_comm _ j', smul_eq_mul, mul_ite, mul_one, mul_zero, ← ite_and, and_comm, submatrix_apply,
61+
Matrix.one_apply, Prod.swap_prod_mk, id_eq, Prod.mk.injEq]
6162

6263
/-- `TensorProduct.assoc` corresponds to a permutation of the identity matrix. -/
6364
theorem TensorProduct.toMatrix_assoc :
6465
toMatrix ((bM.tensorProduct bN).tensorProduct bP) (bM.tensorProduct (bN.tensorProduct bP))
6566
(TensorProduct.assoc R M N P) =
6667
(1 : Matrix (ι × κ × τ) (ι × κ × τ) R).submatrix _root_.id (Equiv.prodAssoc _ _ _) := by
6768
ext ⟨i, j, k⟩ ⟨⟨i', j'⟩, k'⟩
68-
simp_rw [toMatrix_apply, Basis.tensorProduct_apply, LinearEquiv.coe_coe,
69-
TensorProduct.assoc_tmul, Basis.tensorProduct_repr_tmul_apply, Matrix.submatrix_apply,
70-
Basis.repr_self, Finsupp.single_apply, @eq_comm _ i', @eq_comm _ j', @eq_comm _ k',
71-
mul_ite, mul_one, mul_zero, Matrix.one_apply, _root_.id, Equiv.prodAssoc_apply, Prod.ext_iff,
72-
ite_and]
73-
split_ifs <;> simp
69+
simp only [toMatrix_apply, Basis.tensorProduct_apply, LinearEquiv.coe_coe, assoc_tmul,
70+
Basis.tensorProduct_repr_tmul_apply, Basis.repr_self, Finsupp.single_apply, @eq_comm _ k',
71+
@eq_comm _ j', smul_eq_mul, mul_ite, mul_one, mul_zero, ← ite_and, @eq_comm _ i',
72+
submatrix_apply, Matrix.one_apply, id_eq, Equiv.prodAssoc_apply, Prod.mk.injEq]

Mathlib/RingTheory/Generators.lean

+32-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ variable [Algebra R R''] [Algebra S S''] [Algebra R S'']
222222
[IsScalarTower R R'' S''] [IsScalarTower R S S'']
223223
variable [Algebra R' R''] [Algebra S' S''] [Algebra R' S'']
224224
[IsScalarTower R' R'' S''] [IsScalarTower R' S' S'']
225-
variable [IsScalarTower R' R'' R''] [IsScalarTower S S' S'']
225+
variable [IsScalarTower R R' R''] [IsScalarTower S S' S'']
226226

227227
section Hom
228228

@@ -266,6 +266,10 @@ lemma Hom.toAlgHom_X (f : Hom P P') (i) : f.toAlgHom (.X i) = f.val i :=
266266
lemma Hom.toAlgHom_C (f : Hom P P') (r) : f.toAlgHom (.C r) = .C (algebraMap _ _ r) :=
267267
MvPolynomial.aeval_C f.val r
268268

269+
lemma Hom.toAlgHom_monomial (f : Generators.Hom P P') (v r) :
270+
f.toAlgHom (monomial v r) = r • v.prod (f.val · ^ ·) := by
271+
rw [toAlgHom, aeval_monomial, Algebra.smul_def]
272+
269273
/-- Giving a hom between two families of generators is equivalent to
270274
giving an algebra homomorphism between the polynomial rings. -/
271275
@[simps]
@@ -290,6 +294,9 @@ instance : Inhabited (Hom P P') := ⟨defaultHom P P'⟩
290294
@[simps]
291295
protected noncomputable def Hom.id : Hom P P := ⟨X, by simp⟩
292296

297+
@[simp]
298+
lemma Hom.toAlgHom_id : Hom.toAlgHom (.id P) = AlgHom.id _ _ := by ext1; simp
299+
293300
variable {P P' P''}
294301

295302
/-- The composition of two homs. -/
@@ -310,6 +317,14 @@ lemma Hom.comp_id (f : Hom P P') : f.comp (Hom.id P) = f := by ext; simp
310317
@[simp]
311318
lemma Hom.id_comp (f : Hom P P') : (Hom.id P').comp f = f := by ext; simp [Hom.id, aeval_X_left]
312319

320+
@[simp]
321+
lemma Hom.toAlgHom_comp_apply (f : Hom P P') (g : Hom P' P'') (x) :
322+
(g.comp f).toAlgHom x = g.toAlgHom (f.toAlgHom x) := by
323+
induction x using MvPolynomial.induction_on with
324+
| h_C r => simp only [← MvPolynomial.algebraMap_eq, AlgHom.map_algebraMap]
325+
| h_add x y hx hy => simp only [map_add, hx, hy]
326+
| h_X p i hp => simp only [_root_.map_mul, hp, toAlgHom_X, comp_val]; rfl
327+
313328
variable {T} [CommRing T] [Algebra R T] [Algebra S T] [IsScalarTower R S T]
314329

315330
/-- Given families of generators `X ⊆ T` over `S` and `Y ⊆ S` over `R`,
@@ -374,6 +389,7 @@ variable (x y : P.Cotangent) (w z : P.ker.Cotangent)
374389
@[simp] lemma of_zero : (of 0 : P.Cotangent) = 0 := rfl
375390
@[simp] lemma of_val : of x.val = x := rfl
376391
@[simp] lemma val_of : (of w).val = w := rfl
392+
@[simp] lemma val_sub : (x - y).val = x.val - y.val := rfl
377393

378394
end Cotangent
379395

@@ -466,6 +482,21 @@ lemma Cotangent.map_mk (f : Hom P P') (x) :
466482
.mk ⟨f.toAlgHom x, by simpa [-map_aeval] using RingHom.congr_arg (algebraMap S S') x.2⟩ :=
467483
rfl
468484

485+
@[simp]
486+
lemma Cotangent.map_id :
487+
Cotangent.map (.id P) = LinearMap.id := by
488+
ext x
489+
obtain ⟨x, rfl⟩ := Cotangent.mk_surjective x
490+
simp only [map_mk, Hom.toAlgHom_id, AlgHom.coe_id, id_eq, Subtype.coe_eta, val_mk,
491+
LinearMap.id_coe]
492+
493+
lemma Cotangent.map_comp (f : Hom P P') (g : Hom P' P'') :
494+
Cotangent.map (g.comp f) = (map g).restrictScalars S ∘ₗ map f := by
495+
ext x
496+
obtain ⟨x, rfl⟩ := Cotangent.mk_surjective x
497+
simp only [map_mk, val_mk, LinearMap.coe_comp, LinearMap.coe_restrictScalars,
498+
Function.comp_apply, Hom.toAlgHom_comp_apply]
499+
469500
end Cotangent
470501

471502
end Algebra.Generators

0 commit comments

Comments
 (0)