The rules of the primrec tactic #
Pointwise forms Primrec fun a ↦ F (f a) (g a) of Mathlib's combinators: the head F is what
lets Aesop key a rule.
The leaves #
Products #
theorem
Primrec.fst'
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Primcodable α]
[Primcodable β]
[Primcodable γ]
{f : α → β × γ}
(hf : Primrec f)
:
Primrec fun (a : α) => (f a).1
theorem
Primrec.snd'
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Primcodable α]
[Primcodable β]
[Primcodable γ]
{f : α → β × γ}
(hf : Primrec f)
:
Primrec fun (a : α) => (f a).2
Arithmetic #
theorem
Primrec.nat_add'
{α : Type u_1}
[Primcodable α]
{f g : α → ℕ}
(hf : Primrec f)
(hg : Primrec g)
:
theorem
Primrec.nat_sub'
{α : Type u_1}
[Primcodable α]
{f g : α → ℕ}
(hf : Primrec f)
(hg : Primrec g)
:
theorem
Primrec.nat_mul'
{α : Type u_1}
[Primcodable α]
{f g : α → ℕ}
(hf : Primrec f)
(hg : Primrec g)
:
theorem
Primrec.nat_div'
{α : Type u_1}
[Primcodable α]
{f g : α → ℕ}
(hf : Primrec f)
(hg : Primrec g)
:
theorem
Primrec.nat_mod'
{α : Type u_1}
[Primcodable α]
{f g : α → ℕ}
(hf : Primrec f)
(hg : Primrec g)
:
theorem
Primrec.nat_max'
{α : Type u_1}
[Primcodable α]
{f g : α → ℕ}
(hf : Primrec f)
(hg : Primrec g)
:
theorem
Primrec.nat_min'
{α : Type u_1}
[Primcodable α]
{f g : α → ℕ}
(hf : Primrec f)
(hg : Primrec g)
:
theorem
Primrec.nat_pair'
{α : Type u_1}
[Primcodable α]
{f g : α → ℕ}
(hf : Primrec f)
(hg : Primrec g)
:
theorem
Primrec.unpair'
{α : Type u_1}
[Primcodable α]
{f : α → ℕ}
(hf : Primrec f)
:
Primrec fun (a : α) => Nat.unpair (f a)
theorem
Primrec.nat_pow'
{α : Type u_1}
[Primcodable α]
{f g : α → ℕ}
(hf : Primrec f)
(hg : Primrec g)
:
theorem
Primrec.nat_le'
{α : Type u_1}
[Primcodable α]
{f g : α → ℕ}
(hf : Primrec f)
(hg : Primrec g)
:
PrimrecPred fun (a : α) => f a ≤ g a
theorem
Primrec.nat_lt'
{α : Type u_1}
[Primcodable α]
{f g : α → ℕ}
(hf : Primrec f)
(hg : Primrec g)
:
PrimrecPred fun (a : α) => f a < g a
Lists and vectors #
theorem
Primrec.list_cons'
{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{f : α → β}
{l : α → List β}
(hf : Primrec f)
(hl : Primrec l)
:
theorem
Primrec.list_append'
{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{l m : α → List β}
(hl : Primrec l)
(hm : Primrec m)
:
theorem
Primrec.list_length'
{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{l : α → List β}
(hl : Primrec l)
:
theorem
Primrec.list_getD'
{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{l : α → List β}
(d : β)
{n : α → ℕ}
(hl : Primrec l)
(hn : Primrec n)
:
theorem
Primrec.list_getElem?'
{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{l : α → List β}
{n : α → ℕ}
(hl : Primrec l)
(hn : Primrec n)
:
theorem
Primrec.vector_cons'
{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{f : α → β}
{n : ℕ}
{v : α → List.Vector β n}
(hf : Primrec f)
(hv : Primrec v)
:
theorem
Primrec.vector_toList'
{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{n : ℕ}
{v : α → List.Vector β n}
(hv : Primrec v)
:
theorem
Primrec.vector_get''
{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{n : ℕ}
{v : α → List.Vector β n}
{i : α → Fin n}
(hv : Primrec v)
(hi : Primrec i)
:
Equality #
theorem
Primrec.eq'
{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{f g : α → β}
(hf : Primrec f)
(hg : Primrec g)
:
PrimrecPred fun (a : α) => f a = g a
Encodings #
theorem
Primrec.encode'
{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{f : α → β}
(hf : Primrec f)
:
Primrec fun (a : α) => Encodable.encode (f a)
theorem
Primrec.decode'
{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{n : α → ℕ}
(hn : Primrec n)
:
Primrec fun (a : α) => Encodable.decode (n a)
theorem
Primrec.decode₂'
{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{n : α → ℕ}
(hn : Primrec n)
:
Primrec fun (a : α) => Encodable.decode₂ β (n a)
theorem
Primrec.encdec'
{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{n : α → ℕ}
(hn : Primrec n)
:
Primrec fun (a : α) => Encodable.encode (Encodable.decode (n a))
theorem
Primrec.option_some'
{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{f : α → β}
(hf : Primrec f)
:
theorem
Primrec.option_isSome'
{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{o : α → Option β}
(ho : Primrec o)
:
theorem
Primrec.option_getD'
{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{f : α → β}
{o : α → Option β}
(ho : Primrec o)
(hf : Primrec f)
:
Predicates #
theorem
PrimrecPred.imp
{α : Type u_1}
[Primcodable α]
{p q : α → Prop}
(hp : PrimrecPred p)
(hq : PrimrecPred q)
:
PrimrecPred fun (a : α) => p a → q a
theorem
PrimrecPred.iff
{α : Type u_1}
[Primcodable α]
{p q : α → Prop}
(hp : PrimrecPred p)
(hq : PrimrecPred q)
:
PrimrecPred fun (a : α) => p a ↔ q a
Bounded quantifiers #
Mathlib's PrimrecRel.exists_lt and forall_lt fix the parameter at ℕ.
theorem
PrimrecRel.exists_lt'
{β : Type u_2}
[Primcodable β]
{R : ℕ → β → Prop}
(h : PrimrecRel R)
:
PrimrecRel fun (n : ℕ) (y : β) => ∃ x < n, R x y
theorem
PrimrecRel.forall_lt'
{β : Type u_2}
[Primcodable β]
{R : ℕ → β → Prop}
(h : PrimrecRel R)
:
PrimrecRel fun (n : ℕ) (y : β) => ∀ x < n, R x y
theorem
PrimrecPred.exists_lt'
{α : Type u_1}
[Primcodable α]
{n : α → ℕ}
{R : α → ℕ → Prop}
(hn : Primrec n)
(hR : PrimrecRel R)
:
PrimrecPred fun (a : α) => ∃ x < n a, R a x
theorem
PrimrecPred.forall_lt'
{α : Type u_1}
[Primcodable α]
{n : α → ℕ}
{R : α → ℕ → Prop}
(hn : Primrec n)
(hR : PrimrecRel R)
:
PrimrecPred fun (a : α) => ∀ x < n a, R a x
theorem
PrimrecRel.mk
{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{r : α → β → Prop}
(h : PrimrecPred fun (p : α × β) => r p.1 p.2)
:
The rule set #
Rules match at reducible transparency: at default, a failed match unfolds Nat.unpair and
Nat.sqrt, which costs minutes.