2014-12-01 04:34:12 +00:00
|
|
|
|
/-
|
|
|
|
|
Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
Author: Leonardo de Moura, Jeremy Avigad
|
|
|
|
|
-/
|
|
|
|
|
prelude
|
2016-02-09 01:07:44 +00:00
|
|
|
|
import init.num init.relation
|
2014-12-01 04:34:12 +00:00
|
|
|
|
|
2015-09-22 16:01:55 +00:00
|
|
|
|
definition pair [constructor] := @prod.mk
|
2015-02-01 19:14:01 +00:00
|
|
|
|
notation A × B := prod A B
|
|
|
|
|
-- notation for n-ary tuples
|
2015-09-30 15:06:31 +00:00
|
|
|
|
notation `(` h `, ` t:(foldl `, ` (e r, prod.mk r e) h) `)` := t
|
2014-11-11 08:29:21 +00:00
|
|
|
|
|
|
|
|
|
namespace prod
|
2014-12-01 04:34:12 +00:00
|
|
|
|
notation `pr₁` := pr1
|
|
|
|
|
notation `pr₂` := pr2
|
|
|
|
|
|
2015-02-01 16:39:47 +00:00
|
|
|
|
namespace ops
|
|
|
|
|
postfix `.1`:(max+1) := pr1
|
|
|
|
|
postfix `.2`:(max+1) := pr2
|
|
|
|
|
end ops
|
|
|
|
|
|
2015-06-26 00:15:16 +00:00
|
|
|
|
definition destruct [reducible] := @prod.cases_on
|
|
|
|
|
|
|
|
|
|
section
|
|
|
|
|
variables {A B : Type}
|
|
|
|
|
lemma pr1.mk (a : A) (b : B) : pr1 (mk a b) = a := rfl
|
|
|
|
|
lemma pr2.mk (a : A) (b : B) : pr2 (mk a b) = b := rfl
|
|
|
|
|
lemma eta : ∀ (p : A × B), mk (pr1 p) (pr2 p) = p
|
|
|
|
|
| (a, b) := rfl
|
|
|
|
|
end
|
|
|
|
|
|
2014-11-11 08:29:21 +00:00
|
|
|
|
end prod
|