Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
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