Documentation

Mathlib.Algebra.Ring.BooleanRing

Boolean rings #

A Boolean ring is a ring where multiplication is idempotent. They are equivalent to Boolean algebras.

Main declarations #

Implementation notes #

We provide two ways of turning a Boolean algebra/ring into a Boolean ring/algebra:

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

class BooleanRing (α : Type u_4) extends Ring α :
Type u_4

A Boolean ring is a ring where multiplication is idempotent.

Instances
    theorem BooleanRing.mul_self {α : Type u_1} [BooleanRing α] (a : α) :
    a * a = a
    instance BooleanRing.instIdempotentOpHMul {α : Type u_1} [BooleanRing α] :
    Std.IdempotentOp fun (x1 x2 : α) => x1 * x2
    theorem BooleanRing.add_self {α : Type u_1} [BooleanRing α] (a : α) :
    a + a = 0
    theorem BooleanRing.neg_eq {α : Type u_1} [BooleanRing α] (a : α) :
    -a = a
    theorem BooleanRing.add_eq_zero' {α : Type u_1} [BooleanRing α] (a b : α) :
    a + b = 0 a = b
    @[simp]
    theorem BooleanRing.mul_add_mul {α : Type u_1} [BooleanRing α] (a b : α) :
    a * b + b * a = 0
    theorem BooleanRing.sub_eq_add {α : Type u_1} [BooleanRing α] (a b : α) :
    a - b = a + b
    @[simp]
    theorem BooleanRing.mul_one_add_self {α : Type u_1} [BooleanRing α] (a : α) :
    a * (1 + a) = 0
    @[instance_reducible, instance 100]
    instance BooleanRing.toCommRing {α : Type u_1} [BooleanRing α] :
    Equations

    Turning a Boolean ring into a Boolean algebra #

    def AsBoolAlg (α : Type u_4) :
    Type u_4

    Type synonym to view a Boolean ring as a Boolean algebra.

    Equations
    Instances For
      def toBoolAlg {α : Type u_1} :

      The "identity" equivalence between AsBoolAlg α and α.

      Equations
      Instances For
        def ofBoolAlg {α : Type u_1} :

        The "identity" equivalence between α and AsBoolAlg α.

        Equations
        Instances For
          @[simp]
          theorem toBoolAlg_ofBoolAlg {α : Type u_1} (a : AsBoolAlg α) :
          @[simp]
          theorem ofBoolAlg_toBoolAlg {α : Type u_1} (a : α) :
          theorem toBoolAlg_inj {α : Type u_1} {a b : α} :
          theorem ofBoolAlg_inj {α : Type u_1} {a b : AsBoolAlg α} :
          def AsBoolAlg.rec {α : Type u_1} {motive : AsBoolAlg αSort u_4} (toBoolAlg : (a : α) → motive (toBoolAlg a)) (a : AsBoolAlg α) :
          motive a

          A recursor for AsBoolAlg. Use as induction x.

          Equations
          Instances For
            @[instance_reducible]
            Equations
            @[instance_reducible]
            def BooleanRing.sup {α : Type u_1} [BooleanRing α] :
            Max α

            The join operation in a Boolean ring is x + y + x * y.

            Equations
            Instances For
              @[instance_reducible]
              def BooleanRing.inf {α : Type u_1} [BooleanRing α] :
              Min α

              The meet operation in a Boolean ring is x * y.

              Equations
              Instances For
                theorem BooleanRing.sup_comm {α : Type u_1} [BooleanRing α] (a b : α) :
                ab = ba
                theorem BooleanRing.inf_comm {α : Type u_1} [BooleanRing α] (a b : α) :
                ab = ba
                theorem BooleanRing.sup_assoc {α : Type u_1} [BooleanRing α] (a b c : α) :
                abc = a(bc)
                theorem BooleanRing.inf_assoc {α : Type u_1} [BooleanRing α] (a b c : α) :
                abc = a(bc)
                theorem BooleanRing.sup_inf_self {α : Type u_1} [BooleanRing α] (a b : α) :
                aab = a
                theorem BooleanRing.inf_sup_self {α : Type u_1} [BooleanRing α] (a b : α) :
                a(ab) = a
                theorem BooleanRing.le_sup_inf_aux {α : Type u_1} [BooleanRing α] (a b c : α) :
                (a + b + a * b) * (a + c + a * c) = a + b * c + a * (b * c)
                theorem BooleanRing.le_sup_inf {α : Type u_1} [BooleanRing α] (a b c : α) :
                (ab)(ac)(abc) = abc
                theorem BooleanRing.sup_def {α : Type u_1} [BooleanRing α] (a b : α) :
                ab = a + b + a * b
                theorem BooleanRing.inf_def {α : Type u_1} [BooleanRing α] (a b : α) :
                ab = a * b
                @[instance_reducible]

                The Boolean algebra structure on a Boolean ring.

                The data is defined so that:

                • a ⊔ b unfolds to a + b + a * b
                • a ⊓ b unfolds to a * b
                • a ≤ b unfolds to a + b + a * b = b
                • unfolds to 0
                • unfolds to 1
                • aᶜ unfolds to 1 + a
                • a \ b unfolds to a * (1 + b)
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  @[instance_reducible]
                  Equations
                  • One or more equations did not get rendered due to their size.
                  @[simp]
                  theorem ofBoolAlg_top {α : Type u_1} [BooleanRing α] :
                  @[simp]
                  theorem ofBoolAlg_bot {α : Type u_1} [BooleanRing α] :
                  @[simp]
                  theorem ofBoolAlg_sup {α : Type u_1} [BooleanRing α] (a b : AsBoolAlg α) :
                  @[simp]
                  theorem ofBoolAlg_inf {α : Type u_1} [BooleanRing α] (a b : AsBoolAlg α) :
                  @[simp]
                  theorem ofBoolAlg_compl {α : Type u_1} [BooleanRing α] (a : AsBoolAlg α) :
                  @[simp]
                  theorem ofBoolAlg_sdiff {α : Type u_1} [BooleanRing α] (a b : AsBoolAlg α) :
                  @[simp]
                  theorem ofBoolAlg_symmDiff {α : Type u_1} [BooleanRing α] (a b : AsBoolAlg α) :
                  @[simp]
                  theorem toBoolAlg_zero {α : Type u_1} [BooleanRing α] :
                  @[simp]
                  theorem toBoolAlg_one {α : Type u_1} [BooleanRing α] :
                  @[simp]
                  theorem toBoolAlg_mul {α : Type u_1} [BooleanRing α] (a b : α) :
                  @[simp]
                  theorem toBoolAlg_add_add_mul {α : Type u_1} [BooleanRing α] (a b : α) :
                  toBoolAlg (a + b + a * b) = toBoolAlg atoBoolAlg b
                  @[simp]
                  theorem toBoolAlg_add {α : Type u_1} [BooleanRing α] (a b : α) :
                  def RingHom.asBoolAlg {α : Type u_1} {β : Type u_2} [BooleanRing α] [BooleanRing β] (f : α →+* β) :

                  Turn a ring homomorphism from Boolean rings α to β into a bounded lattice homomorphism from α to β considered as Boolean algebras.

                  Equations
                  Instances For
                    @[simp]
                    theorem RingHom.asBoolAlg_toFun {α : Type u_1} {β : Type u_2} [BooleanRing α] [BooleanRing β] (f : α →+* β) (a✝ : AsBoolAlg α) :
                    f.asBoolAlg a✝ = (toBoolAlg f ofBoolAlg) a✝
                    @[simp]
                    theorem RingHom.asBoolAlg_comp {α : Type u_1} {β : Type u_2} {γ : Type u_3} [BooleanRing α] [BooleanRing β] [BooleanRing γ] (g : β →+* γ) (f : α →+* β) :

                    Turning a Boolean algebra into a Boolean ring #

                    def AsBoolRing (α : Type u_4) :
                    Type u_4

                    Type synonym to view a Boolean ring as a Boolean algebra.

                    Equations
                    Instances For
                      def toBoolRing {α : Type u_1} :

                      The "identity" equivalence between AsBoolRing α and α.

                      Equations
                      Instances For
                        def ofBoolRing {α : Type u_1} :

                        The "identity" equivalence between α and AsBoolRing α.

                        Equations
                        Instances For
                          @[simp]
                          theorem toBoolRing_ofBoolRing {α : Type u_1} (a : AsBoolRing α) :
                          @[simp]
                          theorem ofBoolRing_toBoolRing {α : Type u_1} (a : α) :
                          theorem toBoolRing_inj {α : Type u_1} {a b : α} :
                          theorem ofBoolRing_inj {α : Type u_1} {a b : AsBoolRing α} :
                          def AsBoolRing.rec {α : Type u_1} {motive : AsBoolRing αSort u_4} (toBoolRing : (a : α) → motive (toBoolRing a)) (a : AsBoolRing α) :
                          motive a

                          A recursor for AsBoolRing. Use as induction x.

                          Equations
                          Instances For
                            @[instance_reducible]
                            Equations
                            @[reducible, inline]

                            Every generalized Boolean algebra has the structure of a nonunital commutative ring with the following data:

                            • a + b unfolds to a ∆ b (symmetric difference)
                            • a * b unfolds to a ⊓ b
                            • -a unfolds to a
                            • 0 unfolds to
                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              @[reducible, inline]

                              Every Boolean algebra has the structure of a Boolean ring with the following data:

                              • a + b unfolds to a ∆ b (symmetric difference)
                              • a * b unfolds to a ⊓ b
                              • -a unfolds to a
                              • 0 unfolds to
                              • 1 unfolds to
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                @[instance_reducible]
                                Equations
                                • One or more equations did not get rendered due to their size.
                                @[simp]
                                theorem ofBoolRing_zero {α : Type u_1} [BooleanAlgebra α] :
                                @[simp]
                                theorem ofBoolRing_one {α : Type u_1} [BooleanAlgebra α] :
                                @[simp]
                                theorem ofBoolRing_neg {α : Type u_1} [BooleanAlgebra α] (a : AsBoolRing α) :
                                @[simp]
                                theorem ofBoolRing_add {α : Type u_1} [BooleanAlgebra α] (a b : AsBoolRing α) :
                                @[simp]
                                theorem ofBoolRing_sub {α : Type u_1} [BooleanAlgebra α] (a b : AsBoolRing α) :
                                @[simp]
                                theorem ofBoolRing_mul {α : Type u_1} [BooleanAlgebra α] (a b : AsBoolRing α) :
                                @[simp]
                                @[simp]
                                theorem toBoolRing_bot {α : Type u_1} [BooleanAlgebra α] :
                                @[simp]
                                theorem toBoolRing_top {α : Type u_1} [BooleanAlgebra α] :
                                @[simp]
                                theorem toBoolRing_inf {α : Type u_1} [BooleanAlgebra α] (a b : α) :
                                @[simp]
                                theorem toBoolRing_symmDiff {α : Type u_1} [BooleanAlgebra α] (a b : α) :
                                @[simp]
                                theorem toBoolRing_compl {α : Type u_1} [BooleanAlgebra α] (a : α) :
                                @[simp]
                                theorem toBoolRing_sup {α : Type u_1} [BooleanAlgebra α] (a b : α) :
                                @[simp]
                                theorem toBoolRing_sdiff {α : Type u_1} [BooleanAlgebra α] (a b : α) :

                                Turn a bounded lattice homomorphism from Boolean algebras α to β into a ring homomorphism from α to β considered as Boolean rings.

                                Equations
                                Instances For
                                  @[simp]
                                  theorem BoundedLatticeHom.asBoolRing_apply {α : Type u_1} {β : Type u_2} [BooleanAlgebra α] [BooleanAlgebra β] (f : BoundedLatticeHom α β) (a✝ : AsBoolRing α) :
                                  f.asBoolRing a✝ = (toBoolRing f ofBoolRing) a✝
                                  @[simp]

                                  Equivalence between Boolean rings and Boolean algebras #

                                  Order isomorphism between α considered as a Boolean ring considered as a Boolean algebra and α.

                                  Equations
                                  Instances For

                                    Ring isomorphism between α considered as a Boolean algebra considered as a Boolean ring and α.

                                    Equations
                                    Instances For
                                      @[instance_reducible]
                                      Equations
                                      @[instance_reducible]
                                      Equations
                                      @[instance_reducible]
                                      Equations
                                      @[instance_reducible]
                                      Equations
                                      @[instance_reducible]
                                      Equations
                                      @[instance_reducible]
                                      Equations
                                      @[instance_reducible]
                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      theorem Bool.add_eq_xor (b c : Bool) :
                                      b + c = (b ^^ c)
                                      theorem Bool.neg_eq_id (b : Bool) :
                                      -b = b
                                      theorem Bool.sub_eq_xor (b c : Bool) :
                                      b - c = (b ^^ c)
                                      theorem Bool.mul_eq_and (b c : Bool) :
                                      b * c = (b && c)