File: Mathlib/LinearAlgebra/CliffordAlgebra/Basic.lean

full_name: CliffordAlgebra.Rel.of
code: /-- `Rel` relates each `ι m * ι m`, for `m : M`, with `Q m`.

The Clifford algebra of `M` is defined as the quotient modulo this relation.
-/
inductive Rel : TensorAlgebra R M → TensorAlgebra R M → Prop
  | of (m : M) : Rel (ι R m * ι R m) (algebraMap R _ (Q m))
goal: CliffordAlgebra.Rel Q ((TensorAlgebra.ι R) m * (TensorAlgebra.ι R) m) ((algebraMap R (TensorAlgebra R M)) (Q m))

full_name: CliffordAlgebra.Rel
code: /-- `Rel` relates each `ι m * ι m`, for `m : M`, with `Q m`.

The Clifford algebra of `M` is defined as the quotient modulo this relation.
-/
inductive Rel : TensorAlgebra R M → TensorAlgebra R M → Prop
  | of (m : M) : Rel (ι R m * ι R m) (algebraMap R _ (Q m))
goal: TensorAlgebra R M → TensorAlgebra R M → Prop

full_name: CliffordAlgebra
code: /-- The Clifford algebra of an `R`-module `M` equipped with a quadratic_form `Q`.
-/
def CliffordAlgebra 
goal: Type (max u_2 u_1)

full_name: CliffordAlgebra.instInhabited
code: instance instInhabited : Inhabited (CliffordAlgebra Q) 
goal: Inhabited (CliffordAlgebra Q)

full_name: CliffordAlgebra.instRing
code: instance instRing : Ring (CliffordAlgebra Q) 
goal: Ring (CliffordAlgebra Q)

full_name: CliffordAlgebra.instAlgebra'
code: instance (priority := 900) instAlgebra' {R A M} [CommSemiring R] [AddCommGroup M] [CommRing A]
    [Algebra R A] [Module R M] [Module A M] (Q : QuadraticForm A M)
    [IsScalarTower R A M] :
    Algebra R (CliffordAlgebra Q) 
goal: Algebra R (CliffordAlgebra Q)

full_name: CliffordAlgebra.instAlgebra
code: instance instAlgebra : Algebra R (CliffordAlgebra Q) 
goal: Algebra R (CliffordAlgebra Q)

full_name: CliffordAlgebra.instSMulCommClass
code: instance {R S A M} [CommSemiring R] [CommSemiring S] [AddCommGroup M] [CommRing A]
    [Algebra R A] [Algebra S A] [Module R M] [Module S M] [Module A M] (Q : QuadraticForm A M)
    [IsScalarTower R A M] [IsScalarTower S A M] :
    SMulCommClass R S (CliffordAlgebra Q) 
goal: SMulCommClass R S (CliffordAlgebra Q)

full_name: CliffordAlgebra.instIsScalarTower
code: instance {R S A M} [CommSemiring R] [CommSemiring S] [AddCommGroup M] [CommRing A]
    [SMul R S] [Algebra R A] [Algebra S A] [Module R M] [Module S M] [Module A M]
    [IsScalarTower R A M] [IsScalarTower S A M] [IsScalarTower R S A] (Q : QuadraticForm A M) :
    IsScalarTower R S (CliffordAlgebra Q) 
goal: IsScalarTower R S (CliffordAlgebra Q)

full_name: CliffordAlgebra.ι
code: /-- The canonical linear map `M →ₗ[R] CliffordAlgebra Q`.
-/
def ι : M →ₗ[R] CliffordAlgebra Q 
goal: M →ₗ[R] CliffordAlgebra Q

full_name: CliffordAlgebra.ι_sq_scalar
code: /-- As well as being linear, `ι Q` squares to the quadratic form -/
@[simp]
theorem ι_sq_scalar (m : M) : ι Q m * ι Q m = algebraMap R _ (Q m) 
goal: (CliffordAlgebra.ι Q) m * (CliffordAlgebra.ι Q) m = (algebraMap R (CliffordAlgebra Q)) (Q m)

full_name: CliffordAlgebra.comp_ι_sq_scalar
code: @[simp]
theorem comp_ι_sq_scalar (g : CliffordAlgebra Q →ₐ[R] A) (m : M) :
    g (ι Q m) * g (ι Q m) = algebraMap _ _ (Q m) 
goal: g ((CliffordAlgebra.ι Q) m) * g ((CliffordAlgebra.ι Q) m) = (algebraMap R A) (Q m)

full_name: CliffordAlgebra.lift_symm_apply
code: /-- Given a linear map `f : M →ₗ[R] A` into an `R`-algebra `A`, which satisfies the condition:
`cond : ∀ m : M, f m * f m = Q(m)`, this is the canonical lift of `f` to a morphism of `R`-algebras
from `CliffordAlgebra Q` to `A`.
-/
@[simps symm_apply]
def lift :
    { f : M →ₗ[R] A // ∀ m, f m * f m = algebraMap _ _ (Q m) } ≃ (CliffordAlgebra Q →ₐ[R] A) 
goal: (CliffordAlgebra.lift Q).symm F = ⟨F.toLinearMap ∘ₗ CliffordAlgebra.ι Q, ⋯⟩

full_name: CliffordAlgebra.lift
code: /-- Given a linear map `f : M →ₗ[R] A` into an `R`-algebra `A`, which satisfies the condition:
`cond : ∀ m : M, f m * f m = Q(m)`, this is the canonical lift of `f` to a morphism of `R`-algebras
from `CliffordAlgebra Q` to `A`.
-/
@[simps symm_apply]
def lift :
    { f : M →ₗ[R] A // ∀ m, f m * f m = algebraMap _ _ (Q m) } ≃ (CliffordAlgebra Q →ₐ[R] A) 
goal: { f // ∀ (m : M), f m * f m = (algebraMap R A) (Q m) } ≃ (CliffordAlgebra Q →ₐ[R] A)

full_name: CliffordAlgebra.ι_comp_lift
code: @[simp]
theorem ι_comp_lift (f : M →ₗ[R] A) (cond : ∀ m, f m * f m = algebraMap _ _ (Q m)) :
    (lift Q ⟨f, cond⟩).toLinearMap.comp (ι Q) = f 
goal: ((CliffordAlgebra.lift Q) ⟨f, cond⟩).toLinearMap ∘ₗ CliffordAlgebra.ι Q = f

full_name: CliffordAlgebra.lift_ι_apply
code: @[simp]
theorem lift_ι_apply (f : M →ₗ[R] A) (cond : ∀ m, f m * f m = algebraMap _ _ (Q m)) (x) :
    lift Q ⟨f, cond⟩ (ι Q x) = f x 
goal: ((CliffordAlgebra.lift Q) ⟨f, cond⟩) ((CliffordAlgebra.ι Q) x) = f x

full_name: CliffordAlgebra.lift_unique
code: @[simp]
theorem lift_unique (f : M →ₗ[R] A) (cond : ∀ m : M, f m * f m = algebraMap _ _ (Q m))
    (g : CliffordAlgebra Q →ₐ[R] A) : g.toLinearMap.comp (ι Q) = f ↔ g = lift Q ⟨f, cond⟩ 
goal: g.toLinearMap ∘ₗ CliffordAlgebra.ι Q = f ↔ g = (CliffordAlgebra.lift Q) ⟨f, cond⟩

full_name: CliffordAlgebra.lift_comp_ι
code: @[simp]
theorem lift_comp_ι (g : CliffordAlgebra Q →ₐ[R] A) :
    lift Q ⟨g.toLinearMap.comp (ι Q), comp_ι_sq_scalar _⟩ = g 
goal: (CliffordAlgebra.lift Q) ⟨g.toLinearMap ∘ₗ CliffordAlgebra.ι Q, ⋯⟩ = g

full_name: CliffordAlgebra.hom_ext
code: /-- See note [partially-applied ext lemmas]. -/
@[ext high]
theorem hom_ext {A : Type*} [Semiring A] [Algebra R A] {f g : CliffordAlgebra Q →ₐ[R] A} :
    f.toLinearMap.comp (ι Q) = g.toLinearMap.comp (ι Q) → f = g 
goal: f.toLinearMap ∘ₗ CliffordAlgebra.ι Q = g.toLinearMap ∘ₗ CliffordAlgebra.ι Q → f = g

full_name: CliffordAlgebra.induction
code: /-- If `C` holds for the `algebraMap` of `r : R` into `CliffordAlgebra Q`, the `ι` of `x : M`,
and is preserved under addition and muliplication, then it holds for all of `CliffordAlgebra Q`.

See also the stronger `CliffordAlgebra.left_induction` and `CliffordAlgebra.right_induction`.
-/
@[elab_as_elim]
theorem induction {C : CliffordAlgebra Q → Prop}
    (algebraMap : ∀ r, C (algebraMap R (CliffordAlgebra Q) r)) (ι : ∀ x, C (ι Q x))
    (mul : ∀ a b, C a → C b → C (a * b)) (add : ∀ a b, C a → C b → C (a + b))
    (a : CliffordAlgebra Q) : C a 
goal: C a

full_name: CliffordAlgebra.mul_add_swap_eq_polar_of_forall_mul_self_eq
code: theorem mul_add_swap_eq_polar_of_forall_mul_self_eq {A : Type*} [Ring A] [Algebra R A]
    (f : M →ₗ[R] A) (hf : ∀ x, f x * f x = algebraMap _ _ (Q x)) (a b : M) :
    f a * f b + f b * f a = algebraMap R _ (QuadraticMap.polar Q a b) 
goal: f a * f b + f b * f a = (algebraMap R A) (QuadraticMap.polar (⇑Q) a b)

full_name: CliffordAlgebra.forall_mul_self_eq_iff
code: /-- An alternative way to provide the argument to `CliffordAlgebra.lift` when `2` is invertible.

To show a function squares to the quadratic form, it suffices to show that
`f x * f y + f y * f x = algebraMap _ _ (polar Q x y)` -/
theorem forall_mul_self_eq_iff {A : Type*} [Ring A] [Algebra R A] (h2 : IsUnit (2 : A))
    (f : M →ₗ[R] A) :
    (∀ x, f x * f x = algebraMap _ _ (Q x)) ↔
      (LinearMap.mul R A).compl₂ f ∘ₗ f + (LinearMap.mul R A).flip.compl₂ f ∘ₗ f =
        Q.polarBilin.compr₂ (Algebra.linearMap R A) 
goal: (∀ (x : M), f x * f x = (algebraMap R A) (Q x)) ↔
  (LinearMap.mul R A).compl₂ f ∘ₗ f + (LinearMap.mul R A).flip.compl₂ f ∘ₗ f =
    LinearMap.compr₂ (QuadraticMap.polarBilin Q) (Algebra.linearMap R A)

full_name: CliffordAlgebra.ι_mul_ι_add_swap
code: /-- The symmetric product of vectors is a scalar -/
theorem ι_mul_ι_add_swap (a b : M) :
    ι Q a * ι Q b + ι Q b * ι Q a = algebraMap R _ (QuadraticMap.polar Q a b) 
goal: (CliffordAlgebra.ι Q) a * (CliffordAlgebra.ι Q) b + (CliffordAlgebra.ι Q) b * (CliffordAlgebra.ι Q) a =
  (algebraMap R (CliffordAlgebra Q)) (QuadraticMap.polar (⇑Q) a b)

full_name: CliffordAlgebra.ι_mul_ι_comm
code: theorem ι_mul_ι_comm (a b : M) :
    ι Q a * ι Q b = algebraMap R _ (QuadraticMap.polar Q a b) - ι Q b * ι Q a 
goal: (CliffordAlgebra.ι Q) a * (CliffordAlgebra.ι Q) b =
  (algebraMap R (CliffordAlgebra Q)) (QuadraticMap.polar (⇑Q) a b) - (CliffordAlgebra.ι Q) b * (CliffordAlgebra.ι Q) a

full_name: CliffordAlgebra.ι_mul_ι_add_swap_of_isOrtho
code: @[simp] theorem ι_mul_ι_add_swap_of_isOrtho {a b : M} (h : Q.IsOrtho a b) :
    ι Q a * ι Q b + ι Q b * ι Q a = 0 
goal: (CliffordAlgebra.ι Q) a * (CliffordAlgebra.ι Q) b + (CliffordAlgebra.ι Q) b * (CliffordAlgebra.ι Q) a = 0

full_name: CliffordAlgebra.ι_mul_ι_comm_of_isOrtho
code: theorem ι_mul_ι_comm_of_isOrtho {a b : M} (h : Q.IsOrtho a b) :
    ι Q a * ι Q b = -(ι Q b * ι Q a) 
goal: (CliffordAlgebra.ι Q) a * (CliffordAlgebra.ι Q) b = -((CliffordAlgebra.ι Q) b * (CliffordAlgebra.ι Q) a)

full_name: CliffordAlgebra.mul_ι_mul_ι_of_isOrtho
code: theorem mul_ι_mul_ι_of_isOrtho (x : CliffordAlgebra Q) {a b : M} (h : Q.IsOrtho a b) :
    x * ι Q a * ι Q b = -(x * ι Q b * ι Q a) 
goal: x * (CliffordAlgebra.ι Q) a * (CliffordAlgebra.ι Q) b = -(x * (CliffordAlgebra.ι Q) b * (CliffordAlgebra.ι Q) a)

full_name: CliffordAlgebra.ι_mul_ι_mul_of_isOrtho
code: theorem ι_mul_ι_mul_of_isOrtho (x : CliffordAlgebra Q) {a b : M} (h : Q.IsOrtho a b) :
    ι Q a * (ι Q b * x) = -(ι Q b * (ι Q a * x)) 
goal: (CliffordAlgebra.ι Q) a * ((CliffordAlgebra.ι Q) b * x) = -((CliffordAlgebra.ι Q) b * ((CliffordAlgebra.ι Q) a * x))

full_name: CliffordAlgebra.ι_mul_ι_mul_ι
code: /-- $aba$ is a vector. -/
theorem ι_mul_ι_mul_ι (a b : M) :
    ι Q a * ι Q b * ι Q a = ι Q (QuadraticMap.polar Q a b • a - Q a • b) 
goal: (CliffordAlgebra.ι Q) a * (CliffordAlgebra.ι Q) b * (CliffordAlgebra.ι Q) a =
  (CliffordAlgebra.ι Q) (QuadraticMap.polar (⇑Q) a b • a - Q a • b)

full_name: CliffordAlgebra.ι_range_map_lift
code: @[simp]
theorem ι_range_map_lift (f : M →ₗ[R] A) (cond : ∀ m, f m * f m = algebraMap _ _ (Q m)) :
    (ι Q).range.map (lift Q ⟨f, cond⟩).toLinearMap = LinearMap.range f 
goal: Submodule.map ((CliffordAlgebra.lift Q) ⟨f, cond⟩).toLinearMap (LinearMap.range (CliffordAlgebra.ι Q)) =
  LinearMap.range f

full_name: CliffordAlgebra.map
code: /-- Any linear map that preserves the quadratic form lifts to an `AlgHom` between algebras.

See `CliffordAlgebra.equivOfIsometry` for the case when `f` is a `QuadraticForm.IsometryEquiv`. -/
def map (f : Q₁ →qᵢ Q₂) :
    CliffordAlgebra Q₁ →ₐ[R] CliffordAlgebra Q₂ 
goal: CliffordAlgebra Q₁ →ₐ[R] CliffordAlgebra Q₂

full_name: CliffordAlgebra.map_comp_ι
code: @[simp]
theorem map_comp_ι (f : Q₁ →qᵢ Q₂) :
    (map f).toLinearMap ∘ₗ ι Q₁ = ι Q₂ ∘ₗ f.toLinearMap 
goal: (CliffordAlgebra.map f).toLinearMap ∘ₗ CliffordAlgebra.ι Q₁ = CliffordAlgebra.ι Q₂ ∘ₗ f.toLinearMap

full_name: CliffordAlgebra.map_apply_ι
code: @[simp]
theorem map_apply_ι (f : Q₁ →qᵢ Q₂) (m : M₁) : map f (ι Q₁ m) = ι Q₂ (f m) 
goal: (CliffordAlgebra.map f) ((CliffordAlgebra.ι Q₁) m) = (CliffordAlgebra.ι Q₂) (f m)

full_name: CliffordAlgebra.map_id
code: @[simp]
theorem map_id : map (QuadraticMap.Isometry.id Q₁) = AlgHom.id R (CliffordAlgebra Q₁) 
goal: CliffordAlgebra.map (QuadraticMap.Isometry.id Q₁) = AlgHom.id R (CliffordAlgebra Q₁)

full_name: CliffordAlgebra.map_comp_map
code: @[simp]
theorem map_comp_map (f : Q₂ →qᵢ Q₃) (g : Q₁ →qᵢ Q₂) :
    (map f).comp (map g) = map (f.comp g) 
goal: (CliffordAlgebra.map f).comp (CliffordAlgebra.map g) = CliffordAlgebra.map (f.comp g)

full_name: CliffordAlgebra.ι_range_map_map
code: @[simp]
theorem ι_range_map_map (f : Q₁ →qᵢ Q₂) :
    (ι Q₁).range.map (map f).toLinearMap = f.range.map (ι Q₂) 
goal: Submodule.map (CliffordAlgebra.map f).toLinearMap (LinearMap.range (CliffordAlgebra.ι Q₁)) =
  Submodule.map (CliffordAlgebra.ι Q₂) (LinearMap.range f.toLinearMap)

full_name: CliffordAlgebra.leftInverse_map_of_leftInverse
code: /-- If `f` is a linear map from `M₁` to `M₂` that preserves the quadratic forms, and if it has
a linear retraction `g` that also preserves the quadratic forms, then `CliffordAlgebra.map g`
is a retraction of `CliffordAlgebra.map f`. -/
lemma leftInverse_map_of_leftInverse {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂}
    (f : Q₁ →qᵢ Q₂) (g : Q₂ →qᵢ Q₁) (h : LeftInverse g f) : LeftInverse (map g) (map f) 
goal: Function.LeftInverse ⇑(CliffordAlgebra.map g) ⇑(CliffordAlgebra.map f)

full_name: CliffordAlgebra.map_surjective
code: /-- If a linear map preserves the quadratic forms and is surjective, then the algebra
maps it induces between Clifford algebras is also surjective. -/
lemma map_surjective {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂} (f : Q₁ →qᵢ Q₂)
    (hf : Function.Surjective f) : Function.Surjective (CliffordAlgebra.map f) 
goal: Function.Surjective ⇑(CliffordAlgebra.map f)

full_name: CliffordAlgebra.equivOfIsometry_apply
code: /-- Two `CliffordAlgebra`s are equivalent as algebras if their quadratic forms are
equivalent. -/
@[simps! apply]
def equivOfIsometry (e : Q₁.IsometryEquiv Q₂) : CliffordAlgebra Q₁ ≃ₐ[R] CliffordAlgebra Q₂ 
goal: (CliffordAlgebra.equivOfIsometry e) a = (CliffordAlgebra.map e.toIsometry) a

full_name: CliffordAlgebra.equivOfIsometry
code: /-- Two `CliffordAlgebra`s are equivalent as algebras if their quadratic forms are
equivalent. -/
@[simps! apply]
def equivOfIsometry (e : Q₁.IsometryEquiv Q₂) : CliffordAlgebra Q₁ ≃ₐ[R] CliffordAlgebra Q₂ 
goal: CliffordAlgebra Q₁ ≃ₐ[R] CliffordAlgebra Q₂

full_name: CliffordAlgebra.equivOfIsometry_symm
code: @[simp]
theorem equivOfIsometry_symm (e : Q₁.IsometryEquiv Q₂) :
    (equivOfIsometry e).symm = equivOfIsometry e.symm 
goal: (CliffordAlgebra.equivOfIsometry e).symm = CliffordAlgebra.equivOfIsometry e.symm

full_name: CliffordAlgebra.equivOfIsometry_trans
code: @[simp]
theorem equivOfIsometry_trans (e₁₂ : Q₁.IsometryEquiv Q₂) (e₂₃ : Q₂.IsometryEquiv Q₃) :
    (equivOfIsometry e₁₂).trans (equivOfIsometry e₂₃) = equivOfIsometry (e₁₂.trans e₂₃) 
goal: (CliffordAlgebra.equivOfIsometry e₁₂).trans (CliffordAlgebra.equivOfIsometry e₂₃) =
  CliffordAlgebra.equivOfIsometry (e₁₂.trans e₂₃)

full_name: CliffordAlgebra.equivOfIsometry_refl
code: @[simp]
theorem equivOfIsometry_refl :
    (equivOfIsometry <| QuadraticMap.IsometryEquiv.refl Q₁) = AlgEquiv.refl 
goal: CliffordAlgebra.equivOfIsometry (QuadraticMap.IsometryEquiv.refl Q₁) = AlgEquiv.refl

full_name: TensorAlgebra.toClifford
code: /-- The canonical image of the `TensorAlgebra` in the `CliffordAlgebra`, which maps
`TensorAlgebra.ι R x` to `CliffordAlgebra.ι Q x`. -/
def toClifford : TensorAlgebra R M →ₐ[R] CliffordAlgebra Q 
goal: TensorAlgebra R M →ₐ[R] CliffordAlgebra Q

full_name: TensorAlgebra.toClifford_ι
code: @[simp]
theorem toClifford_ι (m : M) : toClifford (TensorAlgebra.ι R m) = CliffordAlgebra.ι Q m 
goal: TensorAlgebra.toClifford ((TensorAlgebra.ι R) m) = (CliffordAlgebra.ι Q) m