Boolean rings #
A Boolean ring is a ring where multiplication is idempotent. They are equivalent to Boolean algebras.
Main declarations #
BooleanRing
: a typeclass for rings where multiplication is idempotent.BooleanRing.toBooleanAlgebra
: Turn a Boolean ring into a Boolean algebra.BooleanAlgebra.toBooleanRing
: Turn a Boolean algebra into a Boolean ring.AsBoolAlg
: Type-synonym for the Boolean algebra associated to a Boolean ring.AsBoolRing
: Type-synonym for the Boolean ring associated to a Boolean algebra.
Implementation notes #
We provide two ways of turning a Boolean algebra/ring into a Boolean ring/algebra:
- Instances on the same type accessible in locales
BooleanAlgebraOfBooleanRing
andBooleanRingOfBooleanAlgebra
. - Type-synonyms
AsBoolAlg
andAsBoolRing
.
At this point in time, it is not clear the first way is useful, but we keep it for educational
purposes and because it is easier than dealing with
ofBoolAlg
/toBoolAlg
/ofBoolRing
/toBoolRing
explicitly.
Tags #
boolean ring, boolean algebra
A Boolean ring is a ring where multiplication is idempotent.
- add : α → α → α
- zero : α
- nsmul : ℕ → α → α
- nsmul_zero : ∀ (x : α), AddMonoid.nsmul 0 x = 0
- nsmul_succ : ∀ (n : ℕ) (x : α), AddMonoid.nsmul (n + 1) x = x + AddMonoid.nsmul n x
- mul : α → α → α
- one : α
- natCast : ℕ → α
- natCast_zero : NatCast.natCast 0 = 0
- natCast_succ : ∀ (n : ℕ), NatCast.natCast (n + 1) = NatCast.natCast n + 1
- npow : ℕ → α → α
- npow_zero : ∀ (x : α), Semiring.npow 0 x = 1
- npow_succ : ∀ (n : ℕ) (x : α), Semiring.npow (n + 1) x = x * Semiring.npow n x
- neg : α → α
- sub : α → α → α
- zsmul : ℤ → α → α
- zsmul_zero' : ∀ (a : α), Ring.zsmul 0 a = 0
- zsmul_succ' : ∀ (n : ℕ) (a : α), Ring.zsmul (Int.ofNat (Nat.succ n)) a = a + Ring.zsmul (Int.ofNat n) a
- zsmul_neg' : ∀ (n : ℕ) (a : α), Ring.zsmul (Int.negSucc n) a = -Ring.zsmul (↑(Nat.succ n)) a
- intCast : ℤ → α
- intCast_ofNat : ∀ (n : ℕ), IntCast.intCast ↑n = ↑n
- intCast_negSucc : ∀ (n : ℕ), IntCast.intCast (Int.negSucc n) = -↑(n + 1)
Multiplication in a boolean ring is idempotent.
Instances
Equations
- (_ : Std.IdempotentOp fun (x x_1 : α) => x * x_1) = (_ : Std.IdempotentOp fun (x x_1 : α) => x * x_1)
Equations
- BooleanRing.toCommRing = let src := inferInstance; CommRing.mk (_ : ∀ (a b : α), a * b = b * a)
Turning a Boolean ring into a Boolean algebra #
The join operation in a Boolean ring is x + y + x * y
.
Instances For
The meet operation in a Boolean ring is x * y
.
Instances For
The Boolean algebra structure on a Boolean ring.
The data is defined so that:
a ⊔ b
unfolds toa + b + a * b
a ⊓ b
unfolds toa * b
a ≤ b
unfolds toa + b + a * b = b
⊥
unfolds to0
⊤
unfolds to1
aᶜ
unfolds to1 + a
a \ b
unfolds toa * (1 + b)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- instBooleanAlgebraAsBoolAlg = BooleanRing.toBooleanAlgebra
Turn a ring homomorphism from Boolean rings α
to β
into a bounded lattice homomorphism
from α
to β
considered as Boolean algebras.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Turning a Boolean algebra into a Boolean ring #
The "identity" equivalence between AsBoolRing α
and α
.
Equations
- toBoolRing = Equiv.refl α
Instances For
The "identity" equivalence between α
and AsBoolRing α
.
Equations
- ofBoolRing = Equiv.refl (AsBoolRing α)
Instances For
Equations
- instInhabitedAsBoolRing = inst
Every generalized Boolean algebra has the structure of a non unital commutative ring with the following data:
a + b
unfolds toa ∆ b
(symmetric difference)a * b
unfolds toa ⊓ b
-a
unfolds toa
0
unfolds to⊥
Equations
- GeneralizedBooleanAlgebra.toNonUnitalCommRing = NonUnitalCommRing.mk (_ : ∀ (x x_1 : α), x ⊓ x_1 = x_1 ⊓ x)
Instances For
Equations
- instNonUnitalCommRingAsBoolRing = GeneralizedBooleanAlgebra.toNonUnitalCommRing
Every Boolean algebra has the structure of a Boolean ring with the following data:
a + b
unfolds toa ∆ b
(symmetric difference)a * b
unfolds toa ⊓ b
-a
unfolds toa
0
unfolds to⊥
1
unfolds to⊤
Equations
- BooleanAlgebra.toBooleanRing = let src := GeneralizedBooleanAlgebra.toNonUnitalCommRing; BooleanRing.mk (_ : ∀ (b : α), b ⊓ b = b)
Instances For
Equations
- instBooleanRingAsBoolRing = BooleanAlgebra.toBooleanRing
Turn a bounded lattice homomorphism from Boolean algebras α
to β
into a ring homomorphism
from α
to β
considered as Boolean rings.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equivalence between Boolean rings and Boolean algebras #
Order isomorphism between α
considered as a Boolean ring considered as a Boolean algebra and
α
.
Equations
- OrderIso.asBoolAlgAsBoolRing α = { toEquiv := ofBoolAlg.trans ofBoolRing, map_rel_iff' := (_ : ∀ {a b : AsBoolAlg (AsBoolRing α)}, ofBoolRing a ≤ ofBoolRing b ↔ a ≤ b) }
Instances For
Ring isomorphism between α
considered as a Boolean algebra considered as a Boolean ring and
α
.
Equations
- One or more equations did not get rendered due to their size.