Skip to content

Commit 02a656b

Browse files
feat(LinearAlgebra/PiTensorProduct): add version of subsingletonEquiv for dependent case (#32598)
Dependent `PiTensorProduct`s over singleton types occur naturally when using `tmulEquivDep` to split off one index from a dependent `PiTensorProduct`. This PR creates `subsingletonEquivDep` to deal with this situation. The non-dependent `subsingletonEquiv` is re-defined as a specialization of the general case. This changes the definition of `toDirectSum_ι` in TensorAlgebra/ToTensorPower, and so its proof is therefore changed. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/) Co-authored-by: david <david.gross@thp.uni-koeln.de> Co-authored-by: David Gross <david.gross@thp.uni-koeln.de>
1 parent 970fa80 commit 02a656b

File tree

2 files changed

+33
-27
lines changed

2 files changed

+33
-27
lines changed

Mathlib/LinearAlgebra/PiTensorProduct.lean

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -798,33 +798,39 @@ theorem isEmptyEquiv_apply_tprod [IsEmpty ι] (f : Π i, s i) :
798798

799799
variable {ι}
800800

801-
/--
802-
Tensor product of `M` over a singleton set is equivalent to `M`
803-
-/
804-
@[simps symm_apply]
805-
def subsingletonEquiv [Subsingleton ι] (i₀ : ι) : (⨂[R] _ : ι, M) ≃ₗ[R] M where
806-
toFun := lift (MultilinearMap.ofSubsingleton R M M i₀ .id)
807-
invFun m := tprod R fun _ ↦ m
808-
left_inv x := by
809-
dsimp only
810-
have : ∀ (f : ι → M) (z : M), (fun _ : ι ↦ z) = update f i₀ z := fun f z ↦ by
811-
ext i
812-
rw [Subsingleton.elim i i₀, Function.update_self]
813-
refine x.induction_on ?_ ?_
814-
· intro r f
815-
simp only [map_smul, LinearMap.id_apply, lift.tprod, ofSubsingleton_apply_apply,
816-
this f, MultilinearMap.map_update_smul, update_eq_self]
817-
· intro x y hx hy
818-
rw [map_add, this 0 (_ + _), MultilinearMap.map_update_add, ← this 0 (lift _ _), hx,
819-
← this 0 (lift _ _), hy]
820-
right_inv t := by simp only [ofSubsingleton_apply_apply, LinearMap.id_apply, lift.tprod]
821-
map_add' := map_add _
822-
map_smul' := map_smul _
801+
section subsingleton
802+
803+
variable [Subsingleton ι] (i₀ : ι)
804+
805+
/-- Tensor product over a singleton type with element `i₀` is equivalent to `s i₀`. -/
806+
def subsingletonEquiv : (⨂[R] i : ι, s i) ≃ₗ[R] s i₀ :=
807+
LinearEquiv.ofLinear
808+
(lift
809+
{ toFun f := f i₀
810+
map_update_add' m i := by rw [Subsingleton.elim i i₀]; simp
811+
map_update_smul' m i := by rw [Subsingleton.elim i i₀]; simp })
812+
({ toFun x := tprod R (update (0 : (i : ι) → s i) i₀ x)
813+
map_add' := by simp
814+
map_smul' := by simp })
815+
(by ext _; simp)
816+
(by
817+
ext f
818+
have h : update (0 : (i : ι) → s i) i₀ (f i₀) = f := update_eq_self i₀ f
819+
simp [h])
823820

824821
@[simp]
825-
theorem subsingletonEquiv_apply_tprod [Subsingleton ι] (i : ι) (f : ι → M) :
826-
subsingletonEquiv i (tprod R f) = f i :=
827-
lift.tprod _
822+
theorem subsingletonEquiv_apply_tprod (f : (i : ι) → s i) :
823+
subsingletonEquiv i₀ (⨂ₜ[R] i, f i) = f i₀ := lift.tprod _
824+
825+
theorem subsingletonEquiv_symm_apply (x : s i₀) :
826+
(subsingletonEquiv i₀).symm x = tprod R (fun i ↦ update (0 : (j : ι) → s j) i₀ x i) := rfl
827+
828+
@[simp]
829+
lemma subsingletonEquiv_symm_apply' (x : M) :
830+
(subsingletonEquiv (s := fun _ ↦ M) i₀).symm x = (tprod R fun _ ↦ x) := by
831+
simp [LinearEquiv.symm_apply_eq, subsingletonEquiv_apply_tprod]
832+
833+
end subsingleton
828834

829835
variable (R M)
830836

Mathlib/LinearAlgebra/TensorAlgebra/ToTensorPower.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ def toDirectSum : TensorAlgebra R M →ₐ[R] ⨁ n, ⨂[R]^n M :=
8787
@[simp]
8888
theorem toDirectSum_ι (x : M) :
8989
toDirectSum (ι R x) =
90-
DirectSum.of (fun n => ⨂[R]^n M) _ (PiTensorProduct.tprod R fun _ : Fin 1 => x) :=
91-
TensorAlgebra.lift_ι_apply _ _
90+
DirectSum.of (fun n => ⨂[R]^n M) _ (PiTensorProduct.tprod R fun _ : Fin 1 => x) := by
91+
simp [toDirectSum, TensorAlgebra.lift_ι_apply, DirectSum.lof_eq_of]
9292

9393
theorem ofDirectSum_comp_toDirectSum :
9494
ofDirectSum.comp toDirectSum = AlgHom.id R (TensorAlgebra R M) := by

0 commit comments

Comments
 (0)