2015-05-04 23:03:06 +00:00
|
|
|
/-
|
|
|
|
Copyright (c) 2015 Floris van Doorn. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
Authors: Floris van Doorn
|
|
|
|
|
|
|
|
Theorems about the booleans
|
|
|
|
-/
|
|
|
|
|
2015-06-04 01:41:21 +00:00
|
|
|
open is_equiv eq equiv function is_trunc option unit
|
2015-05-04 23:03:06 +00:00
|
|
|
|
|
|
|
namespace bool
|
|
|
|
|
|
|
|
definition ff_ne_tt : ff = tt → empty
|
|
|
|
| [none]
|
|
|
|
|
2015-08-07 16:37:05 +00:00
|
|
|
definition is_equiv_bnot [constructor] [instance] [priority 500] : is_equiv bnot :=
|
2015-05-04 23:03:06 +00:00
|
|
|
begin
|
|
|
|
fapply is_equiv.mk,
|
|
|
|
exact bnot,
|
2015-08-06 20:37:52 +00:00
|
|
|
all_goals (intro b;cases b), do 6 reflexivity
|
|
|
|
-- all_goals (focus (intro b;cases b;all_goals reflexivity)),
|
2015-05-04 23:03:06 +00:00
|
|
|
end
|
|
|
|
|
2015-08-07 16:37:05 +00:00
|
|
|
definition bnot_ne : Π(b : bool), bnot b ≠ b
|
|
|
|
| bnot_ne tt := ff_ne_tt
|
|
|
|
| bnot_ne ff := ne.symm ff_ne_tt
|
|
|
|
|
|
|
|
definition equiv_bnot [constructor] : bool ≃ bool := equiv.mk bnot _
|
2015-05-04 23:03:06 +00:00
|
|
|
definition eq_bnot : bool = bool := ua equiv_bnot
|
|
|
|
|
|
|
|
definition eq_bnot_ne_idp : eq_bnot ≠ idp :=
|
|
|
|
assume H : eq_bnot = idp,
|
|
|
|
assert H2 : bnot = id, from !cast_ua_fn⁻¹ ⬝ ap cast H,
|
|
|
|
absurd (ap10 H2 tt) ff_ne_tt
|
|
|
|
|
2015-06-04 01:41:21 +00:00
|
|
|
|
|
|
|
definition bool_equiv_option_unit : bool ≃ option unit :=
|
|
|
|
begin
|
|
|
|
fapply equiv.MK,
|
|
|
|
{ intro b, cases b, exact none, exact some star},
|
|
|
|
{ intro u, cases u, exact ff, exact tt},
|
|
|
|
{ intro u, cases u with u, reflexivity, cases u, reflexivity},
|
|
|
|
{ intro b, cases b, reflexivity, reflexivity},
|
|
|
|
end
|
2015-05-04 23:03:06 +00:00
|
|
|
end bool
|