Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
100K - 1M
License:
File size: 3,761 Bytes
4365a98 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
/-
Copyright (c) 2021 Floris van Doorn. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Floris van Doorn, Yury Kudryashov
-/
import order.symm_diff
import tactic.monotonicity.basic
/-!
# Implication and equivalence as operations on a boolean algebra
In this file we define `lattice.imp` (notation: `a ββ b`) and `lattice.biimp` (notation: `a ββ b`)
to be the implication and equivalence as operations on a boolean algebra. More precisely, we put
`a ββ b = aαΆ β b` and `a ββ b = (a ββ b) β (b ββ a)`. Equivalently, `a ββ b = (a \ b)αΆ` and
`a ββ b = (a β b)αΆ`. For propositions these operations are equal to the usual implication and `iff`.
-/
variables {Ξ± Ξ² : Type*}
namespace lattice
/-- Implication as a binary operation on a boolean algebra. -/
def imp [has_compl Ξ±] [has_sup Ξ±] (a b : Ξ±) : Ξ± := aαΆ β b
infix ` ββ `:65 := lattice.imp
/-- Equivalence as a binary operation on a boolean algebra. -/
def biimp [has_compl Ξ±] [has_sup Ξ±] [has_inf Ξ±] (a b : Ξ±) : Ξ± := (a ββ b) β (b ββ a)
infix ` ββ `:60 := lattice.biimp
@[simp] lemma imp_eq_arrow (p q : Prop) : p ββ q = (p β q) := propext imp_iff_not_or.symm
@[simp] lemma biimp_eq_iff (p q : Prop) : p ββ q = (p β q) := by simp [biimp, β iff_def]
variables [boolean_algebra Ξ±] {a b c d : Ξ±}
@[simp] lemma compl_imp (a b : Ξ±) : (a ββ b)αΆ = a \ b := by simp [imp, sdiff_eq]
lemma compl_sdiff (a b : Ξ±) : (a \ b)αΆ = a ββ b := by rw [β compl_imp, compl_compl]
@[mono] lemma imp_mono (hβ : a β€ b) (hβ : c β€ d) : b ββ c β€ a ββ d :=
sup_le_sup (compl_le_compl hβ) hβ
lemma inf_imp_eq (a b c : Ξ±) : a β (b ββ c) = (a ββ b) ββ (a β c) :=
by unfold imp; simp [inf_sup_left]
@[simp] lemma imp_eq_top_iff : (a ββ b = β€) β a β€ b :=
by rw [β compl_sdiff, compl_eq_top, sdiff_eq_bot_iff]
@[simp] lemma imp_eq_bot_iff : (a ββ b = β₯) β (a = β€ β§ b = β₯) := by simp [imp]
@[simp] lemma imp_bot (a : Ξ±) : a ββ β₯ = aαΆ := sup_bot_eq
@[simp] lemma top_imp (a : Ξ±) : β€ ββ a = a := by simp [imp]
@[simp] lemma bot_imp (a : Ξ±) : β₯ ββ a = β€ := imp_eq_top_iff.2 bot_le
@[simp] lemma imp_top (a : Ξ±) : a ββ β€ = β€ := imp_eq_top_iff.2 le_top
@[simp] lemma imp_self (a : Ξ±) : a ββ a = β€ := compl_sup_eq_top
@[simp] lemma compl_imp_compl (a b : Ξ±) : aαΆ ββ bαΆ = b ββ a := by simp [imp, sup_comm]
lemma imp_inf_le {Ξ± : Type*} [boolean_algebra Ξ±] (a b : Ξ±) : (a ββ b) β a β€ b :=
by { unfold imp, rw [inf_sup_right], simp }
lemma inf_imp_eq_imp_imp (a b c : Ξ±) : ((a β b) ββ c) = (a ββ (b ββ c)) := by simp [imp, sup_assoc]
lemma le_imp_iff : a β€ (b ββ c) β a β b β€ c :=
by rw [imp, sup_comm, is_compl_compl.le_sup_right_iff_inf_left_le]
lemma biimp_mp (a b : Ξ±) : (a ββ b) β€ (a ββ b) := inf_le_left
lemma biimp_mpr (a b : Ξ±) : (a ββ b) β€ (b ββ a) := inf_le_right
lemma biimp_comm (a b : Ξ±) : (a ββ b) = (b ββ a) :=
by {unfold lattice.biimp, rw inf_comm}
@[simp] lemma biimp_eq_top_iff : a ββ b = β€ β a = b :=
by simp [biimp, β le_antisymm_iff]
@[simp] lemma biimp_self (a : Ξ±) : a ββ a = β€ := biimp_eq_top_iff.2 rfl
lemma biimp_symm : a β€ (b ββ c) β a β€ (c ββ b) := by rw biimp_comm
lemma compl_symm_diff (a b : Ξ±) : (a β b)αΆ = a ββ b :=
by simp only [biimp, imp, symm_diff, sdiff_eq, compl_sup, compl_inf, compl_compl]
lemma compl_biimp (a b : Ξ±) : (a ββ b)αΆ = a β b := by rw [β compl_symm_diff, compl_compl]
@[simp] lemma compl_biimp_compl : aαΆ ββ bαΆ = a ββ b := by simp [biimp, inf_comm]
end lattice
|