PhysLean Documentation

PhysLean.Relativity.Tensors.Tree.Basic

Tensor trees #

inductive TensorTree (S : TensorSpecies) {n : } :
(Fin nS.C)Type

A syntax tree for tensor expressions.

Instances For

    Composite nodes #

    def TensorTree.vecNode {S : TensorSpecies} {c : S.C} (v : (S.FD.obj { as := c }).V) :

    A node consisting of a single vector.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[reducible, inline]
      abbrev TensorTree.vecNodeE (S : TensorSpecies) (c1 : S.C) (v : (S.FD.obj { as := c1 }).V) :

      The node vecNode of a tensor tree, with all arguments explicit.

      Equations
      Instances For
        def TensorTree.twoNode {S : TensorSpecies} {c1 c2 : S.C} (t : (CategoryTheory.MonoidalCategoryStruct.tensorObj (S.FD.obj { as := c1 }) (S.FD.obj { as := c2 })).V) :

        A node consisting of a two tensor.

        Equations
        Instances For
          @[reducible, inline]
          abbrev TensorTree.twoNodeE (S : TensorSpecies) (c1 c2 : S.C) (v : (CategoryTheory.MonoidalCategoryStruct.tensorObj (S.FD.obj { as := c1 }) (S.FD.obj { as := c2 })).V) :

          The node twoNode of a tensor tree, with all arguments explicit.

          Equations
          Instances For
            @[reducible, inline]
            abbrev TensorTree.threeNodeE (S : TensorSpecies) (c1 c2 c3 : S.C) (v : (CategoryTheory.MonoidalCategoryStruct.tensorObj (S.FD.obj { as := c1 }) (CategoryTheory.MonoidalCategoryStruct.tensorObj (S.FD.obj { as := c2 }) (S.FD.obj { as := c3 }))).V) :
            TensorTree S ![c1, c2, c3]

            The node threeNode of a tensor tree, with all arguments explicit.

            Equations
            Instances For
              def TensorTree.constNode {S : TensorSpecies} {n : } {c : Fin nS.C} (T : 𝟙_ (Rep S.k S.G) S.F.obj (IndexNotation.OverColor.mk c)) :

              A general constant node.

              Equations
              Instances For
                def TensorTree.constVecNode {S : TensorSpecies} {c : S.C} (v : 𝟙_ (Rep S.k S.G) S.FD.obj { as := c }) :

                A constant vector.

                Equations
                Instances For
                  def TensorTree.constTwoNode {S : TensorSpecies} {c1 c2 : S.C} (v : 𝟙_ (Rep S.k S.G) CategoryTheory.MonoidalCategoryStruct.tensorObj (S.FD.obj { as := c1 }) (S.FD.obj { as := c2 })) :

                  A constant two tensor (e.g. metric and unit).

                  Equations
                  Instances For
                    @[reducible, inline]
                    abbrev TensorTree.constTwoNodeE (S : TensorSpecies) (c1 c2 : S.C) (v : 𝟙_ (Rep S.k S.G) CategoryTheory.MonoidalCategoryStruct.tensorObj (S.FD.obj { as := c1 }) (S.FD.obj { as := c2 })) :

                    The node constTwoNode of a tensor tree, with all arguments explicit.

                    Equations
                    Instances For
                      def TensorTree.constThreeNode {S : TensorSpecies} {c1 c2 c3 : S.C} (v : 𝟙_ (Rep S.k S.G) CategoryTheory.MonoidalCategoryStruct.tensorObj (S.FD.obj { as := c1 }) (CategoryTheory.MonoidalCategoryStruct.tensorObj (S.FD.obj { as := c2 }) (S.FD.obj { as := c3 }))) :
                      TensorTree S ![c1, c2, c3]

                      A constant three tensor (e.g. Pauli matrices).

                      Equations
                      Instances For
                        @[reducible, inline]
                        abbrev TensorTree.constThreeNodeE (S : TensorSpecies) (c1 c2 c3 : S.C) (v : 𝟙_ (Rep S.k S.G) CategoryTheory.MonoidalCategoryStruct.tensorObj (S.FD.obj { as := c1 }) (CategoryTheory.MonoidalCategoryStruct.tensorObj (S.FD.obj { as := c2 }) (S.FD.obj { as := c3 }))) :
                        TensorTree S ![c1, c2, c3]

                        The node constThreeNode of a tensor tree, with all arguments explicit.

                        Equations
                        Instances For

                          Other operations. #

                          def TensorTree.size {S : TensorSpecies} {n : } {c : Fin nS.C} :
                          TensorTree S c

                          The number of nodes in a tensor tree.

                          Equations
                          Instances For
                            def TensorTree.tensor {S : TensorSpecies} {n : } {c : Fin nS.C} :

                            The underlying tensor a tensor tree corresponds to.

                            Instances For
                              def TensorTree.field {S : TensorSpecies} {c : Fin 0S.C} (t : TensorTree S c) :
                              S.k

                              Takes a tensor tree based on Fin 0, into the field S.k.

                              Equations
                              Instances For

                                Tensor on different nodes. #

                                @[simp]
                                theorem TensorTree.tensorNode_tensor {S : TensorSpecies} {n : } {c : Fin nS.C} (T : (S.F.obj (IndexNotation.OverColor.mk c)).V) :
                                theorem TensorTree.add_tensor {S : TensorSpecies} {n : } {c : Fin nS.C} (t1 t2 : TensorTree S c) :
                                (t1.add t2).tensor = t1.tensor + t2.tensor
                                theorem TensorTree.perm_tensor {S : TensorSpecies} {n : } {c : Fin nS.C} {n✝ : } {c1 : Fin n✝S.C} (σ : IndexNotation.OverColor.mk c IndexNotation.OverColor.mk c1) (t : TensorTree S c) :
                                theorem TensorTree.contr_tensor {S : TensorSpecies} {n : } {c : Fin n.succ.succS.C} {i : Fin n.succ.succ} {j : Fin n.succ} {h : c (i.succAbove j) = S.τ (c i)} (t : TensorTree S c) :
                                theorem TensorTree.neg_tensor {S : TensorSpecies} {n : } {c : Fin nS.C} (t : TensorTree S c) :
                                theorem TensorTree.eval_tensor {S : TensorSpecies} {n : } {c : Fin n.succS.C} (i : Fin n.succ) (e : ) (t : TensorTree S c) :
                                theorem TensorTree.smul_tensor {S : TensorSpecies} {n : } {c : Fin nS.C} (a : S.k) (T : TensorTree S c) :
                                (smul a T).tensor = a T.tensor
                                theorem TensorTree.action_tensor {S : TensorSpecies} {n : } {c : Fin nS.C} (g : S.G) (T : TensorTree S c) :

                                Equality of tensors and rewrites. #

                                theorem TensorTree.contr_tensor_eq {S : TensorSpecies} {n : } {c : Fin n.succ.succS.C} {T1 T2 : TensorTree S c} (h : T1.tensor = T2.tensor) {i : Fin n.succ.succ} {j : Fin n.succ} {h' : c (i.succAbove j) = S.τ (c i)} :
                                (contr i j h' T1).tensor = (contr i j h' T2).tensor
                                theorem TensorTree.prod_tensor_eq_fst {S : TensorSpecies} {n m : } {c : Fin nS.C} {c1 : Fin mS.C} {T1 T1' : TensorTree S c} {T2 : TensorTree S c1} (h : T1.tensor = T1'.tensor) :
                                (T1.prod T2).tensor = (T1'.prod T2).tensor
                                theorem TensorTree.prod_tensor_eq_snd {S : TensorSpecies} {n m : } {c : Fin nS.C} {c1 : Fin mS.C} {T1 : TensorTree S c} {T2 T2' : TensorTree S c1} (h : T2.tensor = T2'.tensor) :
                                (T1.prod T2).tensor = (T1.prod T2').tensor
                                theorem TensorTree.perm_tensor_eq {S : TensorSpecies} {n m : } {c : Fin nS.C} {c1 : Fin mS.C} {σ : IndexNotation.OverColor.mk c IndexNotation.OverColor.mk c1} {T1 T2 : TensorTree S c} (h : T1.tensor = T2.tensor) :
                                (perm σ T1).tensor = (perm σ T2).tensor
                                theorem TensorTree.add_tensor_eq_fst {S : TensorSpecies} {n : } {c : Fin nS.C} {T1 T1' T2 : TensorTree S c} (h : T1.tensor = T1'.tensor) :
                                (T1.add T2).tensor = (T1'.add T2).tensor
                                theorem TensorTree.add_tensor_eq_snd {S : TensorSpecies} {n : } {c : Fin nS.C} {T1 T2 T2' : TensorTree S c} (h : T2.tensor = T2'.tensor) :
                                (T1.add T2).tensor = (T1.add T2').tensor
                                theorem TensorTree.add_tensor_eq {S : TensorSpecies} {n : } {c : Fin nS.C} {T1 T1' T2 T2' : TensorTree S c} (h1 : T1.tensor = T1'.tensor) (h2 : T2.tensor = T2'.tensor) :
                                (T1.add T2).tensor = (T1'.add T2').tensor
                                theorem TensorTree.neg_tensor_eq {S : TensorSpecies} {n : } {c : Fin nS.C} {T1 T2 : TensorTree S c} (h : T1.tensor = T2.tensor) :
                                theorem TensorTree.smul_tensor_eq {S : TensorSpecies} {n : } {c : Fin nS.C} {T1 T2 : TensorTree S c} {a : S.k} (h : T1.tensor = T2.tensor) :
                                (smul a T1).tensor = (smul a T2).tensor
                                theorem TensorTree.action_tensor_eq {S : TensorSpecies} {n : } {c : Fin nS.C} {T1 T2 : TensorTree S c} {g : S.G} (h : T1.tensor = T2.tensor) :
                                (action g T1).tensor = (action g T2).tensor
                                theorem TensorTree.smul_mul_eq {S : TensorSpecies} {n : } {c : Fin nS.C} {T1 : TensorTree S c} {a b : S.k} (h : a = b) :
                                (smul a T1).tensor = (smul b T1).tensor
                                theorem TensorTree.eq_tensorNode_of_eq_tensor {S : TensorSpecies} {n : } {c : Fin nS.C} {T1 : TensorTree S c} {t : (S.F.obj (IndexNotation.OverColor.mk c)).V} (h : T1.tensor = t) :

                                Properties on basis. #

                                @[simp]
                                theorem TensorTree.add_tensorBasis_repr {S : TensorSpecies} {n : } {c : Fin nS.C} (t1 t2 : TensorTree S c) :
                                theorem TensorTree.prod_tensorBasis_repr_apply {S : TensorSpecies} {n m : } {c : Fin nS.C} {c1 : Fin mS.C} (t : TensorTree S c) (t1 : TensorTree S c1) (b : (j : Fin (n + m)) → Fin (S.repDim ((Sum.elim c c1 finSumFinEquiv.symm) j))) :
                                theorem TensorTree.contr_tensorBasis_repr_apply {S : TensorSpecies} {n : } {c : Fin (n + 1 + 1)S.C} {i : Fin (n + 1 + 1)} {j : Fin (n + 1)} {h : c (i.succAbove j) = S.τ (c i)} (t : TensorTree S c) (b : (k : Fin n) → Fin (S.repDim (c (i.succAbove (j.succAbove k))))) :
                                ((S.tensorBasis (c i.succAbove j.succAbove)).repr (contr i j h t).tensor) b = b' : { x : (k : Fin n.succ.succ) → Fin (S.repDim (c k)) // x TensorSpecies.TensorBasis.ContrSection b }, ((S.tensorBasis c).repr t.tensor) b' * S.castToField ((CategoryTheory.ConcreteCategory.hom (S.contr.app { as := c i }).hom) ((S.basis (c i)) (b' i) ⊗ₜ[S.k] (S.basis (S.τ (c i))) (Fin.cast (b' (i.succAbove j)))))
                                theorem TensorTree.contr_tensorBasis_repr_apply_eq {S : TensorSpecies} {n : } {c : Fin (n + 1 + 1)S.C} {i : Fin (n + 1 + 1)} {j : Fin (n + 1)} {h : c (i.succAbove j) = S.τ (c i)} (t : TensorTree S c) (b : (k : Fin n) → Fin (S.repDim (c (i.succAbove (j.succAbove k))))) (a : S.k) :
                                ((S.tensorBasis (c i.succAbove j.succAbove)).repr (contr i j h t).tensor) b = a b' : { x : (k : Fin n.succ.succ) → Fin (S.repDim (c k)) // x TensorSpecies.TensorBasis.ContrSection b }, ((S.tensorBasis c).repr t.tensor) b' * S.castToField ((CategoryTheory.ConcreteCategory.hom (S.contr.app { as := c i }).hom) ((S.basis (c i)) (b' i) ⊗ₜ[S.k] (S.basis (S.τ (c i))) (Fin.cast (b' (i.succAbove j))))) = a
                                @[simp]
                                theorem TensorTree.perm_tensorBasis_repr_apply {S : TensorSpecies} {n m : } {c : Fin nS.C} {c1 : Fin mS.C} {σ : IndexNotation.OverColor.mk c IndexNotation.OverColor.mk c1} (t : TensorTree S c) (b : (j : Fin m) → Fin (S.repDim (c1 j))) :
                                @[simp]
                                theorem TensorTree.smul_tensorBasis_repr {S : TensorSpecies} {n : } {c : Fin nS.C} (a : S.k) (T : TensorTree S c) :
                                theorem TensorTree.smul_tensorBasis_repr_apply {S : TensorSpecies} {n : } {c : Fin nS.C} (a : S.k) (T : TensorTree S c) (b : (j : Fin n) → Fin (S.repDim (c j))) :
                                ((S.tensorBasis c).repr (smul a T).tensor) b = a * ((S.tensorBasis c).repr T.tensor) b
                                @[simp]
                                theorem TensorTree.neg_tensorBasis_repr {S : TensorSpecies} {n : } {c : Fin nS.C} (t : TensorTree S c) :

                                The zero tensor tree #

                                def TensorTree.zeroTree {S : TensorSpecies} {n : } {c : Fin nS.C} :

                                The zero tensor tree.

                                Equations
                                Instances For
                                  @[simp]
                                  theorem TensorTree.zeroTree_tensor {S : TensorSpecies} {n : } {c : Fin nS.C} :
                                  theorem TensorTree.zero_smul {S : TensorSpecies} {n : } {c : Fin nS.C} {T1 : TensorTree S c} :
                                  theorem TensorTree.smul_zero {S : TensorSpecies} {n : } {c : Fin nS.C} {a : S.k} :
                                  theorem TensorTree.zero_add {S : TensorSpecies} {n : } {c : Fin nS.C} {T1 : TensorTree S c} :
                                  theorem TensorTree.add_zero {S : TensorSpecies} {n : } {c : Fin nS.C} {T1 : TensorTree S c} :
                                  theorem TensorTree.contr_zero {S : TensorSpecies} {n : } {c : Fin n.succ.succS.C} {i : Fin n.succ.succ} {j : Fin n.succ} {h : c (i.succAbove j) = S.τ (c i)} :
                                  theorem TensorTree.zero_prod {S : TensorSpecies} {n m : } {c : Fin nS.C} {c1 : Fin mS.C} (t : TensorTree S c1) :
                                  theorem TensorTree.prod_zero {S : TensorSpecies} {n m : } {c : Fin nS.C} {c1 : Fin mS.C} (t : TensorTree S c) :
                                  structure TensorTree.ContrPair {S : TensorSpecies} {n : } (c : Fin n.succ.succS.C) :

                                  A structure containing a pair of indices (i, j) to be contracted in a tensor. This is used in some proofs of node identities for tensor trees.

                                  • i : Fin n.succ.succ

                                    The first index in the pair, appearing on the left in the contraction node contr i j h _.

                                  • j : Fin n.succ

                                    The second index in the pair, appearing on the right in the contraction node contr i j h _.

                                  • h : c (self.i.succAbove self.j) = S.τ (c self.i)

                                    A proof that the two indices can be contracted.

                                  Instances For
                                    theorem TensorTree.ContrPair.ext {S : TensorSpecies} {n : } {c : Fin n.succ.succS.C} (q q' : ContrPair c) (hi : q.i = q'.i) (hj : q.j = q'.j) :
                                    q = q'

                                    The contraction map for a pair of indices.

                                    Equations
                                    Instances For