2014-08-01 18:15:35 +00:00
|
|
|
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
2014-07-13 00:39:35 +00:00
|
|
|
-- Released under Apache 2.0 license as described in the file LICENSE.
|
2014-08-15 03:12:54 +00:00
|
|
|
-- Authors: Leonardo de Moura, Jeremy Avigad
|
2014-08-01 01:40:09 +00:00
|
|
|
|
2014-08-22 23:36:47 +00:00
|
|
|
-- logic.axioms.hilbert
|
|
|
|
-- ====================
|
|
|
|
|
|
|
|
-- Follows Coq.Logic.ClassicalEpsilon (but our definition of "inhabited" is the
|
|
|
|
-- constructive one).
|
|
|
|
|
2014-08-28 01:39:55 +00:00
|
|
|
import logic.core.quantifiers
|
2014-08-15 15:43:52 +00:00
|
|
|
import logic.classes.inhabited logic.classes.nonempty
|
2014-08-15 03:12:54 +00:00
|
|
|
import data.subtype data.sum
|
2014-07-13 00:39:35 +00:00
|
|
|
|
2014-09-03 23:00:38 +00:00
|
|
|
open subtype inhabited nonempty
|
2014-08-15 03:12:54 +00:00
|
|
|
|
|
|
|
|
2014-08-22 23:36:47 +00:00
|
|
|
-- the axiom
|
|
|
|
-- ---------
|
2014-08-15 03:12:54 +00:00
|
|
|
|
|
|
|
axiom strong_indefinite_description {A : Type} (P : A → Prop) (H : nonempty A) :
|
2014-08-22 23:36:47 +00:00
|
|
|
{x : A, (∃x : A, P x) → P x}
|
2014-08-15 03:12:54 +00:00
|
|
|
|
|
|
|
-- In the presence of classical logic, we could prove this from the weaker
|
2014-08-22 23:36:47 +00:00
|
|
|
-- axiom indefinite_description {A : Type} {P : A->Prop} (H : ∃x, P x) : {x : A, P x}
|
2014-08-15 03:12:54 +00:00
|
|
|
|
2014-08-15 15:43:52 +00:00
|
|
|
theorem nonempty_imp_exists_true {A : Type} (H : nonempty A) : ∃x : A, true :=
|
2014-09-04 23:36:06 +00:00
|
|
|
nonempty.elim H (take x, exists_intro x trivial)
|
2014-08-15 15:43:52 +00:00
|
|
|
|
2014-08-15 03:12:54 +00:00
|
|
|
theorem nonempty_imp_inhabited {A : Type} (H : nonempty A) : inhabited A :=
|
2014-08-22 23:36:47 +00:00
|
|
|
let u : {x : A, (∃x : A, true) → true} := strong_indefinite_description (λa, true) H in
|
2014-09-04 23:36:06 +00:00
|
|
|
inhabited.mk (elt_of u)
|
2014-08-15 03:12:54 +00:00
|
|
|
|
2014-08-20 22:49:44 +00:00
|
|
|
theorem exists_imp_inhabited {A : Type} {P : A → Prop} (H : ∃x, P x) : inhabited A :=
|
2014-09-04 23:36:06 +00:00
|
|
|
nonempty_imp_inhabited (obtain w Hw, from H, nonempty.intro w)
|
2014-08-15 03:12:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
-- the Hilbert epsilon function
|
|
|
|
-- ----------------------------
|
|
|
|
|
2014-08-15 15:43:52 +00:00
|
|
|
definition epsilon {A : Type} {H : nonempty A} (P : A → Prop) : A :=
|
2014-08-22 23:36:47 +00:00
|
|
|
let u : {x : A, (∃y, P y) → P x} :=
|
2014-08-15 15:43:52 +00:00
|
|
|
strong_indefinite_description P H in
|
2014-08-15 03:12:54 +00:00
|
|
|
elt_of u
|
|
|
|
|
2014-08-15 15:43:52 +00:00
|
|
|
theorem epsilon_spec_aux {A : Type} (H : nonempty A) (P : A → Prop) (Hex : ∃y, P y) :
|
2014-08-15 03:12:54 +00:00
|
|
|
P (@epsilon A H P) :=
|
2014-08-22 23:36:47 +00:00
|
|
|
let u : {x : A, (∃y, P y) → P x} :=
|
2014-08-15 15:43:52 +00:00
|
|
|
strong_indefinite_description P H in
|
2014-08-15 03:12:54 +00:00
|
|
|
has_property u Hex
|
|
|
|
|
|
|
|
theorem epsilon_spec {A : Type} {P : A → Prop} (Hex : ∃y, P y) :
|
2014-08-15 15:43:52 +00:00
|
|
|
P (@epsilon A (exists_imp_nonempty Hex) P) :=
|
|
|
|
epsilon_spec_aux (exists_imp_nonempty Hex) P Hex
|
2014-07-13 00:39:35 +00:00
|
|
|
|
2014-09-04 23:36:06 +00:00
|
|
|
theorem epsilon_singleton {A : Type} (a : A) : @epsilon A (nonempty.intro a) (λx, x = a) = a :=
|
|
|
|
epsilon_spec (exists_intro a (eq.refl a))
|
2014-08-15 03:12:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
-- the axiom of choice
|
|
|
|
-- -------------------
|
2014-07-13 00:39:35 +00:00
|
|
|
|
2014-08-15 03:12:54 +00:00
|
|
|
theorem axiom_of_choice {A : Type} {B : A → Type} {R : Πx, B x → Prop} (H : ∀x, ∃y, R x y) :
|
|
|
|
∃f, ∀x, R x (f x) :=
|
2014-08-22 01:24:22 +00:00
|
|
|
let f := λx, @epsilon _ (exists_imp_nonempty (H x)) (λy, R x y),
|
|
|
|
H := take x, epsilon_spec (H x)
|
2014-07-29 02:58:57 +00:00
|
|
|
in exists_intro f H
|
2014-07-13 00:39:35 +00:00
|
|
|
|
2014-08-15 03:12:54 +00:00
|
|
|
theorem skolem {A : Type} {B : A → Type} {P : Πx, B x → Prop} :
|
|
|
|
(∀x, ∃y, P x y) ↔ ∃f, (∀x, P x (f x)) :=
|
2014-09-05 04:25:21 +00:00
|
|
|
iff.intro
|
2014-08-15 03:12:54 +00:00
|
|
|
(assume H : (∀x, ∃y, P x y), axiom_of_choice H)
|
|
|
|
(assume H : (∃f, (∀x, P x (f x))),
|
|
|
|
take x, obtain (fw : ∀x, B x) (Hw : ∀x, P x (fw x)), from H,
|
2014-07-29 02:58:57 +00:00
|
|
|
exists_intro (fw x) (Hw x))
|