The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V02. Numbers

Mathlib.Data.Nat.Upto

6 declarations. Mathlib docs · Source

abbrev Nat.Upto E1 #

(ℕ → Prop) → Type

The subtype of natural numbers i which have the property that no j less than i satisfies p. This is an initial segment of the natural numbers, up to and including the first value satisfying p.

We will be particularly interested in the case where there exists a value satisfying p, because in this case the > relation is well-founded.

def Nat.Upto.GT E1 #

(p : ℕ → Prop) → Nat.Upto p → Nat.Upto p → Prop

Lift the "greater than" relation on natural numbers to Nat.Upto.

instance Nat.Upto.instLT E0 #

{p : ℕ → Prop} → LT (Nat.Upto p)

theorem Nat.Upto.wf E1 #

∀ {p : ℕ → Prop}, (∃ x, p x) → WellFounded (Nat.Upto.GT p)

The "greater than" relation on Upto p is well founded if (and only if) there exists a value satisfying p.

def Nat.Upto.zero E1 #

{p : ℕ → Prop} → Nat.Upto p

Zero is always a member of Nat.Upto p because it has no predecessors.

def Nat.Upto.succ E1 #

{p : ℕ → Prop} → (x : Nat.Upto p) → ¬p ↑x → Nat.Upto p

The successor of n is in Nat.Upto p provided that n doesn't satisfy p.