Download data/lean/OAI/Algebra/FiniteTensor/TensorForms.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 9.42 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algebra/FiniteTensor/TensorForms.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Algebra/FiniteTensor/TensorForms.lean
-
curl -L -o TensorForms.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algebra/FiniteTensor/TensorForms.lean
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 | |