allow multiple names in a binder
e.g. "(x y : ℕ) × plus x y ≡ 10 : ℕ" fixes #2
This commit is contained in:
parent
b4a8438434
commit
3f06e8d68b
8 changed files with 49 additions and 50 deletions
|
@ -5,21 +5,20 @@ namespace either {
|
|||
|
||||
def0 Tag : ★₀ = {left, right};
|
||||
|
||||
def0 Payload : 0.(A : ★₀) → 0.(B : ★₀) → 1.Tag → ★₀ =
|
||||
def0 Payload : 0.★₀ → 0.★₀ → 1.Tag → ★₀ =
|
||||
λ A B tag ⇒ case1 tag return ★₀ of { 'left ⇒ A; 'right ⇒ B };
|
||||
|
||||
def0 Either : 0.★₀ → 0.★₀ → ★₀ =
|
||||
λ A B ⇒ (tag : Tag) × Payload A B tag;
|
||||
|
||||
def Left : 0.(A : ★₀) → 0.(B : ★₀) → 1.A → Either A B =
|
||||
def Left : 0.(A B : ★₀) → 1.A → Either A B =
|
||||
λ A B x ⇒ ('left, x);
|
||||
|
||||
def Right : 0.(A : ★₀) → 0.(B : ★₀) → 1.B → Either A B =
|
||||
def Right : 0.(A B : ★₀) → 1.B → Either A B =
|
||||
λ A B x ⇒ ('right, x);
|
||||
|
||||
def elim' :
|
||||
0.(A : ★₀) → 0.(B : ★₀) →
|
||||
0.(P : 0.(Either A B) → ★₀) →
|
||||
0.(A B : ★₀) → 0.(P : 0.(Either A B) → ★₀) →
|
||||
ω.(1.(x : A) → P (Left A B x)) →
|
||||
ω.(1.(x : B) → P (Right A B x)) →
|
||||
1.(t : Tag) → 1.(a : Payload A B t) → P (t, a) =
|
||||
|
@ -29,8 +28,7 @@ def elim' :
|
|||
of { 'left ⇒ f; 'right ⇒ g };
|
||||
|
||||
def elim :
|
||||
0.(A : ★₀) → 0.(B : ★₀) →
|
||||
0.(P : 0.(Either A B) → ★₀) →
|
||||
0.(A B : ★₀) → 0.(P : 0.(Either A B) → ★₀) →
|
||||
ω.(1.(x : A) → P (Left A B x)) →
|
||||
ω.(1.(x : B) → P (Right A B x)) →
|
||||
1.(x : Either A B) → P x =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue