Documentation

TauCeti.Data.Nat.Pairing

Columns of the natural-number pairing function #

For Nat.pair : ℕ → ℕ → ℕ, the e-th column e.pairColumn = {n | n.unpair.2 = e} is Soare's ω^{[e]}. Distinct columns are disjoint with union Set.univ, and Nat.leastInPairColumn e b computes the least element of e.pairColumn ∩ Set.Ici b by bounded search up to Nat.pair b e.

References #

The e-th column {n | n.unpair.2 = e} of Nat.pair, consisting of all Nat.pair x e.

Instances For
    @[simp]
    theorem Nat.mem_pairColumn {e n : ℕ} :
    n ∈ e.pairColumn ↔ (unpair n).2 = e

    Membership in e.pairColumn means having second Nat.unpair coordinate e.

    @[instance_reducible]

    Membership in e.pairColumn is decidable.

    Nat.pair x e belongs to the e-th column.

    theorem Nat.pairColumn_eq_range_pair (e : ℕ) :
    e.pairColumn = Set.range fun (x : ℕ) => pair x e

    The e-th column is the range of x ↦ Nat.pair x e.

    theorem Nat.pair_zero_le_of_mem_pairColumn {e n : ℕ} (h : n ∈ e.pairColumn) :
    pair 0 e ≤ n

    Every member of e.pairColumn is at least Nat.pair 0 e.

    theorem Nat.le_of_mem_pairColumn {e n : ℕ} (h : n ∈ e.pairColumn) :
    e ≤ n

    Every member of e.pairColumn is at least e.

    Distinct columns are disjoint.

    The family of pairing columns is pairwise disjoint.

    @[simp]

    Every natural number belongs to its own second-coordinate column.

    Every pairing column is infinite.

    The least member of e.pairColumn at or above b, found by searching up to Nat.pair b e.

    Instances For
      theorem Nat.leastInPairColumn_def (e b : ℕ) :
      e.leastInPairColumn b = (List.find? (fun (x : ℕ) => decide (b ≤ x ∧ (unpair x).2 = e)) (List.range (pair b e + 1))).getD (pair b e)

      Unfolding Nat.leastInPairColumn as a bounded search over List.range (pair b e + 1).

      @[simp]

      The second Nat.unpair coordinate of e.leastInPairColumn b is e.

      theorem Nat.leastInPairColumn_le {e b n : ℕ} (hb : b ≤ n) (hn : n ∈ e.pairColumn) :

      e.leastInPairColumn b is minimal among members of e.pairColumn at or above b.

      theorem Nat.leastInPairColumn_eq_iff {e b m : ℕ} :
      e.leastInPairColumn b = m ↔ b ≤ m ∧ m ∈ e.pairColumn ∧ ∀ n < m, b ≤ n → n ∉ e.pairColumn

      Characterization of e.leastInPairColumn b as the least member of e.pairColumn above b.

      @[simp]

      The least member of e.pairColumn overall is Nat.pair 0 e.

      Raising the lower bound raises e.leastInPairColumn.

      Searching from b + 1 yields a column member strictly above b.