2014-11-30 21:16:01 -08:00
|
|
|
import data.sigma
|
2014-10-27 07:26:01 -07:00
|
|
|
|
|
|
|
namespace sigma
|
2014-11-15 15:59:49 -08:00
|
|
|
namespace manual
|
2014-10-27 07:26:01 -07:00
|
|
|
definition no_confusion_type {A : Type} {B : A → Type} (P : Type) (v₁ v₂ : sigma B) : Type :=
|
2014-11-03 23:06:33 -08:00
|
|
|
rec_on v₁
|
|
|
|
(λ (a₁ : A) (b₁ : B a₁), rec_on v₂
|
2014-10-27 07:26:01 -07:00
|
|
|
(λ (a₂ : A) (b₂ : B a₂),
|
|
|
|
(Π (eq₁ : a₁ = a₂), eq.rec_on eq₁ b₁ = b₂ → P) → P))
|
|
|
|
|
|
|
|
definition no_confusion {A : Type} {B : A → Type} {P : Type} {v₁ v₂ : sigma B} : v₁ = v₂ → no_confusion_type P v₁ v₂ :=
|
|
|
|
assume H₁₂ : v₁ = v₂,
|
|
|
|
have aux : v₁ = v₁ → no_confusion_type P v₁ v₁, from
|
2014-11-03 23:06:33 -08:00
|
|
|
assume H₁₁, rec_on v₁
|
2014-10-27 07:26:01 -07:00
|
|
|
(λ (a₁ : A) (b₁ : B a₁) (h : Π (eq₁ : a₁ = a₁), eq.rec_on eq₁ b₁ = b₁ → P),
|
|
|
|
h rfl rfl),
|
|
|
|
eq.rec_on H₁₂ aux H₁₂
|
2014-11-15 15:59:49 -08:00
|
|
|
end manual
|
2014-10-27 07:26:01 -07:00
|
|
|
|
2014-12-19 18:23:08 -08:00
|
|
|
theorem sigma.mk.inj_1 {A : Type} {B : A → Type} {a₁ a₂ : A} {b₁ : B a₁} {b₂ : B a₂} (Heq : mk a₁ b₁ = mk a₂ b₂) : a₁ = a₂ :=
|
2014-10-27 07:26:01 -07:00
|
|
|
begin
|
|
|
|
apply (no_confusion Heq), intros, assumption
|
|
|
|
end
|
|
|
|
|
2014-12-19 18:23:08 -08:00
|
|
|
theorem sigma.mk.inj_2 {A : Type} {B : A → Type} (a₁ a₂ : A) (b₁ : B a₁) (b₂ : B a₂) (Heq : mk a₁ b₁ = mk a₂ b₂) : b₁ == b₂ :=
|
2014-10-27 07:26:01 -07:00
|
|
|
begin
|
|
|
|
apply (no_confusion Heq), intros, eassumption
|
|
|
|
end
|
|
|
|
end sigma
|