Download data/lean/OAI/Algebra/FiniteTensor/ExteriorForms.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 15.3 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algebra/FiniteTensor/ExteriorForms.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Algebra/FiniteTensor/ExteriorForms.lean
-
curl -L -o ExteriorForms.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algebra/FiniteTensor/ExteriorForms.lean
15.3 kB
| import Mathlib | |
| namespace OAI | |
| /-! Exterior forms, differentials, Koszul operators and residue pairings. -/ | |
| noncomputable section | |
| open scoped BigOperators | |
| namespace PD4Tensor.Forms | |
| noncomputable section | |
| open scoped TensorProduct BigOperators | |
| variable (K A Ο : Type*) [Field K] [CommRing A] [Algebra K A] | |
| [Fintype Ο] [DecidableEq Ο] | |
| abbrev E := ExteriorAlgebra K (Ο β K) | |
| abbrev Ξ© := A β[K] E K Ο | |
| def dx (i : Ο) : E K Ο := ExteriorAlgebra.ΞΉ K (Pi.single i 1) | |
| def scalar (a : A) : Ξ© K A Ο := a ββ[K] (1 : E K Ο) | |
| def parity : Ξ© K A Ο ββ[K] Ξ© K A Ο := | |
| Algebra.TensorProduct.map (AlgHom.id K A) CliffordAlgebra.involute | |
| def oneForm (v : Ο β A) : Ξ© K A Ο := β i, v i ββ[K] dx K Ο i | |
| variable {K A Ο} | |
| omit [Fintype Ο] [DecidableEq Ο] in | |
| @[simp] theorem parity_tmul (a : A) (e : E K Ο) : | |
| parity K A Ο (a ββ[K] e) = a ββ[K] CliffordAlgebra.involute e := rfl | |
| omit [Fintype Ο] in | |
| @[simp] theorem parity_dx (i : Ο) : | |
| CliffordAlgebra.involute (dx K Ο i) = -dx K Ο i := by | |
| exact CliffordAlgebra.involute_ΞΉ _ | |
| omit [Fintype Ο] [DecidableEq Ο] in | |
| @[simp] theorem parity_parity (Ο : Ξ© K A Ο) : | |
| parity K A Ο (parity K A Ο Ο) = Ο := by | |
| induction Ο using TensorProduct.inductionOn with | |
| | tmul a e => simp | |
| | add a b ha hb => simp [ha, hb] | |
| omit [Fintype Ο] [DecidableEq Ο] in | |
| theorem exterior_anticommute (v : Ο β K) (e : E K Ο) : | |
| ExteriorAlgebra.ΞΉ K v * e = CliffordAlgebra.involute e * ExteriorAlgebra.ΞΉ K v := by | |
| induction e using ExteriorAlgebra.induction with | |
| | algebraMap r => simp [Algebra.commutes] | |
| | ΞΉ w => | |
| rw [CliffordAlgebra.involute_ΞΉ, neg_mul] | |
| exact eq_neg_of_add_eq_zero_left (ExteriorAlgebra.ΞΉ_add_mul_swap v w) | |
| | mul a b ha hb => | |
| rw [map_mul, β mul_assoc, ha, mul_assoc, hb, β mul_assoc] | |
| | add a b ha hb => simp [mul_add, add_mul, ha, hb] | |
| theorem oneForm_anticommute (v : Ο β A) (Ο : Ξ© K A Ο) : | |
| oneForm K A Ο v * Ο = parity K A Ο Ο * oneForm K A Ο v := by | |
| induction Ο using TensorProduct.inductionOn with | |
| | tmul a e => | |
| simp only [oneForm, Finset.sum_mul, Finset.mul_sum, parity_tmul, | |
| Algebra.TensorProduct.tmul_mul_tmul] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| rw [mul_comm (v i) a, dx, exterior_anticommute] | |
| | add a b ha hb => simp [mul_add, add_mul, ha, hb] | |
| @[simp] theorem parity_oneForm (v : Ο β A) : | |
| parity K A Ο (oneForm K A Ο v) = -oneForm K A Ο v := by | |
| simp only [oneForm, map_sum, parity_tmul, parity_dx, TensorProduct.tmul_neg, | |
| Finset.sum_neg_distrib] | |
| theorem oneForm_sq_zero [Invertible (2 : K)] (v : Ο β A) : | |
| oneForm K A Ο v * oneForm K A Ο v = 0 := by | |
| have h := oneForm_anticommute v (oneForm K A Ο v) | |
| rw [parity_oneForm, neg_mul] at h | |
| have h2 : (2 : K) β’ (oneForm K A Ο v * oneForm K A Ο v) = 0 := by | |
| rw [two_smul K] | |
| exact eq_neg_iff_add_eq_zero.mp h | |
| exact (isUnit_of_invertible (2 : K)).smul_eq_zero.mp h2 | |
| variable (K A Ο) | |
| def differential (der : Ο β A ββ[K] A) : Ξ© K A Ο ββ[K] Ξ© K A Ο := | |
| β i, TensorProduct.map (der i) (LinearMap.mulLeft K (dx K Ο i)) | |
| variable {K A Ο} | |
| @[simp] theorem differential_tmul (der : Ο β A ββ[K] A) (a : A) (e : E K Ο) : | |
| differential K A Ο der (a ββ[K] e) = β i, der i a ββ[K] (dx K Ο i * e) := by | |
| simp [differential] | |
| @[simp] theorem differential_scalar (der : Ο β A ββ[K] A) (a : A) : | |
| differential K A Ο der (scalar K A Ο a) = oneForm K A Ο (fun i => der i a) := by | |
| simp [scalar, oneForm] | |
| omit [Fintype Ο] [DecidableEq Ο] in | |
| @[simp] theorem parity_scalar (a : A) : parity K A Ο (scalar K A Ο a) = scalar K A Ο a := by | |
| simp [scalar] | |
| theorem differential_mul (der : Ο β A ββ[K] A) | |
| (hder : β i a b, der i (a*b) = der i a * b + a * der i b) | |
| (Ο Ξ· : Ξ© K A Ο) : | |
| differential K A Ο der (Ο*Ξ·) = differential K A Ο der Ο * Ξ· + | |
| parity K A Ο Ο * differential K A Ο der Ξ· := by | |
| induction Ο using TensorProduct.inductionOn with | |
| | add a b ha hb => simp only [add_mul, map_add, ha, hb]; abel | |
| | tmul a e => | |
| induction Ξ· using TensorProduct.inductionOn with | |
| | add b c hb hc => simp only [mul_add, map_add, hb, hc]; abel | |
| | tmul b f => | |
| simp only [Algebra.TensorProduct.tmul_mul_tmul, differential_tmul, | |
| Finset.sum_mul, Finset.mul_sum, parity_tmul, hder, TensorProduct.add_tmul] | |
| rw [β Finset.sum_add_distrib] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| simp only [dx, β mul_assoc, exterior_anticommute (Pi.single i 1) e] | |
| theorem differential_parity (der : Ο β A ββ[K] A) (Ο : Ξ© K A Ο) : | |
| differential K A Ο der (parity K A Ο Ο) = -parity K A Ο (differential K A Ο der Ο) := by | |
| induction Ο using TensorProduct.inductionOn with | |
| | add a b ha hb => simp only [map_add, ha, hb]; abel | |
| | tmul a e => | |
| simp only [parity_tmul, differential_tmul, map_sum, map_mul, parity_dx, | |
| neg_mul, TensorProduct.tmul_neg, Finset.sum_neg_distrib, neg_neg] | |
| theorem differential_sq_zero [Invertible (2 : K)] (der : Ο β A ββ[K] A) | |
| (hder : β i j a, der i (der j a) = der j (der i a)) (Ο : Ξ© K A Ο) : | |
| differential K A Ο der (differential K A Ο der Ο) = 0 := by | |
| induction Ο using TensorProduct.inductionOn with | |
| | add a b ha hb => simp [ha, hb] | |
| | tmul a e => | |
| have hanti : β i j, dx K Ο i * dx K Ο j = -(dx K Ο j * dx K Ο i) := by | |
| intro i j | |
| exact eq_neg_of_add_eq_zero_left (ExteriorAlgebra.ΞΉ_add_mul_swap _ _) | |
| have heq : differential K A Ο der (differential K A Ο der (a ββ[K] e)) = | |
| -differential K A Ο der (differential K A Ο der (a ββ[K] e)) := by | |
| simp only [differential_tmul, map_sum] | |
| conv_rhs => rw [Finset.sum_comm] | |
| simp only [β Finset.sum_neg_distrib] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| apply Finset.sum_congr rfl | |
| intro j _ | |
| rw [hder j i a, β mul_assoc, hanti j i, neg_mul, TensorProduct.tmul_neg, mul_assoc] | |
| exact (isUnit_of_invertible (2 : K)).smul_eq_zero.mp (by | |
| rw [two_smul K] | |
| exact eq_neg_iff_add_eq_zero.mp heq) | |
| omit [Fintype Ο] [DecidableEq Ο] in | |
| @[simp] theorem scalar_mul (a b : A) : scalar K A Ο (a*b) = scalar K A Ο a * scalar K A Ο b := by | |
| simp [scalar, Algebra.TensorProduct.tmul_mul_tmul] | |
| omit [Fintype Ο] [DecidableEq Ο] in | |
| @[simp] theorem scalar_add (a b : A) : scalar K A Ο (a+b) = scalar K A Ο a + scalar K A Ο b := by | |
| simp [scalar, TensorProduct.add_tmul] | |
| omit [Fintype Ο] [DecidableEq Ο] in | |
| @[simp] theorem scalar_zero : scalar K A Ο 0 = 0 := by simp [scalar] | |
| omit [Fintype Ο] [DecidableEq Ο] in | |
| @[simp] theorem scalar_one : scalar K A Ο 1 = 1 := by | |
| exact Algebra.TensorProduct.one_def.symm | |
| omit [Fintype Ο] [DecidableEq Ο] in | |
| theorem scalar_commute (a : A) (Ο : Ξ© K A Ο) : scalar K A Ο a * Ο = Ο * scalar K A Ο a := by | |
| induction Ο using TensorProduct.inductionOn with | |
| | add b c hb hc => simp [mul_add, add_mul, hb, hc] | |
| | tmul b e => simp [scalar, Algebra.TensorProduct.tmul_mul_tmul, mul_comm a b] | |
| variable (K A Ο) | |
| def contraction (i : Ο) : Ξ© K A Ο ββ[K] Ξ© K A Ο := | |
| TensorProduct.map LinearMap.id (CliffordAlgebra.contractLeft (LinearMap.proj i)) | |
| variable {K A Ο} | |
| omit [Fintype Ο] [DecidableEq Ο] in | |
| @[simp] theorem contraction_tmul (i : Ο) (a : A) (e : E K Ο) : | |
| contraction K A Ο i (a ββ[K] e) = | |
| a ββ[K] CliffordAlgebra.contractLeft (LinearMap.proj i) e := rfl | |
| theorem contraction_oneForm_mul (i : Ο) (v : Ο β A) (Ο : Ξ© K A Ο) : | |
| contraction K A Ο i (oneForm K A Ο v * Ο) = | |
| scalar K A Ο (v i) * Ο - oneForm K A Ο v * contraction K A Ο i Ο := by | |
| induction Ο using TensorProduct.inductionOn with | |
| | add a b ha hb => simp only [mul_add, map_add, ha, hb]; abel | |
| | tmul a e => | |
| simp only [oneForm, Finset.sum_mul, map_sum, Algebra.TensorProduct.tmul_mul_tmul, | |
| contraction_tmul, dx, CliffordAlgebra.contractLeft_ΞΉ_mul, LinearMap.proj_apply, | |
| TensorProduct.tmul_sub, TensorProduct.tmul_smul, Finset.sum_sub_distrib] | |
| congr 1 | |
| simp [Pi.single_apply, scalar, Algebra.TensorProduct.tmul_mul_tmul] | |
| theorem gradient_multiple_boundary (v : Ο β A) (Ο : Ξ© K A Ο) | |
| (hΟ : oneForm K A Ο v * Ο = 0) (a : Ο β A) : | |
| scalar K A Ο (β i, a i * v i) * Ο β LinearMap.range (LinearMap.mulLeft K (oneForm K A Ο v)) := by | |
| refine β¨β i, scalar K A Ο (a i) * contraction K A Ο i Ο, ?_β© | |
| simp only [LinearMap.mulLeft_apply, Finset.mul_sum] | |
| have hi : β i, oneForm K A Ο v * contraction K A Ο i Ο = scalar K A Ο (v i) * Ο := by | |
| intro i | |
| have h := contraction_oneForm_mul i v Ο | |
| rw [hΟ, map_zero] at h | |
| exact (sub_eq_zero.mp h.symm).symm | |
| have hsc : scalar K A Ο (β i, a i*v i) = β i, scalar K A Ο (a i*v i) := by | |
| simp [scalar, TensorProduct.sum_tmul] | |
| rw [hsc, Finset.sum_mul] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| rw [β mul_assoc, β scalar_commute, mul_assoc, hi, β mul_assoc, β scalar_mul] | |
| variable (K A Ο) | |
| def normalFactor (der : Ο β A ββ[K] A) (p : β) (c : A) : Ξ© K A Ο := | |
| scalar K A Ο (c^(p-1)) * differential K A Ο der (scalar K A Ο c) | |
| def normalCycle (der : Ο β A ββ[K] A) (p : β) (cs : List A) : Ξ© K A Ο := | |
| (cs.map (normalFactor K A Ο der p)).prod | |
| variable {K A Ο} | |
| variable [Invertible (2 : K)] | |
| variable (der : Ο β A ββ[K] A) | |
| (hleib : β i a b, der i (a*b) = der i a*b + a*der i b) | |
| (hcomm : β i j a, der i (der j a) = der j (der i a)) | |
| omit [Fintype Ο] [DecidableEq Ο] [Invertible (2 : K)] in | |
| include hleib in | |
| private theorem deriv_one_eq_zero (i : Ο) : der i 1 = 0 := by | |
| have h := hleib i 1 1 | |
| simp only [mul_one, one_mul] at h | |
| exact add_left_cancel (show der i 1 + der i 1 = der i 1 + 0 by simpa using h.symm) | |
| omit [Invertible (2 : K)] in | |
| include hleib in | |
| @[simp] theorem differential_one : differential K A Ο der 1 = 0 := by | |
| rw [β scalar_one, differential_scalar] | |
| simp [oneForm, deriv_one_eq_zero der hleib] | |
| include hleib in | |
| theorem differential_power_mul_self (c : A) (r : β) : | |
| differential K A Ο der (scalar K A Ο (c^r)) * | |
| differential K A Ο der (scalar K A Ο c) = 0 := by | |
| have hs : differential K A Ο der (scalar K A Ο c) * | |
| differential K A Ο der (scalar K A Ο c) = 0 := by | |
| rw [differential_scalar] | |
| exact oneForm_sq_zero _ | |
| induction r with | |
| | zero => simp [differential_one der hleib] | |
| | succ r ih => | |
| rw [pow_succ, scalar_mul, differential_mul der hleib, parity_scalar, add_mul, | |
| β scalar_commute c, mul_assoc, ih, mul_zero, zero_add, | |
| mul_assoc, hs, mul_zero] | |
| include hleib hcomm in | |
| theorem normalFactor_closed (p : β) (c : A) : | |
| differential K A Ο der (normalFactor K A Ο der p c) = 0 := by | |
| rw [normalFactor, differential_mul der hleib, differential_sq_zero der hcomm, | |
| mul_zero, add_zero] | |
| exact differential_power_mul_self der hleib c _ | |
| include hleib hcomm in | |
| theorem normalCycle_closed (p : β) (cs : List A) : | |
| differential K A Ο der (normalCycle K A Ο der p cs) = 0 := by | |
| induction cs with | |
| | nil => simp [normalCycle, differential_one der hleib] | |
| | cons c cs ih => | |
| change differential K A Ο der (normalFactor K A Ο der p c * normalCycle K A Ο der p cs) = 0 | |
| rw [differential_mul der hleib, normalFactor_closed der hleib hcomm, ih] | |
| simp | |
| omit [Invertible (2 : K)] in | |
| theorem normalFactor_scalar_ann (p : β) (hp : 0<p) (c : A) (hc : c^p=0) : | |
| scalar K A Ο c * normalFactor K A Ο der p c = 0 := by | |
| rw [normalFactor, β mul_assoc, β scalar_mul, β pow_succ', Nat.sub_add_cancel hp, | |
| hc, scalar_zero, zero_mul] | |
| theorem normalFactor_dscalar_ann (p : β) (c : A) : | |
| differential K A Ο der (scalar K A Ο c) * normalFactor K A Ο der p c = 0 := by | |
| rw [normalFactor, β mul_assoc, β scalar_commute, mul_assoc, differential_scalar, | |
| oneForm_sq_zero, mul_zero] | |
| omit [Invertible (2 : K)] in | |
| theorem normalCycle_scalar_ann (p : β) (hp : 0<p) (cs : List A) | |
| (hnil : β cβcs, c^p=0) (c : A) (hc : cβcs) : | |
| scalar K A Ο c * normalCycle K A Ο der p cs = 0 := by | |
| induction cs with | |
| | nil => simp at hc | |
| | cons a cs ih => | |
| change scalar K A Ο c * (normalFactor K A Ο der p a * normalCycle K A Ο der p cs) = 0 | |
| rcases List.mem_cons.mp hc with rfl | hc | |
| Β· rw [β mul_assoc, normalFactor_scalar_ann der p hp c (hnil c (by simp)), zero_mul] | |
| Β· rw [β mul_assoc, scalar_commute, mul_assoc, ih (fun b hb => hnil b (by simp [hb])) hc, | |
| mul_zero] | |
| theorem normalCycle_dscalar_ann (p : β) (cs : List A) (c : A) (hc : cβcs) : | |
| differential K A Ο der (scalar K A Ο c) * normalCycle K A Ο der p cs = 0 := by | |
| induction cs with | |
| | nil => simp at hc | |
| | cons a cs ih => | |
| change differential K A Ο der (scalar K A Ο c) * | |
| (normalFactor K A Ο der p a * normalCycle K A Ο der p cs) = 0 | |
| rcases List.mem_cons.mp hc with rfl | hc | |
| Β· rw [β mul_assoc, normalFactor_dscalar_ann, zero_mul] | |
| Β· rw [β mul_assoc, differential_scalar, oneForm_anticommute, mul_assoc, | |
| β differential_scalar, ih hc, mul_zero] | |
| include hleib in | |
| theorem normalCycle_ideal_ann (p : β) (hp : 0<p) (cs : List A) | |
| (hnil : β cβcs, c^p=0) (S : A) (hS : S β Ideal.span {c | cβcs}) : | |
| scalar K A Ο S * normalCycle K A Ο der p cs = 0 β§ | |
| differential K A Ο der (scalar K A Ο S) * normalCycle K A Ο der p cs = 0 := by | |
| induction hS using Submodule.span_induction with | |
| | mem c hc => exact β¨normalCycle_scalar_ann der p hp cs hnil c hc, | |
| normalCycle_dscalar_ann der p cs c hcβ© | |
| | zero => simp | |
| | add a b ha hb iha ihb => | |
| simp only [scalar_add, map_add, add_mul, iha.1, ihb.1, iha.2, ihb.2, zero_add] | |
| trivial | |
| | smul a b hb ih => | |
| change scalar K A Ο (a*b) * _ = 0 β§ differential K A Ο der (scalar K A Ο (a*b)) * _ = 0 | |
| rw [scalar_mul, mul_assoc, ih.1, mul_zero] | |
| constructor | |
| Β· rfl | |
| Β· rw [differential_mul der hleib, add_mul, mul_assoc, ih.1, mul_zero, | |
| mul_assoc, ih.2, mul_zero, zero_add] | |
| omit [Invertible (2 : K)] in | |
| theorem gradient_ideal_boundary (v : Ο β A) (Ο : Ξ© K A Ο) | |
| (hΟ : oneForm K A Ο v * Ο = 0) (a : A) (ha : a β Ideal.span (Set.range v)) : | |
| scalar K A Ο a * Ο β LinearMap.range (LinearMap.mulLeft K (oneForm K A Ο v)) := by | |
| obtain β¨b, hbβ© := Ideal.mem_span_range_iff_exists_fun.mp ha | |
| rw [β hb] | |
| exact gradient_multiple_boundary v Ο hΟ b | |
| omit [Invertible (2 : K)] in | |
| theorem oneForm_mul_zero_iff (v : Ο β A) (Ο : Ξ© K A Ο) : | |
| oneForm K A Ο v * Ο = 0 β Ο * oneForm K A Ο v = 0 := by | |
| constructor | |
| Β· intro h | |
| have he := congrArg (parity K A Ο) h | |
| simp only [map_mul, parity_oneForm, map_zero, neg_mul, neg_eq_zero] at he | |
| rw [oneForm_anticommute, parity_parity] at he | |
| exact he | |
| Β· intro h | |
| rw [oneForm_anticommute] | |
| have he := congrArg (parity K A Ο) h | |
| simpa only [map_mul, parity_oneForm, map_zero, mul_neg, neg_eq_zero] using he | |
| omit [Invertible (2 : K)] in | |
| theorem boundary_mul_cycle_zero (v : Ο β A) (Ο Ξ· : Ξ© K A Ο) | |
| (hΟ : Ο β LinearMap.range (LinearMap.mulLeft K (oneForm K A Ο v))) | |
| (hΞ· : oneForm K A Ο v * Ξ· = 0) : Ο * Ξ· = 0 := by | |
| obtain β¨Ξ², rflβ© := hΟ | |
| change (oneForm K A Ο v * Ξ²) * Ξ· = 0 | |
| rw [oneForm_anticommute, mul_assoc, hΞ·, mul_zero] | |
| end | |
| end PD4Tensor.Forms | |
| end | |
| end OAI | |