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 / V32. Logic, model theory and computability

Mathlib.Computability.Primrec.List

107 declarations. Mathlib docs · Source

Primitive recursive functions on Lists

The primitive recursive functions are defined in Mathlib.Computability.Primrec.Basic. This file contains definitions and theorems about primitive recursive functions that relate to operation on lists.

References

  • [Mario Carneiro, Formalizing computability theory via partial recursive functions][carneiro2019]

ctor Nat.Primrec'.below.get E0 #

∀ {motive : {n : ℕ} → (a : List.Vector ℕ n → ℕ) → Nat.Primrec' a → Prop} {n : ℕ} (i : Fin n), Nat.Primrec'.below ⋯

ctor Nat.Primrec'.below.comp E0 #

∀ {motive : {n : ℕ} → (a : List.Vector ℕ n → ℕ) → Nat.Primrec' a → Prop} {m n : ℕ} {f : List.Vector ℕ n → ℕ}
  (g : Fin n → List.Vector ℕ m → ℕ) (a : Nat.Primrec' f) (a_1 : ∀ (i : Fin n), Nat.Primrec' (g i)),
  Nat.Primrec'.below a →
    motive f a → (∀ (i : Fin n), Nat.Primrec'.below ⋯) → (∀ (i : Fin n), motive (g i) ⋯) → Nat.Primrec'.below ⋯

ctor Nat.Primrec'.below.prec E0 #

∀ {motive : {n : ℕ} → (a : List.Vector ℕ n → ℕ) → Nat.Primrec' a → Prop} {n : ℕ} {f : List.Vector ℕ n → ℕ}
  {g : List.Vector ℕ (n + 2) → ℕ} (a : Nat.Primrec' f) (a_1 : Nat.Primrec' g),
  Nat.Primrec'.below a → motive f a → Nat.Primrec'.below a_1 → motive g a_1 → Nat.Primrec'.below ⋯

ctor Nat.Primrec'.below.zero E0 #

∀ {motive : {n : ℕ} → (a : List.Vector ℕ n → ℕ) → Nat.Primrec' a → Prop}, Nat.Primrec'.below Nat.Primrec'.zero

ctor Nat.Primrec'.below.succ E0 #

∀ {motive : {n : ℕ} → (a : List.Vector ℕ n → ℕ) → Nat.Primrec' a → Prop}, Nat.Primrec'.below Nat.Primrec'.succ

instance Primcodable.list E0 #

{α : Type u_1} → [Primcodable α] → Primcodable (List α)

theorem Primrec.list_cons E1 #

∀ {α : Type u_1} [inst : Primcodable α], Primrec₂ List.cons

theorem Primrec.list_casesOn E1 #

∀ {α : Type u_1} {β : Type u_2} {σ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable σ]
  {f : α → List β} {g : α → σ} {h : α → β × List β → σ},
  Primrec f → Primrec g → Primrec₂ h → Primrec fun a ↦ List.casesOn (f a) (g a) fun b l ↦ h a (b, l)

theorem Primrec.list_foldl E1 #

∀ {α : Type u_1} {β : Type u_2} {σ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable σ]
  {f : α → List β} {g : α → σ} {h : α → σ × β → σ},
  Primrec f → Primrec g → Primrec₂ h → Primrec fun a ↦ List.foldl (fun s b ↦ h a (s, b)) (g a) (f a)

theorem Primrec.list_reverse E1 #

∀ {α : Type u_1} [inst : Primcodable α], Primrec List.reverse

theorem Primrec.list_foldr E1 #

∀ {α : Type u_1} {β : Type u_2} {σ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable σ]
  {f : α → List β} {g : α → σ} {h : α → β × σ → σ},
  Primrec f → Primrec g → Primrec₂ h → Primrec fun a ↦ List.foldr (fun b s ↦ h a (b, s)) (g a) (f a)

theorem Primrec.list_head? E1 #

∀ {α : Type u_1} [inst : Primcodable α], Primrec List.head?

theorem Primrec.list_headI E1 #

∀ {α : Type u_1} [inst : Primcodable α] [inst_1 : Inhabited α], Primrec List.headI

theorem Primrec.list_tail E1 #

∀ {α : Type u_1} [inst : Primcodable α], Primrec List.tail

theorem Primrec.list_rec E1 #

∀ {α : Type u_1} {β : Type u_2} {σ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable σ]
  {f : α → List β} {g : α → σ} {h : α → β × List β × σ → σ},
  Primrec f → Primrec g → Primrec₂ h → Primrec fun a ↦ List.recOn (f a) (g a) fun b l IH ↦ h a (b, l, IH)

theorem Primrec.list_getElem? E1 #

∀ {α : Type u_1} [inst : Primcodable α], Primrec₂ fun x1 x2 ↦ x1[x2]?

theorem Primrec.list_getD E1 #

∀ {α : Type u_1} [inst : Primcodable α] (d : α), Primrec₂ fun l n ↦ l.getD n d

theorem Primrec.list_getI E1 #

∀ {α : Type u_1} [inst : Primcodable α] [inst_1 : Inhabited α], Primrec₂ List.getI

theorem Primrec.list_append E1 #

∀ {α : Type u_1} [inst : Primcodable α], Primrec₂ fun x1 x2 ↦ x1 ++ x2

theorem Primrec.list_concat E1 #

∀ {α : Type u_1} [inst : Primcodable α], Primrec₂ fun l a ↦ l ++ [a]

theorem Primrec.list_map E1 #

∀ {α : Type u_1} {β : Type u_2} {σ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable σ]
  {f : α → List β} {g : α → β → σ}, Primrec f → Primrec₂ g → Primrec fun a ↦ List.map (g a) (f a)

theorem Primrec.list_range E1 #

Primrec List.range

theorem Primrec.list_flatten E1 #

∀ {α : Type u_1} [inst : Primcodable α], Primrec List.flatten

theorem Primrec.list_flatMap E1 #

∀ {α : Type u_1} {β : Type u_2} {σ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable σ]
  {f : α → List β} {g : α → β → List σ}, Primrec f → Primrec₂ g → Primrec fun a ↦ List.flatMap (g a) (f a)

theorem Primrec.optionToList E1 #

∀ {α : Type u_1} [inst : Primcodable α], Primrec Option.toList

theorem Primrec.listFilterMap E1 #

∀ {α : Type u_1} {β : Type u_2} {σ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable σ]
  {f : α → List β} {g : α → β → Option σ}, Primrec f → Primrec₂ g → Primrec fun a ↦ List.filterMap (g a) (f a)

theorem Primrec.list_length E1 #

∀ {α : Type u_1} [inst : Primcodable α], Primrec List.length

theorem Primrec.listFilter E1 #

∀ {α : Type u_1} [inst : Primcodable α] {p : α → Prop} [inst_1 : DecidablePred p],
  PrimrecPred p → Primrec fun L ↦ List.filter (fun x ↦ decide (p x)) L

Filtering a list for elements that satisfy a decidable predicate is primitive recursive.

theorem Primrec.list_findIdx E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {f : α → List β} {p : α → β → Bool},
  Primrec f → Primrec₂ p → Primrec fun a ↦ List.findIdx (p a) (f a)

theorem Primrec.list_all E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {f : α → List β} {p : α → β → Bool},
  Primrec f → Primrec₂ p → Primrec fun a ↦ (f a).all (p a)

List.all of a primitive recursive predicate is primitive recursive.

theorem Primrec.list_any E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {f : α → List β} {p : α → β → Bool},
  Primrec f → Primrec₂ p → Primrec fun a ↦ (f a).any (p a)

List.any of a primitive recursive predicate is primitive recursive.

theorem Primrec.list_sum E1 #

∀ {α : Type u_1} [inst : Primcodable α] {f : α → List ℕ}, Primrec f → Primrec fun a ↦ (f a).sum

theorem Primrec.list_idxOf E1 #

∀ {α : Type u_1} [inst : Primcodable α] [inst_1 : DecidableEq α], Primrec₂ List.idxOf

theorem Primrec.nat_strong_rec E1 #

∀ {α : Type u_1} {σ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable σ] (f : α → ℕ → σ)
  {g : α → List σ → Option σ},
  Primrec₂ g → (∀ (a : α) (n : ℕ), g a (List.map (f a) (List.range n)) = some (f a n)) → Primrec₂ f

theorem Primrec.listLookup E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : DecidableEq α],
  Primrec₂ List.lookup

theorem Primrec.nat_omega_rec' E1 #

∀ {β : Type u_2} {σ : Type u_3} [inst : Primcodable β] [inst_1 : Primcodable σ] (f : β → σ) {m : β → ℕ} {l : β → List β}
  {g : β → List σ → Option σ},
  Primrec m →
    Primrec l →
      Primrec₂ g → (∀ (b b' : β), b' ∈ l b → m b' < m b) → (∀ (b : β), g b (List.map f (l b)) = some (f b)) → Primrec f

theorem Primrec.nat_omega_rec E1 #

∀ {α : Type u_1} {β : Type u_2} {σ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable β] [inst_2 : Primcodable σ]
  (f : α → β → σ) {m : α → β → ℕ} {l : α → β → List β} {g : α → β × List σ → Option σ},
  Primrec₂ m →
    Primrec₂ l →
      Primrec₂ g →
        (∀ (a : α) (b b' : β), b' ∈ l a b → m a b' < m a b) →
          (∀ (a : α) (b : β), g a (b, List.map (f a) (l a b)) = some (f a b)) → Primrec₂ f

theorem Primrec.list_drop E1 #

∀ {α : Type u_1} [inst : Primcodable α], Primrec₂ List.drop

List.drop is primitive recursive.

theorem Primrec.list_take E1 #

∀ {α : Type u_1} [inst : Primcodable α], Primrec₂ List.take

List.take is primitive recursive.

theorem Primrec.list_takeWhile E1 #

∀ {α : Type u_1} [inst : Primcodable α] {p : α → Bool}, Primrec p → Primrec (List.takeWhile p)

List.takeWhile is primitive recursive.

theorem Primrec.list_dropWhile E1 #

∀ {α : Type u_1} [inst : Primcodable α] {p : α → Bool}, Primrec p → Primrec (List.dropWhile p)

List.dropWhile is primitive recursive.

theorem Primrec.list_modifyHead' E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {g : β → α → α},
  Primrec₂ g → Primrec₂ fun l b ↦ List.modifyHead (g b) l

List.modifyHead with a function depending on external data is primitive recursive.

theorem Primrec.list_modifyHead E1 #

∀ {α : Type u_1} [inst : Primcodable α] {f : α → α}, Primrec f → Primrec (List.modifyHead f)

List.modifyHead by a primitive recursive function is primitive recursive.

theorem Primrec.list_modify' E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {g : β → α → α},
  Primrec₂ g → Primrec₂ fun l p ↦ l.modify p.1 (g p.2)

List.modify with a function depending on external data is primitive recursive.

theorem Primrec.list_modify E1 #

∀ {α : Type u_1} [inst : Primcodable α] {f : α → α}, Primrec f → Primrec₂ fun l n ↦ l.modify n f

List.modify by a primitive recursive function is primitive recursive.

theorem Primrec.list_set E1 #

∀ {α : Type u_1} [inst : Primcodable α], Primrec₂ fun l p ↦ l.set p.1 p.2

List.set is primitive recursive.

theorem PrimrecPred.exists_mem_list E1 #

∀ {α : Type u_1} {p : α → Prop} [inst : Primcodable α], PrimrecPred p → PrimrecPred fun L ↦ ∃ a ∈ L, p a

Checking if any element of a list satisfies a decidable predicate is primitive recursive.

theorem PrimrecPred.forall_mem_list E1 #

∀ {α : Type u_1} {p : α → Prop} [inst : Primcodable α], PrimrecPred p → PrimrecPred fun L ↦ ∀ a ∈ L, p a

Checking if every element of a list satisfies a decidable predicate is primitive recursive.

theorem PrimrecPred.exists_lt E1 #

∀ {p : ℕ → Prop}, PrimrecPred p → PrimrecPred fun n ↦ ∃ x < n, p x

Bounded existential quantifiers are primitive recursive.

theorem PrimrecPred.forall_lt E1 #

∀ {p : ℕ → Prop}, PrimrecPred p → PrimrecPred fun n ↦ ∀ x < n, p x

Bounded universal quantifiers are primitive recursive.

theorem PrimrecPred.listFilter_listRange E1 #

∀ {R : ℕ → ℕ → Prop} (s : ℕ) [inst : DecidableRel R],
  PrimrecRel R → Primrec fun n ↦ List.filter (fun y ↦ decide (R y n)) (List.range s)

A helper lemma for proofs about bounded quantifiers on decidable relations.

theorem PrimrecRel.listFilter E1 #

∀ {α : Type u_1} {β : Type u_2} {R : α → β → Prop} [inst : Primcodable α] [inst_1 : Primcodable β],
  PrimrecRel R → ∀ [inst_2 : DecidableRel R], Primrec₂ fun L b ↦ List.filter (fun a ↦ decide (R a b)) L

If R a b is decidable, then given L : List α and b : β, it is primitive recursive to filter L for elements a with R a b

theorem PrimrecRel.exists_mem_list E1 #

∀ {α : Type u_1} {β : Type u_2} {R : α → β → Prop} [inst : Primcodable α] [inst_1 : Primcodable β],
  PrimrecRel R → PrimrecRel fun L b ↦ ∃ a ∈ L, R a b

If R a b is decidable, then given L : List α and b : β, g L b ↔ ∃ a L, R a b is a primitive recursive relation.

theorem PrimrecRel.forall_mem_list E1 #

∀ {α : Type u_1} {β : Type u_2} {R : α → β → Prop} [inst : Primcodable α] [inst_1 : Primcodable β],
  PrimrecRel R → PrimrecRel fun L b ↦ ∀ a ∈ L, R a b

If R a b is decidable, then given L : List α and b : β, g L b ↔ ∀ a L, R a b is a primitive recursive relation.

theorem PrimrecRel.exists_lt E1 #

∀ {R : ℕ → ℕ → Prop}, PrimrecRel R → PrimrecRel fun n y ↦ ∃ x < n, R x y

If R a b is decidable, then for any fixed n and y, g n y ↔ ∃ x < n, R x y is a primitive recursive relation.

theorem PrimrecRel.forall_lt E1 #

∀ {R : ℕ → ℕ → Prop}, PrimrecRel R → PrimrecRel fun n y ↦ ∀ x < n, R x y

If R a b is decidable, then for any fixed n and y, g n y ↔ ∀ x < n, R x y is a primitive recursive relation.

instance Primcodable.vector E0 #

{α : Type u_1} → [Primcodable α] → {n : ℕ} → Primcodable (List.Vector α n)

instance Primcodable.finArrow E0 #

{α : Type u_1} → [Primcodable α] → {n : ℕ} → Primcodable (Fin n → α)

theorem Primrec.vector_toList E1 #

∀ {α : Type u_1} [inst : Primcodable α] {n : ℕ}, Primrec List.Vector.toList

theorem Primrec.vector_toList_iff E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : Primcodable α] [inst_1 : Primcodable β] {n : ℕ} {f : α → List.Vector β n},
  (Primrec fun a ↦ (f a).toList) ↔ Primrec f

theorem Primrec.vector_cons E1 #

∀ {α : Type u_1} [inst : Primcodable α] {n : ℕ}, Primrec₂ List.Vector.cons

theorem Primrec.vector_length E1 #

∀ {α : Type u_1} [inst : Primcodable α] {n : ℕ}, Primrec List.Vector.length

theorem Primrec.vector_head E1 #

∀ {α : Type u_1} [inst : Primcodable α] {n : ℕ}, Primrec List.Vector.head

theorem Primrec.vector_tail E1 #

∀ {α : Type u_1} [inst : Primcodable α] {n : ℕ}, Primrec List.Vector.tail

theorem Primrec.vector_get E1 #

∀ {α : Type u_1} [inst : Primcodable α] {n : ℕ}, Primrec₂ List.Vector.get

theorem Primrec.list_ofFn E1 #

∀ {α : Type u_1} {σ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable σ] {n : ℕ} {f : Fin n → α → σ},
  (∀ (i : Fin n), Primrec (f i)) → Primrec fun a ↦ List.ofFn fun i ↦ f i a

theorem Primrec.vector_ofFn E1 #

∀ {α : Type u_1} {σ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable σ] {n : ℕ} {f : Fin n → α → σ},
  (∀ (i : Fin n), Primrec (f i)) → Primrec fun a ↦ List.Vector.ofFn fun i ↦ f i a

theorem Primrec.vector_get' E1 #

∀ {α : Type u_1} [inst : Primcodable α] {n : ℕ}, Primrec List.Vector.get

theorem Primrec.vector_ofFn' E1 #

∀ {α : Type u_1} [inst : Primcodable α] {n : ℕ}, Primrec List.Vector.ofFn

theorem Primrec.fin_app E1 #

∀ {σ : Type u_3} [inst : Primcodable σ] {n : ℕ}, Primrec₂ id

theorem Primrec.fin_curry₁ E1 #

∀ {α : Type u_1} {σ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable σ] {n : ℕ} {f : Fin n → α → σ},
  Primrec₂ f ↔ ∀ (i : Fin n), Primrec (f i)

theorem Primrec.fin_curry E1 #

∀ {α : Type u_1} {σ : Type u_3} [inst : Primcodable α] [inst_1 : Primcodable σ] {n : ℕ} {f : α → Fin n → σ},
  Primrec f ↔ Primrec₂ f

inductive Nat.Primrec' E1 #

{n : ℕ} → (List.Vector ℕ n → ℕ) → Prop

An alternative inductive definition of Primrec which does not use the pairing function on ℕ, and so has to work with n-ary functions on ℕ instead of unary functions. We prove that this is equivalent to the regular notion in to_prim and of_prim.

ctor Nat.Primrec'.zero E0 #

Nat.Primrec' fun x ↦ 0

ctor Nat.Primrec'.succ E0 #

Nat.Primrec' fun v ↦ v.head.succ

ctor Nat.Primrec'.get E0 #

∀ {n : ℕ} (i : Fin n), Nat.Primrec' fun v ↦ v.get i

ctor Nat.Primrec'.comp E0 #

∀ {m n : ℕ} {f : List.Vector ℕ n → ℕ} (g : Fin n → List.Vector ℕ m → ℕ),
  Nat.Primrec' f → (∀ (i : Fin n), Nat.Primrec' (g i)) → Nat.Primrec' fun a ↦ f (List.Vector.ofFn fun i ↦ g i a)

ctor Nat.Primrec'.prec E0 #

∀ {n : ℕ} {f : List.Vector ℕ n → ℕ} {g : List.Vector ℕ (n + 2) → ℕ},
  Nat.Primrec' f → Nat.Primrec' g → Nat.Primrec' fun v ↦ Nat.rec (f v.tail) (fun y IH ↦ g (y ::ᵥ IH ::ᵥ v.tail)) v.head

theorem Nat.Primrec'.to_prim E1 #

∀ {n : ℕ} {f : List.Vector ℕ n → ℕ}, Nat.Primrec' f → Primrec f

theorem Nat.Primrec'.of_eq E0 #

∀ {n : ℕ} {f g : List.Vector ℕ n → ℕ}, Nat.Primrec' f → (∀ (i : List.Vector ℕ n), f i = g i) → Nat.Primrec' g

theorem Nat.Primrec'.const E1 #

∀ {n : ℕ} (m : ℕ), Nat.Primrec' fun x ↦ m

theorem Nat.Primrec'.head E1 #

∀ {n : ℕ}, Nat.Primrec' List.Vector.head

theorem Nat.Primrec'.tail E1 #

∀ {n : ℕ} {f : List.Vector ℕ n → ℕ}, Nat.Primrec' f → Nat.Primrec' fun v ↦ f v.tail

def Nat.Primrec'.Vec E1 #

{n m : ℕ} → (List.Vector ℕ n → List.Vector ℕ m) → Prop

A function from vectors to vectors is primitive recursive when all of its projections are.

theorem Nat.Primrec'.nil E1 #

∀ {n : ℕ}, Nat.Primrec'.Vec fun x ↦ List.Vector.nil

theorem Nat.Primrec'.cons E1 #

∀ {n m : ℕ} {f : List.Vector ℕ n → ℕ} {g : List.Vector ℕ n → List.Vector ℕ m},
  Nat.Primrec' f → Nat.Primrec'.Vec g → Nat.Primrec'.Vec fun v ↦ f v ::ᵥ g v

theorem Nat.Primrec'.idv E1 #

∀ {n : ℕ}, Nat.Primrec'.Vec id

theorem Nat.Primrec'.comp' E1 #

∀ {n m : ℕ} {f : List.Vector ℕ m → ℕ} {g : List.Vector ℕ n → List.Vector ℕ m},
  Nat.Primrec' f → Nat.Primrec'.Vec g → Nat.Primrec' fun v ↦ f (g v)

theorem Nat.Primrec'.comp₁ E1 #

∀ (f : ℕ → ℕ),
  (Nat.Primrec' fun v ↦ f v.head) → ∀ {n : ℕ} {g : List.Vector ℕ n → ℕ}, Nat.Primrec' g → Nat.Primrec' fun v ↦ f (g v)

theorem Nat.Primrec'.comp₂ E1 #

∀ (f : ℕ → ℕ → ℕ),
  (Nat.Primrec' fun v ↦ f v.head v.tail.head) →
    ∀ {n : ℕ} {g h : List.Vector ℕ n → ℕ}, Nat.Primrec' g → Nat.Primrec' h → Nat.Primrec' fun v ↦ f (g v) (h v)

theorem Nat.Primrec'.prec' E1 #

∀ {n : ℕ} {f g : List.Vector ℕ n → ℕ} {h : List.Vector ℕ (n + 2) → ℕ},
  Nat.Primrec' f →
    Nat.Primrec' g → Nat.Primrec' h → Nat.Primrec' fun v ↦ Nat.rec (g v) (fun y IH ↦ h (y ::ᵥ IH ::ᵥ v)) (f v)

theorem Nat.Primrec'.pred E1 #

Nat.Primrec' fun v ↦ v.head.pred

theorem Nat.Primrec'.add E1 #

Nat.Primrec' fun v ↦ v.head + v.tail.head

theorem Nat.Primrec'.sub E1 #

Nat.Primrec' fun v ↦ v.head - v.tail.head

theorem Nat.Primrec'.mul E1 #

Nat.Primrec' fun v ↦ v.head * v.tail.head

theorem Nat.Primrec'.if_lt E1 #

∀ {n : ℕ} {a b f g : List.Vector ℕ n → ℕ},
  Nat.Primrec' a →
    Nat.Primrec' b → Nat.Primrec' f → Nat.Primrec' g → Nat.Primrec' fun v ↦ if a v < b v then f v else g v

theorem Nat.Primrec'.natPair E1 #

Nat.Primrec' fun v ↦ Nat.pair v.head v.tail.head

theorem Nat.Primrec'.encode E1 #

∀ {n : ℕ}, Nat.Primrec' Encodable.encode

theorem Nat.Primrec'.sqrt E1 #

Nat.Primrec' fun v ↦ v.head.sqrt

theorem Nat.Primrec'.unpair₁ E1 #

∀ {n : ℕ} {f : List.Vector ℕ n → ℕ}, Nat.Primrec' f → Nat.Primrec' fun v ↦ (Nat.unpair (f v)).1

theorem Nat.Primrec'.unpair₂ E1 #

∀ {n : ℕ} {f : List.Vector ℕ n → ℕ}, Nat.Primrec' f → Nat.Primrec' fun v ↦ (Nat.unpair (f v)).2

theorem Nat.Primrec'.of_prim E1 #

∀ {n : ℕ} {f : List.Vector ℕ n → ℕ}, Primrec f → Nat.Primrec' f

theorem Nat.Primrec'.prim_iff E0 #

∀ {n : ℕ} {f : List.Vector ℕ n → ℕ}, Nat.Primrec' f ↔ Primrec f

theorem Nat.Primrec'.prim_iff₁ E1 #

∀ {f : ℕ → ℕ}, (Nat.Primrec' fun v ↦ f v.head) ↔ Primrec f

theorem Nat.Primrec'.prim_iff₂ E1 #

∀ {f : ℕ → ℕ → ℕ}, (Nat.Primrec' fun v ↦ f v.head v.tail.head) ↔ Primrec₂ f

theorem Nat.Primrec'.vec_iff E0 #

∀ {m n : ℕ} {f : List.Vector ℕ m → List.Vector ℕ n}, Nat.Primrec'.Vec f ↔ Primrec f

theorem Primrec.nat_sqrt E1 #

Primrec Nat.sqrt