feat(hott/init): add notation for sigma types
This commit is contained in:
parent
05f27b8f0e
commit
ad9620f325
2 changed files with 26 additions and 0 deletions
|
@ -7,3 +7,4 @@ Authors: Leonardo de Moura
|
||||||
prelude
|
prelude
|
||||||
import init.datatypes init.reserved_notation init.tactic init.logic
|
import init.datatypes init.reserved_notation init.tactic init.logic
|
||||||
import init.bool init.num init.priority init.relation init.wf init.prod
|
import init.bool init.num init.priority init.relation init.wf init.prod
|
||||||
|
import init.sigma
|
||||||
|
|
25
hott/init/sigma.hlean
Normal file
25
hott/init/sigma.hlean
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
/-
|
||||||
|
Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
||||||
|
Released under Apache 2.0 license as described in the file LICENSE.
|
||||||
|
Authors: Leonardo de Moura, Jeremy Avigad, Floris van Doorn
|
||||||
|
-/
|
||||||
|
prelude
|
||||||
|
import init.num init.wf init.logic init.tactic
|
||||||
|
|
||||||
|
structure sigma {A : Type} (B : A → Type) :=
|
||||||
|
dpair :: (dpr1 : A) (dpr2 : B dpr1)
|
||||||
|
|
||||||
|
notation `Σ` binders `,` r:(scoped P, sigma P) := r
|
||||||
|
|
||||||
|
namespace sigma
|
||||||
|
|
||||||
|
notation `dpr₁` := dpr1
|
||||||
|
notation `dpr₂` := dpr2
|
||||||
|
|
||||||
|
namespace ops
|
||||||
|
postfix `.1`:(max+1) := dpr1
|
||||||
|
postfix `.2`:(max+1) := dpr2
|
||||||
|
notation `⟨` t:(foldr `,` (e r, sigma.dpair e r)) `⟩`:0 := t --input ⟨ ⟩ as \< \>
|
||||||
|
end ops
|
||||||
|
|
||||||
|
end sigma
|
Loading…
Add table
Reference in a new issue