Documentation

MIPRE.Foundations.ValueApprox.RawInt

Integers and Gaussian integers as pairs of naturals #

Mathlib's Primrec has no arithmetic on ℤ (and no Primcodable ℤ), so the enumeration behind lem:value-lower-approx carries its integers as pairs of naturals: PInt := ℕ × ℕ denotes a - b, and GInt := PInt × PInt denotes the Gaussian integer m + n i. Equality and order are the semantic ones (PInt.Eq', PInt.Lt', GInt.Eq'), decidable and primitive recursive; PInt.toInt and GInt.toC read the values off and commute with the operations provided. Every function here is primitive recursive, with the proof next to the definition.

Integers #

@[reducible, inline]

An integer a - b, as the pair (a, b) of naturals.

Equations
Instances For

    The integer denoted.

    Equations
    Instances For
      Equations
      Instances For
        Equations
        Instances For
          Equations
          Instances For

            Semantic equality of the denoted integers.

            Equations
            Instances For

              Semantic strict order of the denoted integers.

              Equations
              Instances For
                @[instance_reducible]
                Equations
                @[instance_reducible]
                Equations
                @[simp]
                @[simp]
                @[simp]

                Gaussian integers #

                @[reducible, inline]

                A Gaussian integer m + n i, as a pair of PInts.

                Equations
                Instances For

                  The complex number denoted.

                  Equations
                  Instances For
                    Equations
                    Instances For
                      Equations
                      Instances For
                        Equations
                        Instances For

                          Semantic equality of the denoted Gaussian integers.

                          Equations
                          Instances For
                            @[instance_reducible]
                            Equations
                            @[simp]
                            @[simp]
                            @[simp]
                            @[simp]
                            theorem MIPRE.ValueApprox.GInt.toC_ofInt (m n : ℤ) :
                            (ofInt m n).toC = ↑m + ↑n * Complex.I
                            @[simp]
                            theorem MIPRE.ValueApprox.GInt.toC_add (x y : GInt) :
                            (x.add y).toC = x.toC + y.toC
                            @[simp]
                            theorem MIPRE.ValueApprox.GInt.toC_mul (x y : GInt) :
                            (x.mul y).toC = x.toC * y.toC