PhysLean Documentation

PhysLean.Mathematics.InnerProductSpace.Basic

Inner product space #

In this module we define the type class InnerProductSpace' 𝕜 E which is a generalization of InnerProductSpace 𝕜 E, as it does not require the condition ‖x‖^2 = ⟪x,x⟫ but instead the condition ∃ (c > 0) (d > 0), c • ‖x‖^2 ≤ ⟪x,x⟫ ≤ d • ‖x‖^2. Instead E is equipped with a L₂ norm ‖x‖₂ which statifies ‖x‖₂ = √⟪x,x⟫.

This allows us to define the inner product space structure on product types E × F and pi types ι → E, which would otherwise not be possible due to the use of max norm on these types.

We define the following maps:

class Norm₂ (E : Type u_1) :
Type u_1

L₂ norm on E.

In particular, on product types X×Y and pi types ι → X this class provides L₂ norm unlike ‖·‖.

  • norm₂ : E

    L₂ norm on E.

    In particular, on product types X×Y and pi types ι → X this class provides L₂ norm unlike ‖·‖.

Instances

    L₂ norm on E.

    In particular, on product types X×Y and pi types ι → X this class provides L₂ norm unlike ‖·‖.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      class InnerProductSpace' (𝕜 : Type u_1) (E : Type u_2) [RCLike 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E] extends Norm₂ E :
      Type (max u_1 u_2)

      Effectively as InnerProductSpace 𝕜 E but it does not requires that ‖x‖^2 = ⟪x,x⟫. It is only required that they are equivalent ∃ (c > 0) (d > 0), c • ‖x‖^2 ≤ ⟪x,x⟫ ≤ d • ‖x‖^2. The main purpose of this class is to provide inner product space structure on product types ExF and pi types ι → E without using WithLp gadget.

      If you want to access L₂ norm use ‖x‖₂ := √⟪x,x⟫.

      This class induces InnerProductSpace 𝕜 (WithLp 2 E) which equips ‖·‖ on X with L₂ norm. This is very useful when translating results from InnerProductSpace to InnerProductSpace' together with toL2 : E →L[𝕜] (WithLp 2 E) and fromL2 : (WithL2 2 E) →L[𝕜] E.

      In short we have these implications:

        InnerProductSpace 𝕜 E → InnerProductSpace' 𝕜 E
        InnerProductSpace' 𝕜 E → InnerProductSpace 𝕜 (WithLp 2 E)
      

      The reason behind this type class is that with current mathlib design the requirement ‖x‖^2 = ⟪x,x⟫ prevents us to give inner product space structure on product type E×F and pi type ι → E as they are equipped with max norm. One has to work with WithLp 2 (E×F) and WithLp 2 (ι → E). This places quite a bit inconvenience on users in certain scenarios. In particular, the main motivation behind this class is to make computations of adjFDeriv and gradient easy.

      Instances
        instance instInnerProductSpace' {𝕜 : Type u_3} {E : Type u_4} [RCLike 𝕜] [NormedAddCommGroup E] [inst : InnerProductSpace 𝕜 E] :
        Equations
        noncomputable def InnerProductSpace'.toNormWithL2 {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] :
        Norm (WithLp 2 E)

        Attach L₂ norm to WithLp 2 E

        Equations
        Instances For
          noncomputable def InnerProductSpace'.toInnerWithL2 {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] :
          Inner 𝕜 (WithLp 2 E)

          Attach inner product to WithLp 2 E

          Equations
          Instances For
            noncomputable def InnerProductSpace'.toNormedAddCommGroupWitL2 {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] :

            Attach normed group structure to WithLp 2 E with L₂ norm.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              noncomputable def InnerProductSpace'.toNormedSpaceWithL2 {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] :
              NormedSpace 𝕜 (WithLp 2 E)

              Attach normed space structure to WithLp 2 E with L₂ norm.

              Equations
              Instances For
                noncomputable instance InnerProductSpace'.toInnerProductSpaceWithL2 {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] :

                Attach inner product space structure to WithLp 2 E.

                Equations
                • One or more equations did not get rendered due to their size.
                noncomputable def InnerProductSpace'.toL2 (𝕜 : Type u_1) [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] :
                E →L[𝕜] WithLp 2 E

                Continuous linear map from E to WithLp 2 E.

                This map is continuous because we require topological equivalence between ‖·‖ and ‖·‖₂.

                Equations
                Instances For
                  noncomputable def InnerProductSpace'.fromL2 (𝕜 : Type u_1) [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] :
                  WithLp 2 E →L[𝕜] E

                  Continuous linear map from WithLp 2 E to E.

                  This map is continuous because we require topological equivalence between ‖·‖ and ‖·‖₂.

                  Equations
                  Instances For
                    theorem InnerProductSpace'.fromL2_inner_left {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] (x : WithLp 2 E) (y : E) :
                    inner 𝕜 ((fromL2 𝕜) x) y = inner 𝕜 x ((toL2 𝕜) y)
                    theorem InnerProductSpace'.toL2_inner_left {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] (x : E) (y : WithLp 2 E) :
                    inner 𝕜 ((toL2 𝕜) x) y = inner 𝕜 x ((fromL2 𝕜) y)
                    @[simp]
                    theorem InnerProductSpace'.toL2_fromL2 {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] (x : WithLp 2 E) :
                    (toL2 𝕜) ((fromL2 𝕜) x) = x
                    @[simp]
                    theorem InnerProductSpace'.fromL2_toL2 {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] (x : E) :
                    (fromL2 𝕜) ((toL2 𝕜) x) = x
                    noncomputable def InnerProductSpace'.equivL2 (𝕜 : Type u_1) [RCLike 𝕜] (E : Type u_2) [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] :
                    WithLp 2 E ≃L[𝕜] E

                    Continuous linear equivalence between WithLp 2 E and E under InnerProductSpace' 𝕜 E.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      theorem ext_inner_left' (𝕜 : Type u_1) [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] {x y : E} (h : ∀ (v : E), inner 𝕜 v x = inner 𝕜 v y) :
                      x = y
                      theorem ext_inner_right' (𝕜 : Type u_1) [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] {x y : E} (h : ∀ (v : E), inner 𝕜 x v = inner 𝕜 y v) :
                      x = y
                      @[simp]
                      theorem inner_conj_symm' {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] (x y : E) :
                      (starRingEnd 𝕜) (inner 𝕜 y x) = inner 𝕜 x y
                      theorem inner_smul_left' {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] (x y : E) (r : 𝕜) :
                      inner 𝕜 (r x) y = (starRingEnd 𝕜) r * inner 𝕜 x y
                      theorem inner_smul_right' {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] (x y : E) (r : 𝕜) :
                      inner 𝕜 x (r y) = r * inner 𝕜 x y
                      @[simp]
                      theorem inner_zero_left' {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] (x : E) :
                      inner 𝕜 0 x = 0
                      @[simp]
                      theorem inner_zero_right' {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] (x : E) :
                      inner 𝕜 x 0 = 0
                      theorem inner_add_left' {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] (x y z : E) :
                      inner 𝕜 (x + y) z = inner 𝕜 x z + inner 𝕜 y z
                      theorem inner_add_right' {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] (x y z : E) :
                      inner 𝕜 x (y + z) = inner 𝕜 x y + inner 𝕜 x z
                      theorem inner_sub_left' {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] (x y z : E) :
                      inner 𝕜 (x - y) z = inner 𝕜 x z - inner 𝕜 y z
                      theorem inner_sub_right' {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] (x y z : E) :
                      inner 𝕜 x (y - z) = inner 𝕜 x y - inner 𝕜 x z
                      @[simp]
                      theorem inner_neg_left' {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] (x y : E) :
                      inner 𝕜 (-x) y = -inner 𝕜 x y
                      @[simp]
                      theorem inner_neg_right' {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] (x y : E) :
                      inner 𝕜 x (-y) = -inner 𝕜 x y
                      @[simp]
                      theorem inner_self_eq_zero' {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] {x : E} :
                      inner 𝕜 x x = 0 x = 0
                      theorem Continuous.inner' {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [hE : InnerProductSpace' 𝕜 E] {α : Type u_5} [TopologicalSpace α] (f g : αE) (hf : Continuous f) (hg : Continuous g) :
                      Continuous fun (a : α) => Inner.inner 𝕜 (f a) (g a)
                      theorem ContDiffAt.inner' {E : Type u_5} [NormedAddCommGroup E] [NormedSpace E] {F : Type u_6} [NormedAddCommGroup F] [NormedSpace F] [InnerProductSpace' F] {n : WithTop ℕ∞} {f g : EF} {x : E} (hf : ContDiffAt n f x) (hg : ContDiffAt n g x) :
                      ContDiffAt n (fun (x : E) => Inner.inner (f x) (g x)) x
                      theorem ContDiff.inner' {E : Type u_5} [NormedAddCommGroup E] [NormedSpace E] {F : Type u_6} [NormedAddCommGroup F] [NormedSpace F] [InnerProductSpace' F] {n : WithTop ℕ∞} {f g : EF} (hf : ContDiff n f) (hg : ContDiff n g) :
                      ContDiff n fun (x : E) => Inner.inner (f x) (g x)
                      def instInnerProd_physLean {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [InnerProductSpace' 𝕜 E] {F : Type u_3} [NormedAddCommGroup F] [NormedSpace 𝕜 F] [InnerProductSpace' 𝕜 F] :
                      Inner 𝕜 (E × F)

                      Inner product on product types E×F defined as ⟪x,y⟫ = ⟪x.fst,y.fst⟫ + ⟪x.snd,y.snd⟫.

                      This is just local instance as it is superseded by the following instance for InnerProductSpace'.

                      Equations
                      Instances For
                        @[simp]
                        theorem prod_inner_apply' {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [InnerProductSpace' 𝕜 E] {F : Type u_3} [NormedAddCommGroup F] [NormedSpace 𝕜 F] [InnerProductSpace' 𝕜 F] (x y : E × F) :
                        inner 𝕜 x y = inner 𝕜 x.1 y.1 + inner 𝕜 x.2 y.2
                        noncomputable instance instInnerProductSpace'Prod {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [InnerProductSpace' 𝕜 E] {F : Type u_3} [NormedAddCommGroup F] [NormedSpace 𝕜 F] [InnerProductSpace' 𝕜 F] :
                        Equations
                        • One or more equations did not get rendered due to their size.
                        noncomputable instance instInnerProductSpace'Forall {𝕜 : Type u_1} [RCLike 𝕜] {E : Type u_2} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [InnerProductSpace' 𝕜 E] {ι : Type u_5} [Fintype ι] :
                        InnerProductSpace' 𝕜 (ιE)
                        Equations
                        • One or more equations did not get rendered due to their size.