lean4-htt/src/builtin/pair.lean
Leonardo de Moura db3bcdba55 refactor(builtin): move pair definition and theorems to pair.lean
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-02-06 09:20:52 -08:00

10 lines
666 B
Text

-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
-- Released under Apache 2.0 license as described in the file LICENSE.
-- Author: Leonardo de Moura
definition pair {A : (Type U)} {B : (Type U)} (a : A) (b : B) := tuple a, b
theorem pair_inj1 {A : (Type U)} {B : A → (Type U)} {a b : sig x, B x} (H : a = b) : proj1 a = proj1 b
:= subst (refl (proj1 a)) H
theorem pair_inj2 {A B : (Type U)} {a b : A # B} (H : a = b) : proj2 a = proj2 b
:= subst (refl (proj2 a)) H
theorem pairext_proj {A B : (Type U)} {p : A # B} {a : A} {b : B} (H1 : proj1 p = a) (H2 : proj2 p = b) : p = (pair a b)
:= @pairext A (λ x, B) p (pair a b) H1 (to_heq H2)