2014-07-21 04:15:48 +00:00
|
|
|
|
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
|
|
|
|
-- Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
-- Authors: Leonardo de Moura, Jeremy Avigad
|
|
|
|
|
import logic hilbert funext
|
2014-07-25 05:49:12 +00:00
|
|
|
|
using eq_proofs
|
2014-07-21 04:15:48 +00:00
|
|
|
|
|
|
|
|
|
-- Diaconescu’s theorem
|
|
|
|
|
-- Show that Excluded middle follows from
|
2014-07-22 16:43:18 +00:00
|
|
|
|
-- Hilbert's choice operator, function extensionality and Prop extensionality
|
2014-07-21 04:15:48 +00:00
|
|
|
|
section
|
2014-07-25 18:10:45 +00:00
|
|
|
|
hypothesis propext {a b : Prop} : (a → b) → (b → a) → a = b
|
2014-07-21 04:15:48 +00:00
|
|
|
|
|
2014-07-22 16:43:18 +00:00
|
|
|
|
parameter p : Prop
|
2014-07-21 04:15:48 +00:00
|
|
|
|
|
|
|
|
|
definition u [private] := epsilon (λ x, x = true ∨ p)
|
|
|
|
|
|
|
|
|
|
definition v [private] := epsilon (λ x, x = false ∨ p)
|
|
|
|
|
|
|
|
|
|
lemma u_def [private] : u = true ∨ p
|
|
|
|
|
:= epsilon_ax (exists_intro true (or_intro_left p (refl true)))
|
|
|
|
|
|
|
|
|
|
lemma v_def [private] : v = false ∨ p
|
|
|
|
|
:= epsilon_ax (exists_intro false (or_intro_left p (refl false)))
|
|
|
|
|
|
|
|
|
|
lemma uv_implies_p [private] : ¬(u = v) ∨ p
|
|
|
|
|
:= or_elim u_def
|
|
|
|
|
(assume Hut : u = true, or_elim v_def
|
|
|
|
|
(assume Hvf : v = false,
|
2014-07-25 05:49:12 +00:00
|
|
|
|
have Hne : ¬(u = v), from Hvf⁻¹ ▸ Hut⁻¹ ▸ true_ne_false,
|
2014-07-21 04:15:48 +00:00
|
|
|
|
or_intro_left p Hne)
|
|
|
|
|
(assume Hp : p, or_intro_right (¬u = v) Hp))
|
|
|
|
|
(assume Hp : p, or_intro_right (¬u = v) Hp)
|
|
|
|
|
|
|
|
|
|
lemma p_implies_uv [private] : p → u = v
|
|
|
|
|
:= assume Hp : p,
|
|
|
|
|
have Hpred : (λ x, x = true ∨ p) = (λ x, x = false ∨ p), from
|
2014-07-22 16:43:18 +00:00
|
|
|
|
funext (take x : Prop,
|
2014-07-21 04:15:48 +00:00
|
|
|
|
have Hl : (x = true ∨ p) → (x = false ∨ p), from
|
|
|
|
|
assume A, or_intro_right (x = false) Hp,
|
|
|
|
|
have Hr : (x = false ∨ p) → (x = true ∨ p), from
|
|
|
|
|
assume A, or_intro_right (x = true) Hp,
|
|
|
|
|
show (x = true ∨ p) = (x = false ∨ p), from
|
2014-07-22 16:43:18 +00:00
|
|
|
|
propext Hl Hr),
|
2014-07-21 04:15:48 +00:00
|
|
|
|
show u = v, from
|
2014-07-25 05:49:12 +00:00
|
|
|
|
Hpred ▸ (refl (epsilon (λ x, x = true ∨ p)))
|
2014-07-21 04:15:48 +00:00
|
|
|
|
|
2014-07-25 18:36:28 +00:00
|
|
|
|
theorem em : p ∨ ¬p
|
|
|
|
|
:= have H : ¬(u = v) → ¬p, from contrapos p_implies_uv,
|
2014-07-21 04:15:48 +00:00
|
|
|
|
or_elim uv_implies_p
|
|
|
|
|
(assume Hne : ¬(u = v), or_intro_right p (H Hne))
|
|
|
|
|
(assume Hp : p, or_intro_left (¬p) Hp)
|
|
|
|
|
end
|