2014-08-07 11:36:44 -07:00
|
|
|
|
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
2014-07-20 21:15:48 -07:00
|
|
|
|
-- Released under Apache 2.0 license as described in the file LICENSE.
|
2014-07-31 18:40:09 -07:00
|
|
|
|
-- Author: Leonardo de Moura
|
|
|
|
|
|
2015-04-01 12:36:33 -07:00
|
|
|
|
import logic.axioms.hilbert logic.eq
|
2014-10-01 17:51:17 -07:00
|
|
|
|
open eq.ops nonempty inhabited
|
2014-07-20 21:15:48 -07:00
|
|
|
|
|
|
|
|
|
-- Diaconescu’s theorem
|
|
|
|
|
-- Show that Excluded middle follows from
|
2014-07-22 09:43:18 -07:00
|
|
|
|
-- Hilbert's choice operator, function extensionality and Prop extensionality
|
2014-10-09 07:13:06 -07:00
|
|
|
|
context
|
2014-07-25 11:10:45 -07:00
|
|
|
|
hypothesis propext {a b : Prop} : (a → b) → (b → a) → a = b
|
2014-10-09 07:13:06 -07:00
|
|
|
|
parameter p : Prop
|
2014-07-20 21:15:48 -07:00
|
|
|
|
|
2015-01-08 18:47:44 -08:00
|
|
|
|
private definition u [reducible] := epsilon (λx, x = true ∨ p)
|
2014-07-20 21:15:48 -07:00
|
|
|
|
|
2015-01-08 18:47:44 -08:00
|
|
|
|
private definition v [reducible] := epsilon (λx, x = false ∨ p)
|
2014-07-20 21:15:48 -07:00
|
|
|
|
|
2014-09-19 14:30:02 -07:00
|
|
|
|
private lemma u_def : u = true ∨ p :=
|
2014-12-15 19:05:03 -08:00
|
|
|
|
epsilon_spec (exists.intro true (or.inl rfl))
|
2014-07-28 19:58:57 -07:00
|
|
|
|
|
2014-09-19 14:30:02 -07:00
|
|
|
|
private lemma v_def : v = false ∨ p :=
|
2014-12-15 19:05:03 -08:00
|
|
|
|
epsilon_spec (exists.intro false (or.inl rfl))
|
2014-07-28 19:58:57 -07:00
|
|
|
|
|
2014-09-19 14:30:02 -07:00
|
|
|
|
private lemma uv_implies_p : ¬(u = v) ∨ p :=
|
2014-09-04 21:25:21 -07:00
|
|
|
|
or.elim u_def
|
|
|
|
|
(assume Hut : u = true, or.elim v_def
|
2014-07-28 19:58:57 -07:00
|
|
|
|
(assume Hvf : v = false,
|
|
|
|
|
have Hne : ¬(u = v), from Hvf⁻¹ ▸ Hut⁻¹ ▸ true_ne_false,
|
2014-09-04 21:25:21 -07:00
|
|
|
|
or.inl Hne)
|
|
|
|
|
(assume Hp : p, or.inr Hp))
|
|
|
|
|
(assume Hp : p, or.inr Hp)
|
2014-07-28 19:58:57 -07:00
|
|
|
|
|
2014-09-19 14:30:02 -07:00
|
|
|
|
private lemma p_implies_uv : p → u = v :=
|
2014-07-28 19:58:57 -07:00
|
|
|
|
assume Hp : p,
|
|
|
|
|
have Hpred : (λ x, x = true ∨ p) = (λ x, x = false ∨ p), from
|
|
|
|
|
funext (take x : Prop,
|
|
|
|
|
have Hl : (x = true ∨ p) → (x = false ∨ p), from
|
2014-09-04 21:25:21 -07:00
|
|
|
|
assume A, or.inr Hp,
|
2014-07-28 19:58:57 -07:00
|
|
|
|
have Hr : (x = false ∨ p) → (x = true ∨ p), from
|
2014-09-04 21:25:21 -07:00
|
|
|
|
assume A, or.inr Hp,
|
2014-07-28 19:58:57 -07:00
|
|
|
|
show (x = true ∨ p) = (x = false ∨ p), from
|
|
|
|
|
propext Hl Hr),
|
|
|
|
|
show u = v, from
|
2014-09-04 16:36:06 -07:00
|
|
|
|
Hpred ▸ (eq.refl (epsilon (λ x, x = true ∨ p)))
|
2014-07-28 19:58:57 -07:00
|
|
|
|
|
|
|
|
|
theorem em : p ∨ ¬p :=
|
2014-08-03 22:58:12 -07:00
|
|
|
|
have H : ¬(u = v) → ¬p, from mt p_implies_uv,
|
2014-09-04 21:25:21 -07:00
|
|
|
|
or.elim uv_implies_p
|
|
|
|
|
(assume Hne : ¬(u = v), or.inr (H Hne))
|
|
|
|
|
(assume Hp : p, or.inl Hp)
|
2014-07-20 21:15:48 -07:00
|
|
|
|
end
|