Documentation

Analysis.Section_2_epilogue

Analysis I, Chapter 2 epilogue #

In this (technical) epilogue, we show that the "Chapter 2" natural numbers Chapter2.Nat are isomorphic in various standard senses to the standard natural numbers .

From this point onwards, Chapter2.Nat will be deprecated, and we will use the standard natural numbers instead. In particular, one should use the full Mathlib API for for all subsequent chapters, in lieu of the Chapter2.Nat API.

Filling the sorries here requires both the Chapter2.Nat API and the Mathlib API for the standard natural numbers . As such, they are excellent exercises to prepare you for the aforementioned transition.

In second half of this section we also give a fully axiomatic treatment of the natural numbers via the Peano axioms. The treatment in the preceding three sections was only partially axiomatic, because we used a specific construction Chapter2.Nat of the natural numbers that was an inductive type, and used that inductive type to construct a recursor. Here, we give some exercises to show how one can accomplish the same tasks directly from the Peano axioms, without knowing the specific implementation of the natural numbers.

@[reducible, inline]
abbrev Chapter2.Nat.toNat (n : Nat) :
Equations
Instances For
    @[reducible, inline]
    Equations
    Instances For
      @[reducible, inline]
      Equations
      Instances For
        theorem Chapter2.Nat.pow_eq_pow (n m : Nat) :
        n.toNat ^ m.toNat = n ^ m
        class PeanoAxioms :

        The Peano axioms for an abstract type Nat

        Instances
          theorem PeanoAxioms.ext {x y : PeanoAxioms} (Nat : Nat = Nat) (zero : HEq zero zero) (succ : HEq succ succ) :
          x = y

          The Chapter 2 natural numbers obey the Peano axioms.

          Equations
          Instances For

            The Mathlib natural numbers obey the Peano axioms.

            Equations
            Instances For
              @[reducible, inline]

              One can map the Mathlib natural numbers into any other structure obeying the Peano axioms.

              Equations
              Instances For

                The notion of an equivalence between two structures obeying the Peano axioms

                Instances
                  @[reducible, inline]
                  abbrev PeanoAxioms.Equiv.symm {P Q : PeanoAxioms} (equiv : P.Equiv Q) :
                  Q.Equiv P
                  Equations
                  Instances For
                    @[reducible, inline]
                    abbrev PeanoAxioms.Equiv.trans {P Q R : PeanoAxioms} (equiv1 : P.Equiv Q) (equiv2 : Q.Equiv R) :
                    P.Equiv R
                    Equations
                    Instances For
                      @[reducible, inline]
                      Equations
                      Instances For
                        @[reducible, inline]
                        Equations
                        Instances For
                          theorem PeanoAxioms.Equiv.uniq {P Q : PeanoAxioms} (equiv1 equiv2 : P.Equiv Q) :
                          equiv1 = equiv2
                          theorem PeanoAxioms.Nat.recurse_uniq {P : PeanoAxioms} (f : NatNatNat) (c : Nat) :
                          ∃! a : NatNat, a zero = c ∀ (n : Nat), a (succ n) = f n (a n)

                          A sample result: recursion is well-defined on any structure obeying the Peano axioms