Documentation

Mathlib.Algebra.QuadraticAlgebra.Basic

Quadratic algebras: involution, norm, trace, and change of generator. #

Let R be a commutative ring. We define:

We prove:

def QuadraticAlgebra.omega {R : Type u_2} {a b : R} [Zero R] [One R] :

The representative of the root in the quadratic algebra

Equations
Instances For

    the canonical element ⟨0, 1⟩ in a quadratic algebra QuadraticAlgebra R a b.

    Equations
    Instances For
      @[simp]
      theorem QuadraticAlgebra.re_omega {R : Type u_2} {a b : R} [Zero R] [One R] :
      @[simp]
      theorem QuadraticAlgebra.im_omega {R : Type u_2} {a b : R} [Zero R] [One R] :
      @[deprecated QuadraticAlgebra.re_omega (since := "2026-08-13")]
      theorem QuadraticAlgebra.omega_re {R : Type u_2} {a b : R} [Zero R] [One R] :

      Alias of QuadraticAlgebra.re_omega.

      @[deprecated QuadraticAlgebra.im_omega (since := "2026-08-13")]
      theorem QuadraticAlgebra.omega_im {R : Type u_2} {a b : R} [Zero R] [One R] :

      Alias of QuadraticAlgebra.im_omega.

      theorem QuadraticAlgebra.omega_mul_omega_eq_mk {R : Type u_2} {a b : R} [CommSemiring R] :
      omega * omega = { re := a, im := b }
      @[simp]
      theorem QuadraticAlgebra.omega_mul_mk {R : Type u_2} {a b : R} [CommSemiring R] (x y : R) :
      omega * { re := x, im := y } = { re := a * y, im := x + b * y }
      @[simp]
      theorem QuadraticAlgebra.omega_mul_algebraMap_mul_mk {R : Type u_2} {a b : R} [CommSemiring R] (n x y : R) :
      omega * (algebraMap R (QuadraticAlgebra R a b)) n * { re := x, im := y } = { re := a * n * y, im := n * x + n * b * y }
      theorem QuadraticAlgebra.mk_eq_add_smul_omega {R : Type u_2} {a b : R} [CommSemiring R] (x y : R) :
      { re := x, im := y } = (algebraMap R (QuadraticAlgebra R a b)) x + y omega
      theorem QuadraticAlgebra.algHom_ext {R : Type u_2} {a b : R} [CommSemiring R] {A : Type u_3} [Ring A] [Algebra R A] {f g : QuadraticAlgebra R a b →ₐ[R] A} (h : f omega = g omega) :
      f = g
      theorem QuadraticAlgebra.algHom_ext_iff {R : Type u_2} {a b : R} [CommSemiring R] {A : Type u_3} [Ring A] [Algebra R A] {f g : QuadraticAlgebra R a b →ₐ[R] A} :
      f = g f omega = g omega
      def QuadraticAlgebra.lift {R : Type u_2} {a b : R} [CommSemiring R] {A : Type u_3} [Ring A] [Algebra R A] :
      { u : A // u * u = a 1 + b u } (QuadraticAlgebra R a b →ₐ[R] A)

      The unique AlgHom from QuadraticAlgebra R a b to an R-algebra A, constructed by replacing ω with the provided root. Conversely, this associates to every algebra morphism QuadraticAlgebra R a b →ₐ[R] A a value of ω in A.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[simp]
        theorem QuadraticAlgebra.lift_apply_apply {R : Type u_2} {a b : R} [CommSemiring R] {A : Type u_3} [Ring A] [Algebra R A] (u : { u : A // u * u = a 1 + b u }) (z : QuadraticAlgebra R a b) :
        (lift u) z = z.re 1 + z.im u
        @[simp]
        theorem QuadraticAlgebra.lift_symm_apply_coe {R : Type u_2} {a b : R} [CommSemiring R] {A : Type u_3} [Ring A] [Algebra R A] (f : QuadraticAlgebra R a b →ₐ[R] A) :
        (lift.symm f) = f omega
        @[instance_reducible]
        instance QuadraticAlgebra.instStar {R : Type u_2} {a b : R} [CommRing R] :

        Conjugation in QuadraticAlgebra R a b. The conjugate of x + y ω is x + y ω' = (x + b * y) - y ω.

        Equations
        @[simp]
        theorem QuadraticAlgebra.star_mk {R : Type u_2} {a b : R} [CommRing R] (x y : R) :
        star { re := x, im := y } = { re := x + b * y, im := -y }
        @[simp]
        theorem QuadraticAlgebra.re_star {R : Type u_2} {a b : R} [CommRing R] (z : QuadraticAlgebra R a b) :
        (star z).re = z.re + b * z.im
        @[simp]
        theorem QuadraticAlgebra.im_star {R : Type u_2} {a b : R} [CommRing R] (z : QuadraticAlgebra R a b) :
        (star z).im = -z.im
        theorem QuadraticAlgebra.mul_star {R : Type u_2} {a b : R} [CommRing R] (x y : R) :
        { re := x, im := y } * star { re := x, im := y } = (algebraMap R (QuadraticAlgebra R a b)) x * (algebraMap R (QuadraticAlgebra R a b)) x + (algebraMap R (QuadraticAlgebra R a b)) b * (algebraMap R (QuadraticAlgebra R a b)) x * (algebraMap R (QuadraticAlgebra R a b)) y - (algebraMap R (QuadraticAlgebra R a b)) a * (algebraMap R (QuadraticAlgebra R a b)) y * (algebraMap R (QuadraticAlgebra R a b)) y
        @[instance_reducible]
        instance QuadraticAlgebra.instStarRing {R : Type u_2} {a b : R} [CommRing R] :
        Equations
        theorem QuadraticAlgebra.sub_star {R : Type u_2} {a b : R} [CommRing R] (z : QuadraticAlgebra R a b) :

        z - star z is a multiple of the difference ω - star ω.

        def QuadraticAlgebra.norm {R : Type u_2} {a b : R} [CommRing R] :

        the norm in a quadratic algebra, as a MonoidHom.

        Equations
        Instances For
          theorem QuadraticAlgebra.norm_def {R : Type u_2} {a b : R} [CommRing R] (z : QuadraticAlgebra R a b) :
          norm z = z.re * z.re + b * z.re * z.im - a * z.im * z.im
          @[simp]
          theorem QuadraticAlgebra.norm_zero {R : Type u_2} {a b : R} [CommRing R] :
          norm 0 = 0
          @[simp]
          theorem QuadraticAlgebra.norm_one {R : Type u_2} {a b : R} [CommRing R] :
          norm 1 = 1
          @[simp]
          theorem QuadraticAlgebra.norm_algebraMap {R : Type u_2} {a b : R} [CommRing R] (r : R) :
          norm ((algebraMap R (QuadraticAlgebra R a b)) r) = r ^ 2
          @[simp]
          theorem QuadraticAlgebra.norm_natCast {R : Type u_2} {a b : R} [CommRing R] (n : ) :
          norm n = n ^ 2
          @[simp]
          theorem QuadraticAlgebra.norm_intCast {R : Type u_2} {a b : R} [CommRing R] (n : ) :
          norm n = n ^ 2
          @[simp]
          theorem QuadraticAlgebra.norm_neg {R : Type u_2} {a b : R} [CommRing R] (x : QuadraticAlgebra R a b) :
          norm (-x) = norm x
          @[simp]
          theorem QuadraticAlgebra.norm_star {R : Type u_2} {a b : R} [CommRing R] (x : QuadraticAlgebra R a b) :
          norm (star x) = norm x

          An element of QuadraticAlgebra R a b has norm equal to 1 if and only if it is contained in the submonoid of unitary elements.

          theorem QuadraticAlgebra.norm_eq_one {R : Type u_2} {a b : R} [CommRing R] {z : QuadraticAlgebra R a b} :
          z unitary (QuadraticAlgebra R a b)norm z = 1

          Alias of the reverse direction of QuadraticAlgebra.norm_eq_one_iff_mem_unitary.


          An element of QuadraticAlgebra R a b has norm equal to 1 if and only if it is contained in the submonoid of unitary elements.

          theorem QuadraticAlgebra.mem_unitary {R : Type u_2} {a b : R} [CommRing R] {z : QuadraticAlgebra R a b} :
          norm z = 1z unitary (QuadraticAlgebra R a b)

          Alias of the forward direction of QuadraticAlgebra.norm_eq_one_iff_mem_unitary.


          An element of QuadraticAlgebra R a b has norm equal to 1 if and only if it is contained in the submonoid of unitary elements.

          The kernel of the norm map on QuadraticAlgebra R a b equals the submonoid of unitary elements.

          def QuadraticAlgebra.trace {R : Type u_2} {a b : R} [CommRing R] :

          The trace in a quadratic algebra, as an R-linear map.

          Equations
          Instances For
            theorem QuadraticAlgebra.trace_def {R : Type u_2} {a b : R} [CommRing R] (z : QuadraticAlgebra R a b) :
            trace z = 2 * z.re + b * z.im
            @[simp]
            theorem QuadraticAlgebra.trace_algebraMap {R : Type u_2} {a b : R} [CommRing R] (r : R) :
            trace ((algebraMap R (QuadraticAlgebra R a b)) r) = 2 * r
            @[simp]
            theorem QuadraticAlgebra.trace_natCast {R : Type u_2} {a b : R} [CommRing R] (n : ) :
            trace n = 2 * n
            @[simp]
            theorem QuadraticAlgebra.trace_intCast {R : Type u_2} {a b : R} [CommRing R] (n : ) :
            trace n = 2 * n
            @[simp]
            theorem QuadraticAlgebra.trace_omega {R : Type u_2} {a b : R} [CommRing R] :
            @[simp]
            theorem QuadraticAlgebra.trace_one {R : Type u_2} {a b : R} [CommRing R] :
            trace 1 = 2
            @[simp]
            theorem QuadraticAlgebra.trace_star {R : Type u_2} {a b : R} [CommRing R] (z : QuadraticAlgebra R a b) :
            theorem QuadraticAlgebra.algebraMap_trace_eq_add_star {R : Type u_2} {a b : R} [CommRing R] (z : QuadraticAlgebra R a b) :
            (algebraMap R (QuadraticAlgebra R a b)) (trace z) = z + star z

            z + star z is the trace of z.

            theorem QuadraticAlgebra.star_eq {R : Type u_2} {a b : R} [CommRing R] (z : QuadraticAlgebra R a b) :
            star z = (algebraMap R (QuadraticAlgebra R a b)) (trace z) - z

            The conjugate of z is trace z - z.

            theorem QuadraticAlgebra.sq_sub_trace_smul_add_norm_eq_zero {R : Type u_2} {a b : R} [CommRing R] (z : QuadraticAlgebra R a b) :
            z ^ 2 - trace z z + (algebraMap R (QuadraticAlgebra R a b)) (norm z) = 0

            Every element of a quadratic algebra satisfies its characteristic equation.

            theorem QuadraticAlgebra.sq_eq_trace_smul_sub_norm {R : Type u_2} {a b : R} [CommRing R] (z : QuadraticAlgebra R a b) :
            z ^ 2 = trace z z - (algebraMap R (QuadraticAlgebra R a b)) (norm z)
            def QuadraticAlgebra.changeGenerator {R : Type u_2} [CommRing R] (a b u k : R) {a' b' : R} (ha : a' = u ^ 2 * a - u * b * k - k ^ 2) (hb : b' = u * b + 2 * k) :

            The R-algebra map induced by the change of generator ω ↦ u • ω + k, see changeGenerator_omega.

            Equations
            Instances For
              @[simp]
              theorem QuadraticAlgebra.re_changeGenerator_apply {R : Type u_2} [CommRing R] (a b u k : R) {a' b' : R} (ha : a' = u ^ 2 * a - u * b * k - k ^ 2) (hb : b' = u * b + 2 * k) (z : QuadraticAlgebra R a' b') :
              ((changeGenerator a b u k ha hb) z).re = z.re + z.im * k
              @[simp]
              theorem QuadraticAlgebra.im_changeGenerator_apply {R : Type u_2} [CommRing R] (a b u k : R) {a' b' : R} (ha : a' = u ^ 2 * a - u * b * k - k ^ 2) (hb : b' = u * b + 2 * k) (z : QuadraticAlgebra R a' b') :
              ((changeGenerator a b u k ha hb) z).im = z.im * u
              @[simp]
              theorem QuadraticAlgebra.changeGenerator_omega {R : Type u_2} [CommRing R] (a b u k : R) {a' b' : R} (ha : a' = u ^ 2 * a - u * b * k - k ^ 2) (hb : b' = u * b + 2 * k) :
              (changeGenerator a b u k ha hb) omega = u omega + (algebraMap R (QuadraticAlgebra R a b)) k
              theorem QuadraticAlgebra.changeGenerator_injective {R : Type u_2} [CommRing R] (a b u k : R) {a' b' : R} (ha : a' = u ^ 2 * a - u * b * k - k ^ 2) (hb : b' = u * b + 2 * k) (hu : IsRegular u) :
              def QuadraticAlgebra.changeGeneratorEquiv {R : Type u_2} [CommRing R] (a b : R) (u : Rˣ) (k : R) {a' b' : R} (ha : a' = u ^ 2 * a - u * b * k - k ^ 2) (hb : b' = u * b + 2 * k) :

              changeGenerator along a unit u, as an isomorphism.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                @[simp]
                theorem QuadraticAlgebra.changeGeneratorEquiv_symm_apply {R : Type u_2} [CommRing R] (a b : R) (u : Rˣ) (k : R) {a' b' : R} (ha : a' = u ^ 2 * a - u * b * k - k ^ 2) (hb : b' = u * b + 2 * k) (a✝ : QuadraticAlgebra R a b) :
                (changeGeneratorEquiv a b u k ha hb).symm a✝ = (changeGenerator a' b' (↑u⁻¹) (-(u⁻¹ * k)) ) a✝
                @[simp]
                theorem QuadraticAlgebra.changeGeneratorEquiv_apply {R : Type u_2} [CommRing R] (a b : R) (u : Rˣ) (k : R) {a' b' : R} (ha : a' = u ^ 2 * a - u * b * k - k ^ 2) (hb : b' = u * b + 2 * k) (a✝ : QuadraticAlgebra R a' b') :
                (changeGeneratorEquiv a b u k ha hb) a✝ = (changeGenerator a b (↑u) k ha hb) a✝
                @[deprecated QuadraticAlgebra.changeGenerator (since := "2026-08-14")]
                def QuadraticAlgebra.map {R : Type u_2} [CommRing R] (a b u k : R) {a' b' : R} (ha : a' = u ^ 2 * a - u * b * k - k ^ 2) (hb : b' = u * b + 2 * k) :

                Alias of QuadraticAlgebra.changeGenerator.


                The R-algebra map induced by the change of generator ω ↦ u • ω + k, see changeGenerator_omega.

                Equations
                Instances For
                  @[deprecated QuadraticAlgebra.changeGenerator_omega (since := "2026-08-14")]
                  theorem QuadraticAlgebra.map_omega {R : Type u_2} [CommRing R] (a b u k : R) {a' b' : R} (ha : a' = u ^ 2 * a - u * b * k - k ^ 2) (hb : b' = u * b + 2 * k) :
                  (changeGenerator a b u k ha hb) omega = u omega + (algebraMap R (QuadraticAlgebra R a b)) k

                  Alias of QuadraticAlgebra.changeGenerator_omega.

                  @[deprecated QuadraticAlgebra.changeGenerator_injective (since := "2026-08-14")]
                  theorem QuadraticAlgebra.map_injective {R : Type u_2} [CommRing R] (a b u k : R) {a' b' : R} (ha : a' = u ^ 2 * a - u * b * k - k ^ 2) (hb : b' = u * b + 2 * k) (hu : IsRegular u) :

                  Alias of QuadraticAlgebra.changeGenerator_injective.

                  @[deprecated QuadraticAlgebra.changeGeneratorEquiv (since := "2026-08-14")]
                  def QuadraticAlgebra.mapEquiv {R : Type u_2} [CommRing R] (a b : R) (u : Rˣ) (k : R) {a' b' : R} (ha : a' = u ^ 2 * a - u * b * k - k ^ 2) (hb : b' = u * b + 2 * k) :

                  Alias of QuadraticAlgebra.changeGeneratorEquiv.


                  changeGenerator along a unit u, as an isomorphism.

                  Equations
                  Instances For
                    theorem QuadraticAlgebra.norm_eq_zero_iff_eq_zero {K : Type u_1} [Field K] {a b : K} [Hab : Fact (∀ (r : K), r ^ 2 a + b * r)] {z : QuadraticAlgebra K a b} :
                    norm z = 0 z = 0
                    @[instance_reducible]
                    instance QuadraticAlgebra.instNNRatCast {K : Type u_1} [Field K] {a b : K} :
                    Equations
                    @[simp]
                    theorem QuadraticAlgebra.im_nnratCast {K : Type u_1} [Field K] {a b : K} (q : ℚ≥0) :
                    @[simp]
                    theorem QuadraticAlgebra.re_nnratCast {K : Type u_1} [Field K] {a b : K} (q : ℚ≥0) :
                    @[instance_reducible]
                    instance QuadraticAlgebra.instRatCast {K : Type u_1} [Field K] {a b : K} :
                    Equations
                    @[simp]
                    theorem QuadraticAlgebra.im_ratCast {K : Type u_1} [Field K] {a b : K} (q : ) :
                    @[simp]
                    theorem QuadraticAlgebra.re_ratCast {K : Type u_1} [Field K] {a b : K} (q : ) :
                    @[instance_reducible]
                    instance QuadraticAlgebra.instInv {K : Type u_1} [Field K] {a b : K} :
                    Equations
                    theorem QuadraticAlgebra.inv_def {K : Type u_1} [Field K] {a b : K} (z : QuadraticAlgebra K a b) :
                    @[simp]
                    theorem QuadraticAlgebra.im_inv {K : Type u_1} [Field K] {a b : K} (z : QuadraticAlgebra K a b) :
                    z⁻¹.im = -((norm z)⁻¹ * z.im)
                    @[simp]
                    theorem QuadraticAlgebra.re_inv {K : Type u_1} [Field K] {a b : K} (z : QuadraticAlgebra K a b) :
                    z⁻¹.re = (norm z)⁻¹ * (z.re + b * z.im)
                    @[instance_reducible]
                    instance QuadraticAlgebra.instDiv {K : Type u_1} [Field K] {a b : K} :
                    Equations
                    theorem QuadraticAlgebra.div_def {K : Type u_1} [Field K] {a b : K} (w z : QuadraticAlgebra K a b) :
                    w / z = w * z⁻¹
                    @[simp]
                    theorem QuadraticAlgebra.re_div {K : Type u_1} [Field K] {a b : K} (w z : QuadraticAlgebra K a b) :
                    (w / z).re = w.re * ((norm z)⁻¹ * (z.re + b * z.im)) + -(a * w.im * ((norm z)⁻¹ * z.im))
                    @[simp]
                    theorem QuadraticAlgebra.im_div {K : Type u_1} [Field K] {a b : K} (w z : QuadraticAlgebra K a b) :
                    (w / z).im = -(w.re * ((norm z)⁻¹ * z.im)) + w.im * ((norm z)⁻¹ * (z.re + b * z.im)) + -(b * w.im * ((norm z)⁻¹ * z.im))
                    @[instance_reducible]
                    instance QuadraticAlgebra.instField {K : Type u_1} [Field K] {a b : K} [Hab : Fact (∀ (r : K), r ^ 2 a + b * r)] :

                    If K is a field and there is no r : K such that r ^ 2 = a + b * r, then QuadraticAlgebra K a b is a field.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    instance QuadraticAlgebra.instFactForallNeHPowOfNatHAddHMul {K : Type u_1} [Field K] {a : K} [Fact ¬IsSquare a] :
                    Fact (∀ (r : K), r ^ 2 a + 0 * r)

                    When b = 0, the Field instance is inferable from ¬ IsSquare a alone: it provides the no-root condition ∀ r, r ^ 2 ≠ a + 0 * r.