2014-12-09 06:11:48 +00:00
|
|
|
inductive list (A : Type) : Type :=
|
|
|
|
nil {} : list A,
|
|
|
|
cons : A → list A → list A
|
|
|
|
|
|
|
|
namespace list
|
|
|
|
open lift
|
|
|
|
|
|
|
|
theorem nil_ne_cons {A : Type} (a : A) (v : list A) : nil ≠ cons a v :=
|
2015-02-11 20:49:27 +00:00
|
|
|
λ H, down (list.no_confusion H)
|
2014-12-09 06:11:48 +00:00
|
|
|
|
|
|
|
theorem cons.inj₁ {A : Type} (a₁ a₂ : A) (v₁ v₂ : list A) : cons a₁ v₁ = cons a₂ v₂ → a₁ = a₂ :=
|
2015-02-11 20:49:27 +00:00
|
|
|
λ H, down (list.no_confusion H (λ (h₁ : a₁ = a₂) (h₂ : v₁ = v₂), h₁))
|
2014-12-09 06:11:48 +00:00
|
|
|
|
|
|
|
theorem cons.inj₂ {A : Type} (a₁ a₂ : A) (v₁ v₂ : list A) : cons a₁ v₁ = cons a₂ v₂ → v₁ = v₂ :=
|
2015-02-11 20:49:27 +00:00
|
|
|
λ H, down (list.no_confusion H (λ (h₁ : a₁ = a₂) (h₂ : v₁ = v₂), h₂))
|
2014-12-09 06:11:48 +00:00
|
|
|
|
|
|
|
end list
|