Documentation

Mathlib.Init.Data.Nat.Lemmas

Note about Mathlib/Init/ #

The files in Mathlib/Init are leftovers from the port from Mathlib3. (They contain content moved from lean3 itself that Mathlib needed but was not moved to lean4.)

We intend to move all the content of these files out into the main Mathlib directory structure. Contributions assisting with this are appreciated.

#align statements without corresponding declarations (i.e. because the declaration is in Batteries or Lean) can be left here. These will be deleted soon so will not significantly delay deleting otherwise empty Init files.

addition

multiplication

theorem Nat.eq_zero_of_mul_eq_zero {n : } {m : } :
n * m = 0n = 0 m = 0

properties of inequality

def Nat.ltGeByCases {a : } {b : } {C : Sort u} (h₁ : a < bC) (h₂ : b aC) :
C
Equations
Instances For
    def Nat.ltByCases {a : } {b : } {C : Sort u} (h₁ : a < bC) (h₂ : a = bC) (h₃ : b < aC) :
    C
    Equations
    Instances For

      bit0/bit1 properties

      successor and predecessor

      def Nat.discriminate {B : Sort u} {n : } (H1 : n = 0B) (H2 : (m : ) → n = m.succB) :
      B
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        subtraction

        Many lemmas are proven more generally in mathlib algebra/order/sub

        min

        induction principles

        def Nat.twoStepInduction {P : Sort u} (H1 : P 0) (H2 : P 1) (H3 : (n : ) → P nP n.succP n.succ.succ) (a : ) :
        P a
        Equations
        Instances For
          def Nat.subInduction {P : Sort u} (H1 : (m : ) → P 0 m) (H2 : (n : ) → P n.succ 0) (H3 : (n m : ) → P n mP n.succ m.succ) (n : ) (m : ) :
          P n m
          Equations
          Instances For
            theorem Nat.strong_induction_on {p : Prop} (n : ) (h : ∀ (n : ), (∀ (m : ), m < np m)p n) :
            p n
            theorem Nat.case_strong_induction_on {p : Prop} (a : ) (hz : p 0) (hi : ∀ (n : ), (∀ (m : ), m np m)p n.succ) :
            p a

            mod

            theorem Nat.cond_decide_mod_two (x : ) [d : Decidable (x % 2 = 1)] :
            (bif decide (x % 2 = 1) then 1 else 0) = x % 2

            div

            dvd