Analysis I, Section 2.3 #
This file is a translation of Section 2.3 of Analysis I to Lean 4. All numbering refers to the original text.
I have attempted to make the translation as faithful a paraphrasing as possible of the original text. When there is a choice between a more idiomatic Lean solution and a more faithful translation, I have generally chosen the latter. In particular, there will be places where the Lean code could be "golfed" to be more elegant and idiomatic, but I have consciously avoided doing so.
Main constructions and results of this section:
- Definition of multiplication and exponentiation for the "Chapter 2" natural numbers,
Chapter2.Nat
Note: at the end of this chapter, the Chapter2.Nat class will be deprecated in favor of the standard Mathlib class _root_.Nat, or ℕ. However, we will develop the properties of Chapter2.Nat "by hand" for pedagogical purposes.
Definition 2.3.1 (Multiplication of natural numbers)
Equations
- n.mul m = Chapter2.Nat.recurse (fun (x prod : Chapter2.Nat) => prod + m) 0 n
Instances For
Equations
- Chapter2.Nat.mul_inst = { mul := Chapter2.Nat.mul }
Definition 2.3.1 (Multiplication of natural numbers)
(Not from textbook) Nat is a commutative semiring.
Equations
- One or more equations did not get rendered due to their size.
(Not from textbook) Nat is an ordered semiring.
Definition 2.3.11 (Exponentiation for natural numbers)
Equations
- m.pow n = Chapter2.Nat.recurse (fun (x prod : Chapter2.Nat) => prod * m) 1 n
Instances For
Equations
- Chapter2.Nat.pow_inst = { pow := Chapter2.Nat.pow }
Definition 2.3.11 (Exponentiation for natural numbers)