Documentation

BSeries.Algebra.Qsqrt2

A computable model of ℚ(√2) #

The quadratic field ℚ(√2) as pairs (a, b) ↔ a + b√2, with fully computable field operations and decidable equality, so that order conditions of Runge–Kutta schemes with √2 in their coefficients (the EES(2,7;x) family of arXiv:2507.21006, Section 8) can be machine-checked by native_decide.

structure BSeries.Qsqrt2 :

The quadratic field ℚ(√2) as pairs (a, b) ↔ a + b√2.

Instances For
    theorem BSeries.Qsqrt2.ext {x y : Qsqrt2} (a : x.a = y.a) (b : x.b = y.b) :
    x = y
    theorem BSeries.Qsqrt2.ext_iff {x y : Qsqrt2} :
    x = y x.a = y.a x.b = y.b
    def BSeries.instDecidableEqQsqrt2.decEq (x✝ x✝¹ : Qsqrt2) :
    Decidable (x✝ = x✝¹)
    Equations
    Instances For
      @[implicit_reducible]
      Equations
      @[implicit_reducible]
      Equations
      @[implicit_reducible]
      Equations
      @[implicit_reducible]
      Equations
      @[implicit_reducible]
      Equations
      @[implicit_reducible]
      Equations
      @[simp]
      @[simp]
      @[simp]
      theorem BSeries.Qsqrt2.one_a :
      a 1 = 1
      @[simp]
      theorem BSeries.Qsqrt2.one_b :
      b 1 = 0
      @[simp]
      theorem BSeries.Qsqrt2.add_a (x y : Qsqrt2) :
      (x + y).a = x.a + y.a
      @[simp]
      theorem BSeries.Qsqrt2.add_b (x y : Qsqrt2) :
      (x + y).b = x.b + y.b
      @[simp]
      theorem BSeries.Qsqrt2.neg_a (x : Qsqrt2) :
      (-x).a = -x.a
      @[simp]
      theorem BSeries.Qsqrt2.neg_b (x : Qsqrt2) :
      (-x).b = -x.b
      @[simp]
      theorem BSeries.Qsqrt2.mul_a (x y : Qsqrt2) :
      (x * y).a = x.a * y.a + 2 * x.b * y.b
      @[simp]
      theorem BSeries.Qsqrt2.mul_b (x y : Qsqrt2) :
      (x * y).b = x.a * y.b + x.b * y.a
      @[simp]
      theorem BSeries.Qsqrt2.inv_a (x : Qsqrt2) :
      x⁻¹.a = x.a / (x.a ^ 2 - 2 * x.b ^ 2)
      @[simp]
      theorem BSeries.Qsqrt2.inv_b (x : Qsqrt2) :
      x⁻¹.b = -x.b / (x.a ^ 2 - 2 * x.b ^ 2)
      theorem BSeries.Qsqrt2.sq_ne_two (q : ) :
      q ^ 2 2

      No rational square root of two.

      theorem BSeries.Qsqrt2.norm_ne_zero {x : Qsqrt2} (hx : x 0) :
      x.a ^ 2 - 2 * x.b ^ 2 0

      The field norm a² - 2b² vanishes only at zero.

      @[implicit_reducible]
      Equations
      • One or more equations did not get rendered due to their size.
      theorem BSeries.Qsqrt2.natCast_def (n : ) :
      n = { a := n, b := 0 }

      The square root of two.

      Equations
      Instances For