Skip to content

Commit

Permalink
feat(set_theory/zfc): simp lemmas for arity and const (#15214)
Browse files Browse the repository at this point in the history
  • Loading branch information
vihdzp committed Jul 10, 2022
1 parent cf4783f commit f4f0f67
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/set_theory/zfc.lean
Expand Up @@ -61,15 +61,21 @@ def arity (α : Type u) : ℕ → Type u
| 0 := α
| (n+1) := α → arity n

@[simp] theorem arity_zero (α : Type u) : arity α 0 = α := rfl
@[simp] theorem arity_succ (α : Type u) (n : ℕ) : arity α n.succ = (α → arity α n) := rfl

namespace arity

/-- Constant `n`-ary function with value `a`. -/
def const {α : Type u} (a : α) : ∀ n, arity α n
| 0 := a
| (n+1) := λ _, const n

instance arity.inhabited {α n} [inhabited α] : inhabited (arity α n) :=
⟨const default _⟩
@[simp] theorem const_zero {α : Type u} (a : α) : const a 0 = a := rfl
@[simp] theorem const_succ {α : Type u} (a : α) (n : ℕ) : const a n.succ = λ _, const a n := rfl
theorem const_succ_apply {α : Type u} (a : α) (n : ℕ) (x : α) : const a n.succ x = const a n := rfl

instance arity.inhabited {α n} [inhabited α] : inhabited (arity α n) := ⟨const default _⟩

end arity

Expand Down

0 comments on commit f4f0f67

Please sign in to comment.