From 4d533c6a256d551b6f1fd416273257347f5ba15c Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Thu, 30 Jan 2014 22:13:34 -0800 Subject: [PATCH] feat(builtin/kernel): add nonempty_range theorem Signed-off-by: Leonardo de Moura --- src/builtin/kernel.lean | 10 ++++++++++ src/builtin/obj/kernel.olean | Bin 37933 -> 38337 bytes src/kernel/kernel_decls.cpp | 1 + src/kernel/kernel_decls.h | 3 +++ 4 files changed, 14 insertions(+) diff --git a/src/builtin/kernel.lean b/src/builtin/kernel.lean index 12fac3cfc..11af8252c 100644 --- a/src/builtin/kernel.lean +++ b/src/builtin/kernel.lean @@ -650,6 +650,16 @@ theorem exists_imp_distribute {A : TypeU} (φ ψ : A → Bool) : (∃ x, φ x ... = ¬ (∀ x, φ x) ∨ (∃ x, ψ x) : { symm (not_forall A φ) } ... = (∀ x, φ x) → (∃ x, ψ x) : symm (imp_or _ _) +-- If a function space is non-empty, then for every 'a' in the domain, the range (B a) is not empty +theorem nonempty_range {A : TypeU} {B : A → TypeU} (H : nonempty (∀ x, B x)) (a : A) : nonempty (B a) +:= refute (λ N : ¬ nonempty (B a), + let s1 : ¬ ∃ x : B a, true := N, + s2 : ∀ x : B a, false := not_exists_elim s1, + s3 : ∃ y : (∀ x, B x), true := H + in obtain (w : (∀ x, B x)) (Hw : true), from s3, + let s4 : B a := w a + in s2 s4) + theorem if_true {A : TypeU} (a b : A) : (if true then a else b) = a := calc (if true then a else b) = ε (nonempty_intro a) (λ r, (true → r = a) ∧ (¬ true → r = b)) : refl (if true then a else b) ... = ε (nonempty_intro a) (λ r, r = a) : by simp diff --git a/src/builtin/obj/kernel.olean b/src/builtin/obj/kernel.olean index 001db09eaf01a750dffd7249b94cc7a1b28bddb8..4f90998b4c836178ec72570f21a945f7731297e1 100644 GIT binary patch delta 3421 zcmaJ@eNa?Y6u<91cK1D{940(3j>UQj|G0X4aIZY4&AhmQ7z18`Vr{n&FWB)ztl+`}TvSkr~eZ?)jbjyXT&B z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