Symmetric difference and bi-implication #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines the symmetric difference and bi-implication operators in (co-)Heyting algebras.
Examples #
Some examples are
- The symmetric difference of two sets is the set of elements that are in either but not both.
- The symmetric difference on propositions is
xor
. - The symmetric difference on
bool
isbxor
. - The equivalence of propositions. Two propositions are equivalent if they imply each other.
- The symmetric difference translates to addition when considering a Boolean algebra as a Boolean ring.
Main declarations #
symm_diff
: The symmetric difference operator, defined as(a \ b) ⊔ (b \ a)
bihimp
: The bi-implication operator, defined as(b ⇨ a) ⊓ (a ⇨ b)
In generalized Boolean algebras, the symmetric difference operator is:
symm_diff_comm
: commutative, andsymm_diff_assoc
: associative.
Notations #
References #
The proof of associativity follows the note "Associativity of the Symmetric Difference of Sets: A Proof from the Book" by John McCuan:
Tags #
boolean ring, generalized boolean algebra, boolean algebra, symmetric difference, bi-implication, Heyting
@[simp]
theorem
to_dual_symm_diff
{α : Type u_2}
[generalized_coheyting_algebra α]
(a b : α) :
⇑order_dual.to_dual (a ∆ b) = ⇑order_dual.to_dual a ⇔ ⇑order_dual.to_dual b
@[simp]
theorem
of_dual_bihimp
{α : Type u_2}
[generalized_coheyting_algebra α]
(a b : αᵒᵈ) :
⇑order_dual.of_dual (a ⇔ b) = ⇑order_dual.of_dual a ∆ ⇑order_dual.of_dual b
@[protected, instance]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
symm_diff_le
{α : Type u_2}
[generalized_coheyting_algebra α]
{a b c : α}
(ha : a ≤ b ⊔ c)
(hb : b ≤ a ⊔ c) :
@[simp]
theorem
disjoint.symm_diff_eq_sup
{α : Type u_2}
[generalized_coheyting_algebra α]
{a b : α}
(h : disjoint a b) :
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
to_dual_bihimp
{α : Type u_2}
[generalized_heyting_algebra α]
(a b : α) :
⇑order_dual.to_dual (a ⇔ b) = ⇑order_dual.to_dual a ∆ ⇑order_dual.to_dual b
@[simp]
theorem
of_dual_symm_diff
{α : Type u_2}
[generalized_heyting_algebra α]
(a b : αᵒᵈ) :
⇑order_dual.of_dual (a ∆ b) = ⇑order_dual.of_dual a ⇔ ⇑order_dual.of_dual b
@[protected, instance]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
codisjoint.bihimp_eq_inf
{α : Type u_2}
[generalized_heyting_algebra α]
{a b : α}
(h : codisjoint a b) :
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
is_compl.symm_diff_eq_top
{α : Type u_2}
[coheyting_algebra α]
{a b : α}
(h : is_compl a b) :
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[protected, instance]
@[simp]
@[simp]
@[simp]
theorem
symm_diff_left_involutive
{α : Type u_2}
[generalized_boolean_algebra α]
(a : α) :
function.involutive (λ (_x : α), _x ∆ a)
theorem
symm_diff_left_injective
{α : Type u_2}
[generalized_boolean_algebra α]
(a : α) :
function.injective (λ (_x : α), _x ∆ a)
theorem
symm_diff_left_surjective
{α : Type u_2}
[generalized_boolean_algebra α]
(a : α) :
function.surjective (λ (_x : α), _x ∆ a)
@[simp]
@[simp]
@[simp]
@[simp]
@[protected]
theorem
disjoint.symm_diff_left
{α : Type u_2}
[generalized_boolean_algebra α]
{a b c : α}
(ha : disjoint a c)
(hb : disjoint b c) :
@[protected]
theorem
disjoint.symm_diff_right
{α : Type u_2}
[generalized_boolean_algebra α]
{a b c : α}
(ha : disjoint a b)
(hb : disjoint a c) :
theorem
symm_diff_eq_iff_sdiff_eq
{α : Type u_2}
[generalized_boolean_algebra α]
{a b c : α}
(ha : a ≤ c) :
@[simp]
theorem
codisjoint_bihimp_sup
{α : Type u_2}
[boolean_algebra α]
(a b : α) :
codisjoint (a ⇔ b) (a ⊔ b)
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
bihimp_le_iff_left
{α : Type u_2}
[boolean_algebra α]
(a b : α) :
a ⇔ b ≤ a ↔ codisjoint a b
@[simp]
theorem
bihimp_le_iff_right
{α : Type u_2}
[boolean_algebra α]
(a b : α) :
a ⇔ b ≤ b ↔ codisjoint a b
@[protected, instance]
@[simp]
@[simp]
@[simp]
theorem
bihimp_left_involutive
{α : Type u_2}
[boolean_algebra α]
(a : α) :
function.involutive (λ (_x : α), _x ⇔ a)
theorem
bihimp_left_injective
{α : Type u_2}
[boolean_algebra α]
(a : α) :
function.injective (λ (_x : α), _x ⇔ a)
theorem
bihimp_left_surjective
{α : Type u_2}
[boolean_algebra α]
(a : α) :
function.surjective (λ (_x : α), _x ⇔ a)
@[simp]
@[simp]
@[simp]
@[simp]
@[protected]
theorem
codisjoint.bihimp_left
{α : Type u_2}
[boolean_algebra α]
{a b c : α}
(ha : codisjoint a c)
(hb : codisjoint b c) :
codisjoint (a ⇔ b) c
@[protected]
theorem
codisjoint.bihimp_right
{α : Type u_2}
[boolean_algebra α]
{a b c : α}
(ha : codisjoint a b)
(hb : codisjoint a c) :
codisjoint a (b ⇔ c)
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
disjoint.le_symm_diff_sup_symm_diff_left
{α : Type u_2}
[boolean_algebra α]
{a b c : α}
(h : disjoint a b) :
theorem
disjoint.le_symm_diff_sup_symm_diff_right
{α : Type u_2}
[boolean_algebra α]
{a b c : α}
(h : disjoint b c) :
theorem
codisjoint.bihimp_inf_bihimp_le_left
{α : Type u_2}
[boolean_algebra α]
{a b c : α}
(h : codisjoint a b) :
theorem
codisjoint.bihimp_inf_bihimp_le_right
{α : Type u_2}
[boolean_algebra α]
{a b c : α}
(h : codisjoint b c) :
Prod #
@[simp]
theorem
symm_diff_fst
{α : Type u_2}
{β : Type u_3}
[generalized_coheyting_algebra α]
[generalized_coheyting_algebra β]
(a b : α × β) :
@[simp]
theorem
symm_diff_snd
{α : Type u_2}
{β : Type u_3}
[generalized_coheyting_algebra α]
[generalized_coheyting_algebra β]
(a b : α × β) :
@[simp]
theorem
bihimp_fst
{α : Type u_2}
{β : Type u_3}
[generalized_heyting_algebra α]
[generalized_heyting_algebra β]
(a b : α × β) :
@[simp]
theorem
bihimp_snd
{α : Type u_2}
{β : Type u_3}
[generalized_heyting_algebra α]
[generalized_heyting_algebra β]
(a b : α × β) :