Documentation

Analysis.Section_2_epilogue

@[reducible, inline]
abbrev Chapter2.Nat.toNat (n : Nat) :

Converting a Chapter 2 natural number to a Mathlib natural number.

Equations
Instances For
    @[reducible, inline]

    The conversion is a bijection. Here we use the existing capability (from Section 2.1) to map the Mathlib natural numbers to the Chapter 2 natural numbers.

    Equations
    Instances For
      @[reducible, inline]
      abbrev Chapter2.Nat.map_add (n m : Nat) :
      (n + m).toNat = n.toNat + m.toNat

      The conversion preserves addition.

      Equations
      • =
      Instances For
        @[reducible, inline]
        abbrev Chapter2.Nat.map_mul (n m : Nat) :
        (n * m).toNat = n.toNat * m.toNat

        The conversion preserves multiplication.

        Equations
        • =
        Instances For
          @[reducible, inline]

          The conversion preserves order.

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

              The conversion preserves exponentiation.

              structure PeanoAxioms :

              The Peano axioms for an abstract type Nat

              Instances For
                theorem PeanoAxioms.ext {x y : PeanoAxioms} (Nat : x.Nat = y.Nat) (zero : x.zero y.zero) (succ : x.succ y.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

                      One can start the proof here with unfold Function.Injective, although it is not strictly necessary.

                      One can start the proof here with unfold Function.Surjective, although it is not strictly necessary.

                      The notion of an equivalence between two structures obeying the Peano axioms. The symbol is an alias for Mathlib's Equiv class; for instance P.Nat ≃ Q.Nat is an alias for _root_.Equiv P.Nat Q.Nat.

                      Instances
                        @[reducible, inline]
                        abbrev PeanoAxioms.Equiv.symm {P Q : PeanoAxioms} (equiv : P.Equiv Q) :
                        Q.Equiv P

                        This exercise will require application of Mathlib's API for the Equiv class. Some of this API can be invoked automatically via the simp tactic.

                        Equations
                        Instances For
                          @[reducible, inline]
                          abbrev PeanoAxioms.Equiv.trans {P Q R : PeanoAxioms} (equiv1 : P.Equiv Q) (equiv2 : Q.Equiv R) :
                          P.Equiv R

                          This exercise will require application of Mathlib's API for the Equiv class. Some of this API can be invoked automatically via the simp tactic.

                          Equations
                          Instances For
                            @[reducible, inline]

                            Useful Mathlib tools for inverting bijections include Function.surjInv and Function.invFun.

                            Equations
                            Instances For
                              @[reducible, inline]
                              noncomputable abbrev PeanoAxioms.Equiv.mk' (P Q : PeanoAxioms) :
                              P.Equiv Q

                              The task here is to establish that any two structures obeying the Peano axioms are equivalent.

                              Equations
                              Instances For
                                theorem PeanoAxioms.Equiv.uniq {P Q : PeanoAxioms} (equiv1 equiv2 : P.Equiv Q) :
                                equiv1 = equiv2

                                There is only one equivalence between any two structures obeying the Peano axioms.

                                theorem PeanoAxioms.Nat.recurse_uniq {P : PeanoAxioms} (f : P.NatP.NatP.Nat) (c : P.Nat) :
                                ∃! a : P.NatP.Nat, a P.zero = c ∀ (n : P.Nat), a (P.succ n) = f n (a n)

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