Documentation

ZFLean.Naturals

ZFC Natural numbers #

This file defines the natural numbers in ZF set theory. The definition is based on the construction of the Von Neumann ordinals, where each natural number is represented as the set of all smaller natural numbers.

The set of all natural numbers is defined as the smallest inductive set. Because of the axiom of separation, the definition relies on the existence of an infinite set, which is provided by the some_inf constant. It can be shown that the choice of some_inf does not affect the definition of the natural numbers and leads to isomorphic definitions.

The file also includes the definition of the ZFNat type for ZF natural numbers, and provides various properties and usual arithmetic operations on natural numbers.

Preliminary definitions #

Natural numbers #

noncomputable def ZFSet.Nat :

The set of natural numbers Nat is defined as the smallest inductive set. This definition avoids the use of ω, even though ω may be thought of as .

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

    The type of natural numbers ZFNat is defined as the subtype of Nat.

    Equations
    Instances For
      @[implicit_reducible]
      Equations
      @[implicit_reducible]
      Equations
      theorem ZFSet.ZFNat.zero_lt_ne_zero {n : ZFNat} :
      0 < nn 0

      Any inductive set contains zero.

      theorem ZFSet.ZFNat.insert_mem_inductive {a n : ZFSet.{u_1}} (h : a.inductive_set) (h' : n a) :
      insert n n a

      Any inductive set containing an element also contains its successor.

      Nat is the least inductive set: it is contained in every inductive set, with no restriction to subsets of some_inf.

      This is the unrestricted form of inductive_subset_some_inf_contains_Nat; the extra hypothesis a ⊆ some_inf is eliminated by intersecting a with some_inf first.

      The definition of Nat is independent of the witness granted by the axiom of infinity: intersecting the inductive subsets of any inductive set T yields the same set Nat.

      In particular Nat = ⋂₀ ((powerset ω).sep inductive_set), so seeding the construction with some_inf rather than ω is a choice without observable consequence.

      The successor function succ is build from the insertion of a set into itself embedded into the ZFNat type.

      Equations
      Instances For
        @[implicit_reducible]
        Equations
        theorem ZFSet.ZFNat.succ_inj_aux {m n a : ZFSet.{u_1}} (h : insert m m = insert n n) (h' : a m) :
        a n
        theorem ZFSet.ZFNat.succ_inj_aux' {m n : ZFSet.{u_1}} (h : insert m m = insert n n) :
        m = n
        theorem ZFSet.ZFNat.succ_inj {m n : ZFNat} (h : m.succ = n.succ) :
        m = n
        theorem ZFSet.ZFNat.sep_of_ind_is_ind (P : ZFSet.{u_1}Prop) {a : ZFSet.{u_1}} (h : a.inductive_set) (h₀ : P ) (ih : na, P nP (insert n n)) :

        Any inductive set a separated by an inductive predicate P is inductive.

        Recursion on natural numbers #

        theorem ZFSet.ZFNat.succ_subrelation_mem' :
        Subrelation (fun (x y : ZFSet.{u_1}) => insert x x = y) fun (x y : ZFSet.{u_1}) => x y
        theorem ZFSet.ZFNat.mem_wf' :
        WellFounded fun (x1 x2 : ZFNat) => x1 x2
        theorem ZFSet.ZFNat.succ_subrelation_mem :
        Subrelation (fun (x1 x2 : ZFNat) => x1.succ = x2) fun (x1 x2 : ZFNat) => x1 x2

        The relation built over the successor function is a subrelation of the membership relation.

        theorem ZFSet.ZFNat.succ_wf :
        WellFounded fun (x1 x2 : ZFNat) => x1.succ = x2
        theorem ZFSet.ZFNat.ind {P : ZFSet.{u_1}Prop} (n : ZFSet.{u_1}) (h : n Nat) (zero : P ) (succ : nNat, P nP (insert n n)) :
        P n

        The induction principle for sets in Nat. This principle is meant to be used for definitional purposes only.

        theorem ZFSet.ZFNat.induction {P : ZFNatProp} (n : ZFNat) (zero : P 0) (succ : ∀ (n : ZFNat), P nP n.succ) :
        P n

        The (weak) induction principle for natural numbers.

        theorem ZFSet.ZFNat.cases {P : ZFNatProp} (n : ZFNat) (zero : P 0) (succ : ∀ (n : ZFNat), P n.succ) :
        P n
        theorem ZFSet.ZFNat.lt_trans {x y z : ZFNat} :
        x < yy < zx < z
        theorem ZFSet.ZFNat.lt_imp_ne {n m : ZFNat} :
        n < mn m
        theorem ZFSet.ZFNat.le_trans {x y z : ZFNat} :
        x yy zx z
        theorem ZFSet.ZFNat.le_antisymm {x y : ZFNat} :
        x yy xx = y
        theorem ZFSet.ZFNat.lt_le_iff {n m : ZFNat} :
        n m n < m.succ
        theorem ZFSet.ZFNat.lt_mono {x y : ZFNat} :
        x < yx.succ < y.succ
        theorem ZFSet.ZFNat.succ_lt_mono {x y : ZFNat} :
        x.succ < y.succx < y
        theorem ZFSet.ZFNat.le_mono {x y : ZFNat} :
        x yx.succ y.succ
        theorem ZFSet.ZFNat.succ_le_mono {x y : ZFNat} :
        x.succ y.succx y
        theorem ZFSet.ZFNat.le_lt_iff {n m : ZFNat} :
        n.succ m n < m
        theorem ZFSet.ZFNat.le_total {x y : ZFNat} :
        x y y x
        theorem ZFSet.ZFNat.strong_induction {P : ZFNatProp} (n : ZFNat) (ind : ∀ (n : ZFNat), (∀ m < n, P m)P n) :
        P n

        The (strong) induction principle for natural numbers.

        theorem ZFSet.ZFNat.not_zero_imp_succ {n : ZFNat} :
        n 0∃ (m : ZFNat), n = m.succ

        The predecessor function on natural numbers, defined directly as the union of a set.

        Equations
        Instances For
          theorem ZFSet.ZFNat.pred_eq (n : ZFNat) :
          n.pred = (↑n).sUnion,
          @[simp]
          @[simp]
          @[simp]
          @[simp]
          theorem ZFSet.ZFNat.succ_pred {n : ZFNat} (h : n 0) :
          n.pred.succ = n
          noncomputable def ZFSet.ZFNat.rec' {motive : ZFSet.{u_1}Sort u} (n : ZFSet.{u_1}) (h : n Nat) (zero : motive ) (succ : (x : ZFSet.{u_1}) → x Natmotive xmotive (insert x x)) :
          motive n

          The recursion principle for sets in Nat. This principle is meant to be used for definitional purposes only.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            theorem ZFSet.ZFNat.rec'_zero {motive : ZFSet.{u_1}Sort u} (zero : motive ) (succ : (x : ZFSet.{u_1}) → x Natmotive xmotive (insert x x)) :
            rec' zero_in_Nat zero succ = zero

            Provides the base case of the recursion principle for sets in Nat.

            theorem ZFSet.ZFNat.rec'_succ {motive : ZFSet.{u_1}Sort u} (n : ZFSet.{u_1}) (n_Nat : n Nat) (zero : motive ) (succ : (x : ZFSet.{u_1}) → x Natmotive xmotive (insert x x)) :
            rec' (insert n n) zero succ = succ n n_Nat (rec' n n_Nat zero succ)

            Provides the inductive step of the recursion principle for sets in Nat.

            noncomputable def ZFSet.ZFNat.rec {motive : ZFNatSort u} (n : ZFNat) (zero : motive 0) (succ : (x : ZFNat) → motive xmotive x.succ) :
            motive n

            The recursion principle for natural numbers. This recursor allows inductive definitions over natural numbers to be defined in a more natural way.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              @[simp]
              theorem ZFSet.ZFNat.induction_is_rec_into_Prop {motive : ZFNatProp} :
              =

              The induction principle of ZFNat is a universe-specialized version of the recursion principle.

              theorem ZFSet.ZFNat.rec_zero {motive : ZFNatSort u} (zero : motive 0) (succ : (x : ZFNat) → motive xmotive x.succ) :
              rec 0 zero succ = zero
              theorem ZFSet.ZFNat.rec_succ {motive : ZFNatSort u} (n : ZFNat) (zero : motive 0) (succ' : (x : ZFNat) → motive xmotive x.succ) :
              rec n.succ zero succ' = succ' n (rec n zero succ')
              theorem ZFSet.ZFNat.rec_unique {motive : ZFNatSort u} (zero : motive 0) (succ' : (x : ZFNat) → motive xmotive x.succ) (f : (x : ZFNat) → motive x) (h₀ : f 0 = zero) (hs : ∀ (x : ZFNat), f x.succ = succ' x (f x)) (n : ZFNat) :
              f n = rec n zero succ'

              Uniqueness half of the universal property of ZFNat: ZFNat.rec is the only family satisfying the two computation rules rec_zero and rec_succ.

              Together with rec_zero/rec_succ this says that (ZFNat, 0, succ) is initial among sets equipped with a point and an endomorphism.

              @[reducible, inline]
              noncomputable abbrev ZFSet.ZFNat.pred' (m : ZFNat) :

              The predecessor function pred' on natural numbers, defined inductively. This definition is equivalent to pred, as proven by pred'_eq_pred.

              Equations
              Instances For

                The definitions of pred and pred' are equivalent.

                Arithmetic #

                theorem ZFSet.ZFNat.pos_of_ne_zero {n : ZFNat} :
                0 n0 < n
                @[implicit_reducible]
                Equations
                @[implicit_reducible]
                Equations
                • One or more equations did not get rendered due to their size.
                @[reducible, inline]
                noncomputable abbrev ZFSet.ZFNat.add (n : ZFNat) (m : ZFNat) :

                The addition function on natural numbers, defined inductively.

                Equations
                Instances For
                  @[implicit_reducible]
                  noncomputable instance ZFSet.ZFNat.add_inst :
                  Equations
                  theorem ZFSet.ZFNat.add_inst_eq {n m : ZFNat} :
                  n + m = n.add m
                  @[simp]
                  theorem ZFSet.ZFNat.add_zero {n : ZFNat} :
                  n + 0 = n
                  @[simp]
                  theorem ZFSet.ZFNat.zero_add {n : ZFNat} :
                  0 + n = n
                  theorem ZFSet.ZFNat.add_succ {n m : ZFNat} :
                  n.succ + m = (n + m).succ
                  theorem ZFSet.ZFNat.succ_add {n m : ZFNat} :
                  (n + m).succ = n + m.succ
                  theorem ZFSet.ZFNat.add_comm (n m : ZFNat) :
                  n + m = m + n
                  @[simp]
                  theorem ZFSet.ZFNat.add_assoc (n m k : ZFNat) :
                  n + (m + k) = n + m + k
                  theorem ZFSet.ZFNat.add_left_comm (n m k : ZFNat) :
                  n + (m + k) = m + (n + k)
                  theorem ZFSet.ZFNat.add_right_comm (n m k : ZFNat) :
                  n + m + k = n + k + m
                  theorem ZFSet.ZFNat.add_left_cancel {n m k : ZFNat} :
                  n + m = n + k m = k
                  theorem ZFSet.ZFNat.add_right_cancel {n m k : ZFNat} :
                  n + m = k + m n = k
                  theorem ZFSet.ZFNat.eq_zero_of_add_eq_zero {n m : ZFNat} :
                  n + m = 0n = 0 m = 0
                  theorem ZFSet.ZFNat.eq_zero_of_add_eq_zero_left {n m : ZFNat} (h : n + m = 0) :
                  m = 0
                  @[simp]
                  theorem ZFSet.ZFNat.add_left_eq_self {a b : ZFNat} :
                  a + b = b a = 0
                  @[simp]
                  theorem ZFSet.ZFNat.add_right_eq_self {a b : ZFNat} :
                  a + b = a b = 0
                  @[simp]
                  theorem ZFSet.ZFNat.self_eq_add_right {a b : ZFNat} :
                  a = a + b b = 0
                  @[simp]
                  theorem ZFSet.ZFNat.self_eq_add_left {a b : ZFNat} :
                  a = b + a b = 0
                  theorem ZFSet.ZFNat.lt_of_succ_le {n m : ZFNat} (h : n.succ m) :
                  n < m
                  theorem ZFSet.ZFNat.succ_le_of_lt {n m : ZFNat} (h : n < m) :
                  n.succ m
                  theorem ZFSet.ZFNat.le.dest {n m : ZFNat} :
                  n m∃ (k : ZFNat), n + k = m
                  theorem ZFSet.ZFNat.le_succ_of_le {n m : ZFNat} (h : n m) :
                  n m.succ
                  @[simp]
                  theorem ZFSet.ZFNat.le_add_right (n k : ZFNat) :
                  n n + k
                  @[simp]
                  theorem ZFSet.ZFNat.le_add_left (n m : ZFNat) :
                  n m + n
                  theorem ZFSet.ZFNat.le.intro {n m k : ZFNat} (h : n + k = m) :
                  n m
                  theorem ZFSet.ZFNat.le_of_add_le_add_left {a b c : ZFNat} (h : a + b a + c) :
                  b c
                  theorem ZFSet.ZFNat.add_le_add_left {n m : ZFNat} (h : n m) (k : ZFNat) :
                  k + n k + m
                  @[simp]
                  theorem ZFSet.ZFNat.add_le_add_iff_left {n m k : ZFNat} :
                  n + m n + k m k
                  theorem ZFSet.ZFNat.lt_of_add_lt_add_right {n m k : ZFNat} :
                  k + n < m + nk < m
                  theorem ZFSet.ZFNat.add_lt_add_left {n m : ZFNat} (h : n < m) (k : ZFNat) :
                  k + n < k + m
                  theorem ZFSet.ZFNat.add_lt_add_right {n m : ZFNat} (h : n < m) (k : ZFNat) :
                  n + k < m + k
                  theorem ZFSet.ZFNat.lt_add_of_pos_right {n k : ZFNat} (h : 0 < k) :
                  n < n + k
                  theorem ZFSet.ZFNat.lt_of_add_lt_add_left {n m k : ZFNat} :
                  n + k < n + mk < m
                  @[simp]
                  theorem ZFSet.ZFNat.add_lt_add_iff_left {k n m : ZFNat} :
                  k + n < k + m n < m
                  @[simp]
                  theorem ZFSet.ZFNat.add_lt_add_iff_right {k n m : ZFNat} :
                  n + k < m + k n < m
                  theorem ZFSet.ZFNat.add_le_add_right {n m : ZFNat} (h : n m) (k : ZFNat) :
                  n + k m + k
                  theorem ZFSet.ZFNat.add_lt_add_of_le_of_lt {a b c d : ZFNat} (hle : a b) (hlt : c < d) :
                  a + c < b + d
                  theorem ZFSet.ZFNat.add_lt_add_of_lt_of_le {a b c d : ZFNat} (hlt : a < b) (hle : c d) :
                  a + c < b + d
                  theorem ZFSet.ZFNat.lt_add_of_pos_left {k n : ZFNat} :
                  0 < kn < k + n
                  theorem ZFSet.ZFNat.pos_of_lt_add_right {n k : ZFNat} (h : n < n + k) :
                  0 < k
                  theorem ZFSet.ZFNat.pos_of_lt_add_left {n k : ZFNat} :
                  n < k + n0 < k
                  @[simp]
                  theorem ZFSet.ZFNat.lt_add_right_iff_pos {n k : ZFNat} :
                  n < n + k 0 < k
                  @[simp]
                  theorem ZFSet.ZFNat.lt_add_left_iff_pos {n k : ZFNat} :
                  n < k + n 0 < k
                  theorem ZFSet.ZFNat.add_pos_left {m : ZFNat} (h : 0 < m) (n : ZFNat) :
                  0 < m + n
                  theorem ZFSet.ZFNat.add_pos_right {n : ZFNat} (m : ZFNat) (h : 0 < n) :
                  0 < m + n
                  theorem ZFSet.ZFNat.pred_le_pred {n m : ZFNat} :
                  n mn.pred m.pred
                  theorem ZFSet.ZFNat.lt_of_succ_lt_succ {n m : ZFNat} :
                  n.succ < m.succn < m
                  @[reducible, inline]
                  noncomputable abbrev ZFSet.ZFNat.sub (n : ZFNat) (m : ZFNat) :
                  Equations
                  Instances For
                    @[implicit_reducible]
                    noncomputable instance ZFSet.ZFNat.sub_inst :
                    Equations
                    theorem ZFSet.ZFNat.sub_inst_eq {n m : ZFNat} :
                    n - m = n.sub m
                    @[simp]
                    theorem ZFSet.ZFNat.sub_zero {n : ZFNat} :
                    n - 0 = n
                    theorem ZFSet.ZFNat.succ_mono {n m : ZFNat} :
                    n < m n.succ < m.succ
                    theorem ZFSet.ZFNat.sub_succ (n m : ZFNat) :
                    n - m.succ = (n - m).pred
                    @[simp]
                    theorem ZFSet.ZFNat.zero_sub {n : ZFNat} :
                    0 - n = 0
                    theorem ZFSet.ZFNat.sub_self {n : ZFNat} :
                    n - n = 0
                    theorem ZFSet.ZFNat.sub_add_distrib {n m k : ZFNat} :
                    n - (m + k) = n - m - k
                    theorem ZFSet.ZFNat.sub_ne_zero_of_lt {a b : ZFNat} :
                    a < bb - a 0
                    theorem ZFSet.ZFNat.le_of_succ_le {n m : ZFNat} :
                    n.succ mn m
                    theorem ZFSet.ZFNat.lt_of_succ_lt {n m : ZFNat} (h : n.succ < m) :
                    n < m
                    theorem ZFSet.ZFNat.le_of_lt {n m : ZFNat} :
                    n < mn m
                    theorem ZFSet.ZFNat.add_sub_of_le {a b : ZFNat} (h : a b) :
                    a + (b - a) = b
                    theorem ZFSet.ZFNat.sub_one_cancel {a b : ZFNat} :
                    0 < a0 < ba - 1 = b - 1a = b
                    @[simp]
                    theorem ZFSet.ZFNat.sub_add_cancel {n m : ZFNat} (h : m n) :
                    n - m + m = n
                    theorem ZFSet.ZFNat.add_sub_add_right (n k m : ZFNat) :
                    n + k - (m + k) = n - m
                    theorem ZFSet.ZFNat.add_sub_add_left (k n m : ZFNat) :
                    k + n - (k + m) = n - m
                    @[simp]
                    theorem ZFSet.ZFNat.add_sub_cancel (n m : ZFNat) :
                    n + m - m = n
                    theorem ZFSet.ZFNat.add_sub_assoc {m k : ZFNat} (h : k m) (n : ZFNat) :
                    n + m - k = n + (m - k)
                    theorem ZFSet.ZFNat.eq_add_of_sub_eq {a b c : ZFNat} (hle : b a) (h : a - b = c) :
                    a = c + b
                    theorem ZFSet.ZFNat.sub_eq_of_eq_add {a b c : ZFNat} (h : a = c + b) :
                    a - b = c
                    theorem ZFSet.ZFNat.add_eq_add_sub_eq_sub {a b c d : ZFNat} :
                    a + b = c + da - c = d - b
                    theorem ZFSet.ZFNat.sub_factor {m k n : ZFNat} :
                    k mm nn - m + k = n - (m - k)
                    theorem ZFSet.ZFNat.sub_add_comm {m n k : ZFNat} (h : m n) :
                    n - m + k = n + k - m
                    theorem ZFSet.ZFNat.succ_le_succ {n m : ZFNat} :
                    n mn.succ m.succ
                    theorem ZFSet.ZFNat.le_zero_imp_eq {n : ZFNat} :
                    n 0n = 0
                    @[reducible, inline]
                    noncomputable abbrev ZFSet.ZFNat.mul (n : ZFNat) (m : ZFNat) :

                    The multiplication function on natural numbers, defined inductively.

                    Equations
                    Instances For
                      @[implicit_reducible]
                      noncomputable instance ZFSet.ZFNat.mul_inst :
                      Equations
                      theorem ZFSet.ZFNat.mul_inst_eq {n m : ZFNat} :
                      n * m = n.mul m
                      @[simp]
                      theorem ZFSet.ZFNat.mul_zero {n : ZFNat} :
                      n * 0 = 0
                      @[simp]
                      theorem ZFSet.ZFNat.zero_mul {n : ZFNat} :
                      0 * n = 0
                      @[simp]
                      theorem ZFSet.ZFNat.mul_one {n : ZFNat} :
                      n * 1 = n
                      @[simp]
                      theorem ZFSet.ZFNat.one_mul {n : ZFNat} :
                      1 * n = n
                      theorem ZFSet.ZFNat.mul_succ {n m : ZFNat} :
                      (n + 1) * m = n * m + m
                      theorem ZFSet.ZFNat.succ_mul {n m : ZFNat} :
                      n.succ * m = n * m + m
                      theorem ZFSet.ZFNat.left_distrib {n m k : ZFNat} :
                      n * (m + k) = n * m + n * k
                      theorem ZFSet.ZFNat.mul_comm (n m : ZFNat) :
                      n * m = m * n
                      theorem ZFSet.ZFNat.succ_mul' {n m : ZFNat} :
                      m * n.succ = m * n + m
                      theorem ZFSet.ZFNat.right_distrib {n m k : ZFNat} :
                      (n + m) * k = n * k + m * k
                      theorem ZFSet.ZFNat.mul_assoc (n m k : ZFNat) :
                      n * m * k = n * (m * k)
                      theorem ZFSet.ZFNat.mul_left_comm (n m k : ZFNat) :
                      n * (m * k) = m * (n * k)
                      theorem ZFSet.ZFNat.two_mul (n : ZFNat) :
                      (1 + 1) * n = n + n
                      theorem ZFSet.ZFNat.mul_two (n : ZFNat) :
                      n * (1 + 1) = n + n
                      theorem ZFSet.ZFNat.sub_lt_eq_zero {n m : ZFNat} (h : n m) :
                      n - m = 0
                      theorem ZFSet.ZFNat.add_lt_trans {n m p q : ZFNat} :
                      n < mp < qn + p < m + q
                      theorem ZFSet.ZFNat.pos_mul_pos {k n : ZFNat} (h : 0 < k) :
                      0 < k * n0 < n
                      theorem ZFSet.ZFNat.mul_lt_mono {n m k : ZFNat} (h : 0 < k) :
                      n < mk * n < k * m
                      theorem ZFSet.ZFNat.mul_le_mono {k m n : ZFNat} :
                      n mk * n k * m
                      theorem ZFSet.ZFNat.mul_lt_cancel {k m n : ZFNat} :
                      k * n < k * mn < m
                      theorem ZFSet.ZFNat.lt_mul_iff {n m k : ZFNat} :
                      n < m (k + 1) * n < (k + 1) * m
                      theorem ZFSet.ZFNat.left_distrib_mul_sub_one {n m : ZFNat} :
                      n * (m - 1) = n * m - n
                      theorem ZFSet.ZFNat.left_distrib_mul_sub_aux {n m k : ZFNat} (h : k < m) :
                      n * (m - k) = n * m - n * k
                      theorem ZFSet.ZFNat.sub_eq_zero_mul {n a b : ZFNat} :
                      a - b = 0n * a - n * b = 0
                      theorem ZFSet.ZFNat.left_distrib_mul_sub {n m k : ZFNat} :
                      n * (m - k) = n * m - n * k
                      theorem ZFSet.ZFNat.right_distrib_mul_sub {n m k : ZFNat} :
                      (m - k) * n = m * n - k * n
                      theorem ZFSet.ZFNat.add_eq_zero_iff {n m : ZFNat} :
                      n + m = 0 n = 0 m = 0
                      theorem ZFSet.ZFNat.mul_eq_zero_iff {n m : ZFNat} :
                      n * m = 0 n = 0 m = 0
                      theorem ZFSet.ZFNat.eq_le_le_iff {n m : ZFNat} :
                      n = m n m m n
                      theorem ZFSet.ZFNat.mul_left_cancel_iff {n m k : ZFNat} (k_pos : k 0) :
                      k * m = k * n m = n
                      theorem ZFSet.ZFNat.mul_right_cancel_iff {n m k : ZFNat} (k_pos : k 0) :
                      m * k = n * k m = n
                      @[reducible, inline]
                      noncomputable abbrev ZFSet.ZFNat.pow (n : ZFNat) (p : ZFNat) :

                      The power function on natural numbers, defined inductively.

                      Equations
                      Instances For
                        @[implicit_reducible]
                        noncomputable instance ZFSet.ZFNat.pow_inst :
                        Equations
                        theorem ZFSet.ZFNat.pow_inst_eq {n p : ZFNat} :
                        n ^ p = n.pow p
                        theorem ZFSet.ZFNat.pow_zero {n : ZFNat} :
                        n ^ 0 = 1
                        theorem ZFSet.ZFNat.pow_one {n : ZFNat} :
                        n ^ 1 = n
                        theorem ZFSet.ZFNat.pow_succ {n p : ZFNat} :
                        n ^ p.succ = n ^ p * n
                        theorem ZFSet.ZFNat.induction' {P : ZFNatProp} (n : ZFNat) (zero : P 0) (succ : ∀ (n : ZFNat), P nP (n + 1)) :
                        P n

                        Induction principle for ZFNat, using natural notations.

                        Declared as an induction eliminator.

                        @[reducible, inline]
                        Equations
                        Instances For
                          @[implicit_reducible]
                          noncomputable instance ZFSet.ZFNat.instSemiring :
                          Equations
                          • One or more equations did not get rendered due to their size.
                          @[implicit_reducible]
                          Equations
                          noncomputable def ZFSet.ZFNat.toNat (n : ZFNat) :
                          Equations
                          Instances For
                            noncomputable def ZFSet.ZFNat.ofNat (n : ) :
                            Equations
                            Instances For
                              theorem ZFSet.ZFNat.toNat_is_id {n : } :
                              (↑n).toNat = n

                              Nat is an inductive set.

                              theorem ZFSet.ZFNat.ofNat_inj {n m : } :
                              n = m n = m
                              theorem ZFSet.ZFNat.toNat_eq (n : ZFNat) :
                              n.toNat = n

                              Transfer to #

                              equivZFNat_Nat says that ZFNat and are the same type. Upgraded to a ring isomorphism and registered as a TransferEquiv, it lets the transfer tactic read a goal about ZFNat in :

                              example (n m : ZFNat) : n + m = m + n := by
                                transfer ZFNat → ℕ =>
                                  rw [Nat.add_comm]
                              

                              The block is proved in , and closing it closes the goal about ZFNat. The ring operations, the numerals and the casts travel through the generic map_… lemmas of the transfer_simps simp set; what those lemmas do not cover is stated here: succ, the truncated subtraction, the homogeneous power, and the two order relations.

                              theorem ZFSet.ZFNat.toNat_add (a b : ZFNat) :
                              (a + b).toNat = a.toNat + b.toNat
                              theorem ZFSet.ZFNat.toNat_mul (a b : ZFNat) :
                              (a * b).toNat = a.toNat * b.toNat
                              theorem ZFSet.ZFNat.toNat_sub (a b : ZFNat) :
                              (a - b).toNat = a.toNat - b.toNat
                              theorem ZFSet.ZFNat.toNat_pow (a b : ZFNat) :
                              (a ^ b).toNat = a.toNat ^ b.toNat
                              theorem ZFSet.ZFNat.toNat_lt (a b : ZFNat) :
                              a < b a.toNat < b.toNat

                              equivZFNat_Nat as a ring isomorphism.

                              Equations
                              Instances For
                                @[implicit_reducible]

                                Equivalence used by the transfer tactic to move goals between ZFNat and .

                                Equations