math / data /lean /OAI /Algebra /FiniteTensor /TensorForms.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
9.42 kB
import Mathlib
import OAI.Algebra.FiniteTensor.KoszulForms
import OAI.Algebra.FiniteTensor.TensorCoordinates
namespace OAI
/-! Tensor products of differential forms and head-tail tensor equivalences. -/
noncomputable section
open scoped BigOperators
namespace PD4Tensor.TruncatedForms
noncomputable section
open scoped TensorProduct BigOperators
open Forms FrobeniusTruncation
variable (K Οƒ Ο„ : Type*) [Field K]
variable (p : β„•)
def inlForm : Space K Οƒ p →ₐ[K] Space K (Οƒ βŠ• Ο„) p :=
Algebra.TensorProduct.map (rename K Οƒ p Sum.inl) (inlExterior K Οƒ Ο„)
def inrForm : Space K Ο„ p →ₐ[K] Space K (Οƒ βŠ• Ο„) p :=
Algebra.TensorProduct.map (rename K Ο„ p Sum.inr) (inrExterior K Οƒ Ο„)
def productEquiv : (Space K Οƒ p βŠ—[K] Space K Ο„ p) ≃ₗ[K] Space K (Οƒ βŠ• Ο„) p :=
(TensorProduct.tensorTensorTensorComm K (A K Οƒ p) (E K Οƒ) (A K Ο„ p) (E K Ο„)).trans
(TensorProduct.congr (sumTensorEquiv K Οƒ p Ο„).symm.toLinearEquiv
(sumExteriorEquiv K Οƒ Ο„).symm)
@[simp] theorem productEquiv_tmul (Ο‰ : Space K Οƒ p) (Ξ· : Space K Ο„ p) :
productEquiv K Οƒ Ο„ p (Ο‰ βŠ—β‚œ[K] Ξ·) = inlForm K Οƒ Ο„ p Ο‰ * inrForm K Οƒ Ο„ p Ξ· := by
let M : Space K Οƒ p βŠ—[K] Space K Ο„ p β†’β‚—[K] Space K (Οƒ βŠ• Ο„) p :=
TensorProduct.lift ((LinearMap.mul K (Space K (Οƒ βŠ• Ο„) p)).compl₁₂
(inlForm K Οƒ Ο„ p).toLinearMap (inrForm K Οƒ Ο„ p).toLinearMap)
have hM : (productEquiv K Οƒ Ο„ p).toLinearMap=M := by
apply TensorProduct.ext_fourfold'
intro a e b f
simp only [productEquiv,LinearEquiv.coe_coe,LinearEquiv.trans_apply,
TensorProduct.tensorTensorTensorComm_tmul,TensorProduct.congr_tmul,
sumExteriorEquiv_symm_tmul,M,TensorProduct.lift.tmul,LinearMap.compl₁₂_apply,
LinearMap.mul_apply',AlgHom.toLinearMap_apply,inlForm,inrForm,
Algebra.TensorProduct.map_tmul,Algebra.TensorProduct.tmul_mul_tmul]
rfl
exact LinearMap.congr_fun hM (Ο‰ βŠ—β‚œ[K] Ξ·)
@[simp] theorem parity_inlForm (Ο‰ : Space K Οƒ p) :
parity K (A K (Οƒ βŠ• Ο„) p) (Οƒ βŠ• Ο„) (inlForm K Οƒ Ο„ p Ο‰) =
inlForm K Οƒ Ο„ p (parity K (A K Οƒ p) Οƒ Ο‰) := by
induction Ο‰ using TensorProduct.inductionOn with
| add a b ha hb => simp [ha,hb]
| tmul a e => simp [inlForm,inlExterior,involute_map]
@[simp] theorem parity_inrForm (Ο‰ : Space K Ο„ p) :
parity K (A K (Οƒ βŠ• Ο„) p) (Οƒ βŠ• Ο„) (inrForm K Οƒ Ο„ p Ο‰) =
inrForm K Οƒ Ο„ p (parity K (A K Ο„ p) Ο„ Ο‰) := by
induction Ο‰ using TensorProduct.inductionOn with
| add a b ha hb => simp [ha,hb]
| tmul a e => simp [inrForm,inrExterior,involute_map]
variable [Fintype Οƒ] [DecidableEq Οƒ] [Fintype Ο„] [DecidableEq Ο„] [CharP K p]
@[simp] theorem D_inlForm (Ο‰ : Space K Οƒ p) :
D K (Οƒ βŠ• Ο„) p (inlForm K Οƒ Ο„ p Ο‰)=inlForm K Οƒ Ο„ p (D K Οƒ p Ο‰) := by
induction Ο‰ using TensorProduct.inductionOn with
| add a b ha hb => simp [ha,hb]
| tmul a e =>
simp only [inlForm,Algebra.TensorProduct.map_tmul,D,differential_tmul,
Fintype.sum_sum_type,map_sum,map_mul,inlExterior_dx]
simp only [derivative_rename K Οƒ p Sum.inl Sum.inl_injective]
have hz (j : Ο„) : derivative K (Οƒ βŠ• Ο„) p (Sum.inr j) (rename K Οƒ p Sum.inl a)=0 :=
derivative_rename_other K Οƒ p Sum.inl (Sum.inr j) (by rintro ⟨i,h⟩; cases h) a
simp only [hz,TensorProduct.zero_tmul,Finset.sum_const_zero,add_zero]
@[simp] theorem D_inrForm (Ο‰ : Space K Ο„ p) :
D K (Οƒ βŠ• Ο„) p (inrForm K Οƒ Ο„ p Ο‰)=inrForm K Οƒ Ο„ p (D K Ο„ p Ο‰) := by
induction Ο‰ using TensorProduct.inductionOn with
| add a b ha hb => simp [ha,hb]
| tmul a e =>
simp only [inrForm,Algebra.TensorProduct.map_tmul,D,differential_tmul,
Fintype.sum_sum_type,map_sum,map_mul,inrExterior_dx]
simp only [derivative_rename K Ο„ p Sum.inr Sum.inr_injective]
have hz (i : Οƒ) : derivative K (Οƒ βŠ• Ο„) p (Sum.inl i) (rename K Ο„ p Sum.inr a)=0 :=
derivative_rename_other K Ο„ p Sum.inr (Sum.inl i) (by rintro ⟨j,h⟩; cases h) a
simp only [hz,TensorProduct.zero_tmul,Finset.sum_const_zero,zero_add]
theorem D_product (Ο‰ : Space K Οƒ p) (Ξ· : Space K Ο„ p) :
D K (Οƒ βŠ• Ο„) p (productEquiv K Οƒ Ο„ p (Ο‰ βŠ—β‚œ[K] Ξ·)) =
productEquiv K Οƒ Ο„ p (D K Οƒ p Ο‰ βŠ—β‚œ[K] Ξ· +
parity K (A K Οƒ p) Οƒ Ο‰ βŠ—β‚œ[K] D K Ο„ p Ξ·) := by
simp only [productEquiv_tmul,D_mul,D_inlForm,D_inrForm,parity_inlForm,map_add]
end
end PD4Tensor.TruncatedForms
namespace PD4Tensor.TruncatedForms
noncomputable section
open scoped TensorProduct BigOperators
open Forms FrobeniusTruncation
variable (K Οƒ Ο„ : Type*) [Field K] [Fintype Οƒ] [DecidableEq Οƒ] [Fintype Ο„] [DecidableEq Ο„]
variable (p : β„•) [CharP K p]
omit [Fintype Οƒ] [DecidableEq Οƒ] [Fintype Ο„] [DecidableEq Ο„] [CharP K p] in
@[simp] theorem inlForm_scalar (a : A K Οƒ p) :
inlForm K Οƒ Ο„ p (scalar K (A K Οƒ p) Οƒ a)=
scalar K (A K (Οƒ βŠ• Ο„) p) (Οƒ βŠ• Ο„) (rename K Οƒ p Sum.inl a) := by
simp [inlForm,scalar]
omit [Fintype Οƒ] [DecidableEq Οƒ] [Fintype Ο„] [DecidableEq Ο„] [CharP K p] in
@[simp] theorem inrForm_scalar (a : A K Ο„ p) :
inrForm K Οƒ Ο„ p (scalar K (A K Ο„ p) Ο„ a)=
scalar K (A K (Οƒ βŠ• Ο„) p) (Οƒ βŠ• Ο„) (rename K Ο„ p Sum.inr a) := by
simp [inrForm,scalar]
theorem D_scalar_anticommute (b : A K Οƒ p) (Ο‰ : Space K Οƒ p) :
D K Οƒ p (scalar K (A K Οƒ p) Οƒ b) * Ο‰ =
parity K (A K Οƒ p) Οƒ Ο‰ * D K Οƒ p (scalar K (A K Οƒ p) Οƒ b) := by
rw [D,differential_scalar]
exact oneForm_anticommute _ _
theorem koszul_product (S : A K Οƒ p) (T : A K Ο„ p)
(Ο‰ : Space K Οƒ p) (Ξ· : Space K Ο„ p) :
koszul K (Οƒ βŠ• Ο„) p (rename K Οƒ p Sum.inl S + rename K Ο„ p Sum.inr T)
(productEquiv K Οƒ Ο„ p (Ο‰ βŠ—β‚œ[K] Ξ·)) =
productEquiv K Οƒ Ο„ p (koszul K Οƒ p S Ο‰ βŠ—β‚œ[K] Ξ· +
parity K (A K Οƒ p) Οƒ Ο‰ βŠ—β‚œ[K] koszul K Ο„ p T Ξ·) := by
simp only [koszul,LinearMap.mulLeft_apply,productEquiv_tmul,map_add,scalar_add,add_mul]
rw [← inlForm_scalar,← inrForm_scalar,D_inlForm]
simp only [map_mul]
congr 1
Β· rw [mul_assoc]
Β· rw [← mul_assoc,inrForm_scalar,D_scalar_anticommute,parity_inlForm,mul_assoc,
← inrForm_scalar,D_inrForm]
omit [Fintype Οƒ] [DecidableEq Οƒ] [Fintype Ο„] [DecidableEq Ο„] [CharP K p] in
theorem mulScalar_product_left (b : A K Οƒ p) (Ο‰ : Space K Οƒ p) (Ξ· : Space K Ο„ p) :
mulScalar K (Οƒ βŠ• Ο„) p (rename K Οƒ p Sum.inl b)
(productEquiv K Οƒ Ο„ p (Ο‰ βŠ—β‚œ[K] Ξ·)) =
productEquiv K Οƒ Ο„ p (mulScalar K Οƒ p b Ο‰ βŠ—β‚œ[K] Ξ·) := by
simp only [mulScalar,LinearMap.mulLeft_apply,productEquiv_tmul,map_mul,inlForm_scalar,mul_assoc]
omit [Fintype Οƒ] [DecidableEq Οƒ] [Fintype Ο„] [DecidableEq Ο„] [CharP K p] in
theorem mulScalar_product_right (b : A K Ο„ p) (Ο‰ : Space K Οƒ p) (Ξ· : Space K Ο„ p) :
mulScalar K (Οƒ βŠ• Ο„) p (rename K Ο„ p Sum.inr b)
(productEquiv K Οƒ Ο„ p (Ο‰ βŠ—β‚œ[K] Ξ·)) =
productEquiv K Οƒ Ο„ p (Ο‰ βŠ—β‚œ[K] mulScalar K Ο„ p b Ξ·) := by
simp only [mulScalar,LinearMap.mulLeft_apply,productEquiv_tmul,map_mul,inrForm_scalar]
rw [← mul_assoc,scalar_commute,mul_assoc]
end
end PD4Tensor.TruncatedForms
namespace PD4Tensor
noncomputable section
open scoped TensorProduct
variable (K : Type*) [Field K] {n : β„•} (V : Fin (n+1) β†’ Type*)
[βˆ€ i, AddCommGroup (V i)] [βˆ€ i, Module K (V i)]
def headTailTo : (⨂[K] i, V i) β†’β‚—[K] V 0 βŠ—[K] (⨂[K] i : Fin n, V i.succ) :=
PiTensorProduct.lift (LinearMap.uncurryLeft
{ toFun := fun x => (TensorProduct.mk K _ _ x).compMultilinearMap (PiTensorProduct.tprod K)
map_add' := by intro x y; ext v; simp
map_smul' := by intro c x; ext v; simp [TensorProduct.smul_tmul'] })
def headTailFrom : V 0 βŠ—[K] (⨂[K] i : Fin n, V i.succ) β†’β‚—[K] (⨂[K] i, V i) :=
TensorProduct.lift (PiTensorProduct.lift.toLinearMap.comp (PiTensorProduct.tprod K).curryLeft)
@[simp] theorem headTailTo_tprod (v : βˆ€ i, V i) :
headTailTo K V (PiTensorProduct.tprod K v)=
v 0 βŠ—β‚œ[K] PiTensorProduct.tprod K (fun i : Fin n => v i.succ) := by
simp only [headTailTo,PiTensorProduct.lift.tprod,LinearMap.uncurryLeft_apply,
LinearMap.coe_mk, AddHom.coe_mk,LinearMap.compMultilinearMap_apply,TensorProduct.mk_apply]
rfl
@[simp] theorem headTailFrom_tmul (x : V 0) (v : βˆ€ i : Fin n, V i.succ) :
headTailFrom K V (x βŠ—β‚œ[K] PiTensorProduct.tprod K v)=
PiTensorProduct.tprod K (Fin.cons x v) := by simp [headTailFrom]
def headTailEquiv : (⨂[K] i, V i) ≃ₗ[K] V 0 βŠ—[K] (⨂[K] i : Fin n, V i.succ) :=
LinearEquiv.ofLinearMap (headTailTo K V) (headTailFrom K V) (by
apply TensorProduct.ext'
intro x z
induction z using PiTensorProduct.induction_on with
| smul_tprod c v => simp [headTailFrom,headTailTo]
| add a b ha hb =>
simp only [LinearMap.comp_apply,LinearMap.id_apply] at ha hb ⊒
simp only [TensorProduct.tmul_add,map_add,ha,hb]) (by
apply PiTensorProduct.ext
apply MultilinearMap.ext
intro v
simp only [LinearMap.compMultilinearMap_apply,LinearMap.comp_apply,
headTailTo_tprod,headTailFrom_tmul,LinearMap.id_apply]
congr 1
ext i
cases i using Fin.cases <;> rfl)
@[simp] theorem headTailEquiv_tprod (v : βˆ€ i, V i) :
headTailEquiv K V (PiTensorProduct.tprod K v)=
v 0 βŠ—β‚œ[K] PiTensorProduct.tprod K (fun i : Fin n => v i.succ) := headTailTo_tprod K V v
end
end PD4Tensor
end
end OAI