feat(builtin/kernel): add proof irrelevance axiom

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-01-19 12:20:09 -08:00
parent d322f63113
commit 6db10c577b
4 changed files with 7 additions and 0 deletions

View file

@ -58,6 +58,9 @@ axiom funext {A : TypeU} {B : A → TypeU} {f g : ∀ x : A, B x} (H : ∀ x : A
-- Forall extensionality
axiom allext {A : TypeU} {B C : A → Bool} (H : ∀ x : A, B x = C x) : (∀ x : A, B x) = (∀ x : A, C x)
-- Proof irrelevance
axiom proof_irrel {a : Bool} (H1 H2 : a) : H1 = H2
-- Alias for subst where we can provide P explicitly, but keep A,a,b implicit
theorem substp {A : TypeU} {a b : A} (P : A → Bool) (H1 : P a) (H2 : a = b) : P b
:= subst H1 H2

Binary file not shown.

View file

@ -21,6 +21,7 @@ MK_CONSTANT(refl_fn, name("refl"));
MK_CONSTANT(subst_fn, name("subst"));
MK_CONSTANT(funext_fn, name("funext"));
MK_CONSTANT(allext_fn, name("allext"));
MK_CONSTANT(proof_irrel_fn, name("proof_irrel"));
MK_CONSTANT(substp_fn, name("substp"));
MK_CONSTANT(not_intro_fn, name("not_intro"));
MK_CONSTANT(eta_fn, name("eta"));

View file

@ -55,6 +55,9 @@ inline expr mk_funext_th(expr const & e1, expr const & e2, expr const & e3, expr
expr mk_allext_fn();
bool is_allext_fn(expr const & e);
inline expr mk_allext_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4) { return mk_app({mk_allext_fn(), e1, e2, e3, e4}); }
expr mk_proof_irrel_fn();
bool is_proof_irrel_fn(expr const & e);
inline expr mk_proof_irrel_th(expr const & e1, expr const & e2, expr const & e3) { return mk_app({mk_proof_irrel_fn(), e1, e2, e3}); }
expr mk_substp_fn();
bool is_substp_fn(expr const & e);
inline expr mk_substp_th(expr const & e1, expr const & e2, expr const & e3, expr const & e4, expr const & e5, expr const & e6) { return mk_app({mk_substp_fn(), e1, e2, e3, e4, e5, e6}); }