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.Hyperoperation

16 declarations. Mathlib docs · Source

Hyperoperation sequence

This file defines the Hyperoperation sequence. hyperoperation 0 m k = k + 1 hyperoperation 1 m k = m + k hyperoperation 2 m k = m * k hyperoperation 3 m k = m ^ k hyperoperation (n + 3) m 0 = 1 hyperoperation (n + 1) m (k + 1) = hyperoperation n m (hyperoperation (n + 1) m k)

References

Tags

hyperoperation

theorem hyperoperation.match_1.congr_eq_2 E1 #

∀ (motive : ℕ → ℕ → ℕ → Sort u_1) (x x_1 x_2 : ℕ) (h_1 : (x k : ℕ) → motive 0 x k) (h_2 : (m : ℕ) → motive 1 m 0)
  (h_3 : (x : ℕ) → motive 2 x 0) (h_4 : (n x : ℕ) → motive n.succ.succ.succ x 0)
  (h_5 : (n m k : ℕ) → motive n.succ m k.succ) (m : ℕ),
  x = 1 →
    x_1 = m →
      x_2 = 0 →
        (match x, x_1, x_2 with
          | 0, x, k => h_1 x k
          | 1, m, 0 => h_2 m
          | 2, x, 0 => h_3 x
          | n.succ.succ.succ, x, 0 => h_4 n x
          | n.succ, m, k.succ => h_5 n m k) ≍
          h_2 m

theorem hyperoperation.match_1.congr_eq_3 E1 #

∀ (motive : ℕ → ℕ → ℕ → Sort u_1) (x x_1 x_2 : ℕ) (h_1 : (x k : ℕ) → motive 0 x k) (h_2 : (m : ℕ) → motive 1 m 0)
  (h_3 : (x : ℕ) → motive 2 x 0) (h_4 : (n x : ℕ) → motive n.succ.succ.succ x 0)
  (h_5 : (n m k : ℕ) → motive n.succ m k.succ) (x_3 : ℕ),
  x = 2 →
    x_1 = x_3 →
      x_2 = 0 →
        (match x, x_1, x_2 with
          | 0, x, k => h_1 x k
          | 1, m, 0 => h_2 m
          | 2, x, 0 => h_3 x
          | n.succ.succ.succ, x, 0 => h_4 n x
          | n.succ, m, k.succ => h_5 n m k) ≍
          h_3 x_3

theorem hyperoperation.match_1.congr_eq_5 E1 #

∀ (motive : ℕ → ℕ → ℕ → Sort u_1) (x x_1 x_2 : ℕ) (h_1 : (x k : ℕ) → motive 0 x k) (h_2 : (m : ℕ) → motive 1 m 0)
  (h_3 : (x : ℕ) → motive 2 x 0) (h_4 : (n x : ℕ) → motive n.succ.succ.succ x 0)
  (h_5 : (n m k : ℕ) → motive n.succ m k.succ) (n m k : ℕ),
  x = n.succ →
    x_1 = m →
      x_2 = k.succ →
        (match x, x_1, x_2 with
          | 0, x, k => h_1 x k
          | 1, m, 0 => h_2 m
          | 2, x, 0 => h_3 x
          | n.succ.succ.succ, x, 0 => h_4 n x
          | n.succ, m, k.succ => h_5 n m k) ≍
          h_5 n m k

theorem hyperoperation.match_1.congr_eq_1 E1 #

∀ (motive : ℕ → ℕ → ℕ → Sort u_1) (x x_1 x_2 : ℕ) (h_1 : (x k : ℕ) → motive 0 x k) (h_2 : (m : ℕ) → motive 1 m 0)
  (h_3 : (x : ℕ) → motive 2 x 0) (h_4 : (n x : ℕ) → motive n.succ.succ.succ x 0)
  (h_5 : (n m k : ℕ) → motive n.succ m k.succ) (x_3 k : ℕ),
  x = 0 →
    x_1 = x_3 →
      x_2 = k →
        (match x, x_1, x_2 with
          | 0, x, k => h_1 x k
          | 1, m, 0 => h_2 m
          | 2, x, 0 => h_3 x
          | n.succ.succ.succ, x, 0 => h_4 n x
          | n.succ, m, k.succ => h_5 n m k) ≍
          h_1 x_3 k

theorem hyperoperation.match_1.congr_eq_4 E1 #

∀ (motive : ℕ → ℕ → ℕ → Sort u_1) (x x_1 x_2 : ℕ) (h_1 : (x k : ℕ) → motive 0 x k) (h_2 : (m : ℕ) → motive 1 m 0)
  (h_3 : (x : ℕ) → motive 2 x 0) (h_4 : (n x : ℕ) → motive n.succ.succ.succ x 0)
  (h_5 : (n m k : ℕ) → motive n.succ m k.succ) (n x_3 : ℕ),
  x = n.succ.succ.succ →
    x_1 = x_3 →
      x_2 = 0 →
        (match x, x_1, x_2 with
          | 0, x, k => h_1 x k
          | 1, m, 0 => h_2 m
          | 2, x, 0 => h_3 x
          | n.succ.succ.succ, x, 0 => h_4 n x
          | n.succ, m, k.succ => h_5 n m k) ≍
          h_4 n x_3

def hyperoperation E1 #

ℕ → ℕ → ℕ → ℕ

Implementation of the hyperoperation sequence where hyperoperation n m k is the nth hyperoperation between m and k.

theorem hyperoperation_zero E0 #

∀ (m k : ℕ), hyperoperation 0 m k = k + 1

theorem hyperoperation_ge_three_eq_one E1 #

∀ (n m : ℕ), hyperoperation (n + 3) m 0 = 1

theorem hyperoperation_recursion E1 #

∀ (n m k : ℕ), hyperoperation (n + 1) m (k + 1) = hyperoperation n m (hyperoperation (n + 1) m k)

theorem hyperoperation_one E0 #

∀ (m k : ℕ), hyperoperation 1 m k = m + k

theorem hyperoperation_two E0 #

∀ (m k : ℕ), hyperoperation 2 m k = m * k

theorem hyperoperation_three E0 #

∀ (m k : ℕ), hyperoperation 3 m k = m ^ k

theorem hyperoperation_ge_two_eq_self E1 #

∀ (n m : ℕ), hyperoperation (n + 2) m 1 = m

theorem hyperoperation_two_two_eq_four E1 #

∀ (n : ℕ), hyperoperation (n + 1) 2 2 = 4

theorem hyperoperation_ge_three_one E1 #

∀ (n k : ℕ), hyperoperation (n + 3) 1 k = 1

theorem hyperoperation_ge_four_zero E1 #

∀ (n k : ℕ), hyperoperation (n + 4) 0 k = if Even k then 1 else 0