Documentation

LeanPool.ZFLean.Rationals

ZFC Rational Numbers #

This file defines the rational numbers in ZFC, based on the integers and using the ZFInt type.

@[reducible, inline]
abbrev ZFSet.ZFInt' :
Type (u_1 + 1)

Imported ZFLean declaration.

Equations
Instances For
    @[reducible, inline]
    abbrev ZFSet.qrel (p q : ZFInt × ZFInt') :

    The equivalence relation on ℤ × ℤ⋆ that defines the rational numbers.

    Equations
    Instances For
      @[implicit_reducible]

      ℤ × ℤ⋆ equipped with qrel is a setoid.

      Equations
      @[reducible, inline]
      abbrev ZFSet.ZFRat :
      Type (u_1 + 1)

      is defined as ℤ × ℤ⋆ quotiented by qrel

      Equations
      Instances For

        Imported ZFLean declaration.

        Equations
        Instances For
          @[simp]
          @[simp]
          theorem ZFSet.ZFRat.sound {x y : ZFInt × ZFInt'} (h : ZFSet.qrel x y) :
          mk x = mk y
          theorem ZFSet.ZFRat.exact {x y : ZFInt × ZFInt'} :
          mk x = mk yZFSet.qrel x y
          @[reducible, inline]

          Imported ZFLean declaration.

          Equations
          Instances For
            @[reducible, inline]

            Imported ZFLean declaration.

            Equations
            Instances For
              @[implicit_reducible]
              Equations
              @[implicit_reducible]
              Equations
              @[implicit_reducible]
              Equations
              theorem ZFSet.ZFRat.mk_eq_zero_iff {n : ZFInt} {m : ZFInt'} :
              mk (n, m) = 0 n = 0
              theorem ZFSet.ZFRat.mk_eq_one_iff {n : ZFInt} {m : ZFInt'} :
              mk (n, m) = 1 n = m
              @[reducible, inline]
              noncomputable abbrev ZFSet.ZFRat.add (n m : ZFRat) :

              Imported ZFLean declaration.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                @[implicit_reducible]
                noncomputable instance ZFSet.ZFRat.instAdd :
                Equations
                theorem ZFSet.ZFRat.add_eq (n m : ZFInt × ZFInt') :
                mk n + mk m = mk (n.1 * m.2 + n.2 * m.1, n.2 * m.2, )
                theorem ZFSet.ZFRat.add_assoc (n m k : ZFRat) :
                n + (m + k) = n + m + k
                theorem ZFSet.ZFRat.add_comm (n m : ZFRat) :
                n + m = m + n
                theorem ZFSet.ZFRat.add_left_comm (n m k : ZFRat) :
                n + (m + k) = m + (n + k)
                theorem ZFSet.ZFRat.add_right_comm (n m k : ZFRat) :
                n + m + k = n + k + m
                theorem ZFSet.ZFRat.add_zero {x : ZFRat} :
                x + 0 = x
                theorem ZFSet.ZFRat.zero_add {x : ZFRat} :
                0 + x = x
                @[reducible, inline]

                Imported ZFLean declaration.

                Equations
                Instances For
                  @[implicit_reducible]
                  Equations
                  theorem ZFSet.ZFRat.neg_neg (n : ZFRat) :
                  - -n = n
                  theorem ZFSet.ZFRat.neg_inj {a b : ZFRat} :
                  -a = -b a = b
                  theorem ZFSet.ZFRat.neg_eq_zero {a : ZFRat} :
                  -a = 0 a = 0
                  theorem ZFSet.ZFRat.neg_eq_of_add_eq_zero {a b : ZFRat} (h : a + b = 0) :
                  -a = b
                  theorem ZFSet.ZFRat.eq_neg_of_eq_neg {a b : ZFRat} (h : a = -b) :
                  b = -a
                  theorem ZFSet.ZFRat.eq_neg_comm {a b : ZFRat} :
                  a = -b b = -a
                  theorem ZFSet.ZFRat.neg_eq_comm {a b : ZFRat} :
                  -a = b -b = a
                  theorem ZFSet.ZFRat.neg_add_cancel_left (a b : ZFRat) :
                  -a + (a + b) = b
                  theorem ZFSet.ZFRat.add_neg_cancel_left (a b : ZFRat) :
                  a + (-a + b) = b
                  theorem ZFSet.ZFRat.add_left_cancel {a b c : ZFRat} (h : a + b = a + c) :
                  b = c
                  theorem ZFSet.ZFRat.neg_add {a b : ZFRat} :
                  -(a + b) = -a + -b
                  @[reducible, inline]
                  noncomputable abbrev ZFSet.ZFRat.sub (n m : ZFRat) :

                  Rational subtraction in the ZF rational model.

                  Equations
                  Instances For
                    @[implicit_reducible]
                    noncomputable instance ZFSet.ZFRat.instSub :

                    Imported ZFLean declaration.

                    Equations
                    theorem ZFSet.ZFRat.sub_eq (n m : ZFInt × ZFInt') :
                    mk n - mk m = mk (n.1 * m.2 - m.1 * n.2, n.2 * m.2, )
                    theorem ZFSet.ZFRat.sub_eq_add_neg {a b : ZFRat} :
                    a - b = a + -b
                    theorem ZFSet.ZFRat.add_neg_one (i : ZFRat) :
                    i + -1 = i - 1
                    theorem ZFSet.ZFRat.sub_self (a : ZFRat) :
                    a - a = 0
                    theorem ZFSet.ZFRat.sub_zero (a : ZFRat) :
                    a - 0 = a
                    theorem ZFSet.ZFRat.zero_sub (a : ZFRat) :
                    0 - a = -a
                    theorem ZFSet.ZFRat.sub_eq_zero_of_eq {a b : ZFRat} (h : a = b) :
                    a - b = 0
                    theorem ZFSet.ZFRat.eq_of_sub_eq_zero {a b : ZFRat} (h : a - b = 0) :
                    a = b
                    theorem ZFSet.ZFRat.sub_eq_zero {a b : ZFRat} :
                    a - b = 0 a = b
                    theorem ZFSet.ZFRat.sub_sub (a b c : ZFRat) :
                    a - b - c = a - (b + c)
                    theorem ZFSet.ZFRat.neg_sub (a b : ZFRat) :
                    -(a - b) = b - a
                    theorem ZFSet.ZFRat.sub_sub_self (a b : ZFRat) :
                    a - (a - b) = b
                    theorem ZFSet.ZFRat.sub_neg (a b : ZFRat) :
                    a - -b = a + b
                    theorem ZFSet.ZFRat.sub_add_cancel (a b : ZFRat) :
                    a - b + b = a
                    theorem ZFSet.ZFRat.add_sub_cancel (a b : ZFRat) :
                    a + b - b = a
                    theorem ZFSet.ZFRat.add_sub_assoc (a b c : ZFRat) :
                    a + b - c = a + (b - c)
                    theorem ZFSet.ZFRat.sub_left_cancel (a b c : ZFRat) :
                    a - c = b - ca = b
                    theorem ZFSet.ZFRat.sub_right_cancel (a b c : ZFRat) :
                    c - a = c - ba = b
                    theorem ZFSet.ZFRat.add_eq_sub_iff {a b c : ZFRat} :
                    a + b = c a = c - b
                    @[reducible, inline]
                    noncomputable abbrev ZFSet.ZFRat.mul (n m : ZFRat) :

                    Imported ZFLean declaration.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      @[implicit_reducible]
                      noncomputable instance ZFSet.ZFRat.instMul :
                      Equations
                      theorem ZFSet.ZFRat.mul_eq (n m : ZFInt × ZFInt') :
                      mk n * mk m = mk (n.1 * m.1, n.2 * m.2, )
                      theorem ZFSet.ZFRat.mul_comm (n m : ZFRat) :
                      n * m = m * n
                      theorem ZFSet.ZFRat.left_distrib (a b c : ZFRat) :
                      a * (b + c) = a * b + a * c
                      theorem ZFSet.ZFRat.right_distrib (a b c : ZFRat) :
                      (a + b) * c = a * c + b * c
                      theorem ZFSet.ZFRat.zero_mul (a : ZFRat) :
                      0 * a = 0
                      theorem ZFSet.ZFRat.mul_zero (a : ZFRat) :
                      a * 0 = 0
                      theorem ZFSet.ZFRat.mul_assoc (a b c : ZFRat) :
                      a * b * c = a * (b * c)
                      theorem ZFSet.ZFRat.one_mul (a : ZFRat) :
                      1 * a = a
                      theorem ZFSet.ZFRat.mul_one (a : ZFRat) :
                      a * 1 = a
                      theorem ZFSet.ZFRat.mul_eq_zero_iff {a b : ZFRat} :
                      a * b = 0 a = 0 b = 0
                      @[implicit_reducible]
                      noncomputable instance ZFSet.ZFRat.instCommRing :
                      Equations
                      • One or more equations did not get rendered due to their size.
                      @[reducible, inline]
                      abbrev ZFSet.ZFRat.ZFRat' :
                      Type (u_1 + 1)

                      The subtype of nonzero ZF rational numbers.

                      Equations
                      Instances For
                        @[reducible, inline]
                        noncomputable abbrev ZFSet.ZFRat.inv :

                        Imported ZFLean declaration.

                        Equations
                        Instances For
                          @[implicit_reducible]
                          noncomputable instance ZFSet.ZFRat.instInvZFRat' :
                          Equations
                          @[implicit_reducible]
                          noncomputable instance ZFSet.ZFRat.instInv :
                          Equations
                          theorem ZFSet.ZFRat.inv_eq {a : ZFRat} (ha : a 0) :
                          @[reducible, inline]
                          noncomputable abbrev ZFSet.ZFRat.hdiv (n : ZFRat) (m : ZFRat') :

                          Division by a nonzero ZF rational.

                          Equations
                          Instances For
                            @[reducible, inline]
                            noncomputable abbrev ZFSet.ZFRat.div (n m : ZFRat) :

                            Division on ZF rational numbers, with division by zero sent to zero.

                            Equations
                            Instances For
                              @[implicit_reducible]

                              Imported ZFLean declaration.

                              Equations
                              @[implicit_reducible]
                              noncomputable instance ZFSet.ZFRat.instDiv :

                              Imported ZFLean declaration.

                              Equations
                              theorem ZFSet.ZFRat.div_eq {n m : ZFRat} (hm : m 0) :
                              n / m = n / m, hm
                              theorem ZFSet.ZFRat.div_eq_mul_inv {n m : ZFRat} (hm : m 0) :
                              n / m = n * m, hm⁻¹
                              @[simp]
                              theorem ZFSet.ZFRat.mul_inv' {a : ZFRat'} :
                              a * a⁻¹ = 1
                              theorem ZFSet.ZFRat.mul_inv {a : ZFRat} (ha : a 0) :
                              a * a⁻¹ = 1
                              theorem ZFSet.ZFRat.inv_mul' {a : ZFRat'} :
                              a⁻¹ * a = 1
                              theorem ZFSet.ZFRat.inv_mul {a : ZFRat} (ha : a 0) :
                              a⁻¹ * a = 1
                              @[implicit_reducible]
                              noncomputable instance ZFSet.ZFRat.instRatCast :
                              Equations
                              @[implicit_reducible]
                              Equations
                              • One or more equations did not get rendered due to their size.
                              @[implicit_reducible]
                              noncomputable instance ZFSet.ZFRat.instField :
                              Equations
                              • One or more equations did not get rendered due to their size.