Documentation

LeanCourse.MIL.C07_Hierarchies.S01_Basics

class One₁ (α : Type) :
  • one : α

    The element one

Instances
    class One₂ (α : Type) :
    • one : α

      The element one

    Instances

      The element one

      Equations
      Instances For
        class Dia₁ (α : Type) :
        • dia : ααα
        Instances
          class Semigroup₁ (α : Type) :
          • toDia₁ : Dia₁ α
          • dia_assoc : ∀ (a b c : α), a b c = a (b c)

            Diamond is associative

          Instances
            theorem Semigroup₁.dia_assoc {α : Type} [self : Semigroup₁ α] (a : α) (b : α) (c : α) :
            a b c = a (b c)

            Diamond is associative

            class Semigroup₂ (α : Type) extends Dia₁ :
            • dia : ααα
            • dia_assoc : ∀ (a b c : α), a b c = a (b c)

              Diamond is associative

            Instances
              theorem Semigroup₂.dia_assoc {α : Type} [self : Semigroup₂ α] (a : α) (b : α) (c : α) :
              a b c = a (b c)

              Diamond is associative

              class DiaOneClass₁ (α : Type) extends One₁ , Dia₁ :
              • one : α
              • dia : ααα
              • one_dia : ∀ (a : α), 𝟙 a = a

                One is a left neutral element for diamond.

              • dia_one : ∀ (a : α), a 𝟙 = a

                One is a right neutral element for diamond

              Instances
                theorem DiaOneClass₁.one_dia {α : Type} [self : DiaOneClass₁ α] (a : α) :
                𝟙 a = a

                One is a left neutral element for diamond.

                theorem DiaOneClass₁.dia_one {α : Type} [self : DiaOneClass₁ α] (a : α) :
                a 𝟙 = a

                One is a right neutral element for diamond

                class Monoid₁ (α : Type) extends Semigroup₁ , One₁ :
                • toDia₁ : Dia₁ α
                • dia_assoc : ∀ (a b c : α), a b c = a (b c)
                • one : α
                • one_dia : ∀ (a : α), 𝟙 a = a

                  One is a left neutral element for diamond.

                • dia_one : ∀ (a : α), a 𝟙 = a

                  One is a right neutral element for diamond

                Instances
                  class Monoid₂ (α : Type) :
                  Instances
                    class Inv₁ (α : Type) :
                    • inv : αα

                      The inversion function

                    Instances

                      The inversion function

                      Equations
                      Instances For
                        class Group₁ (G : Type) extends Monoid₁ , Inv₁ :
                        Instances
                          theorem Group₁.inv_dia {G : Type} [self : Group₁ G] (a : G) :
                          theorem left_inv_eq_right_inv₁ {M : Type} [Monoid₁ M] {a : M} {b : M} {c : M} (hba : b a = 𝟙) (hac : a c = 𝟙) :
                          b = c
                          theorem inv_eq_of_dia {G : Type} [Group₁ G] {a : G} {b : G} (h : a b = 𝟙) :
                          a⁻¹ = b
                          theorem dia_inv {G : Type} [Group₁ G] (a : G) :
                          class AddSemigroup₃ (α : Type) extends Add :
                          • add : ααα
                          • add_assoc₃ : ∀ (a b c : α), a + b + c = a + (b + c)

                            Addition is associative

                          Instances
                            theorem AddSemigroup₃.add_assoc₃ {α : Type} [self : AddSemigroup₃ α] (a : α) (b : α) (c : α) :
                            a + b + c = a + (b + c)

                            Addition is associative

                            class Semigroup₃ (α : Type) extends Mul :
                            • mul : ααα
                            • mul_assoc₃ : ∀ (a b c : α), a * b * c = a * (b * c)

                              Multiplication is associative

                            Instances
                              theorem Semigroup₃.mul_assoc₃ {α : Type} [self : Semigroup₃ α] (a : α) (b : α) (c : α) :
                              a * b * c = a * (b * c)

                              Multiplication is associative

                              class AddMonoid₃ (α : Type) extends AddSemigroup₃ , Zero :
                              • add : ααα
                              • add_assoc₃ : ∀ (a b c : α), a + b + c = a + (b + c)
                              • zero : α
                              • zero_add : ∀ (a : α), 0 + a = a

                                Zero is a left neutral element for addition

                              • add_zero : ∀ (a : α), a + 0 = a

                                Zero is a right neutral element for addition

                              Instances
                                class Monoid₃ (α : Type) extends Semigroup₃ , One :
                                • mul : ααα
                                • mul_assoc₃ : ∀ (a b c : α), a * b * c = a * (b * c)
                                • one : α
                                • one_mul : ∀ (a : α), 1 * a = a

                                  One is a left neutral element for multiplication

                                • mul_one : ∀ (a : α), a * 1 = a

                                  One is a right neutral element for multiplication

                                Instances
                                  theorem left_neg_eq_right_neg' {M : Type} [AddMonoid₃ M] {a : M} {b : M} {c : M} (hba : b + a = 0) (hac : a + c = 0) :
                                  b = c
                                  theorem left_inv_eq_right_inv' {M : Type} [Monoid₃ M] {a : M} {b : M} {c : M} (hba : b * a = 1) (hac : a * c = 1) :
                                  b = c
                                  • add : ααα
                                  • add_assoc₃ : ∀ (a b c : α), a + b + c = a + (b + c)
                                  • add_comm : ∀ (a b : α), a + b = b + a
                                  Instances
                                    theorem AddCommSemigroup₃.add_comm {α : Type} [self : AddCommSemigroup₃ α] (a : α) (b : α) :
                                    a + b = b + a
                                    class CommSemigroup₃ (α : Type) extends Semigroup₃ :
                                    • mul : ααα
                                    • mul_assoc₃ : ∀ (a b c : α), a * b * c = a * (b * c)
                                    • mul_comm : ∀ (a b : α), a * b = b * a
                                    Instances
                                      theorem CommSemigroup₃.mul_comm {α : Type} [self : CommSemigroup₃ α] (a : α) (b : α) :
                                      a * b = b * a
                                      class AddCommMonoid₃ (α : Type) extends AddMonoid₃ :
                                      • add : ααα
                                      • add_assoc₃ : ∀ (a b c : α), a + b + c = a + (b + c)
                                      • zero : α
                                      • zero_add : ∀ (a : α), 0 + a = a
                                      • add_zero : ∀ (a : α), a + 0 = a
                                      • add_comm : ∀ (a b : α), a + b = b + a
                                      Instances
                                        class CommMonoid₃ (α : Type) extends Monoid₃ :
                                        • mul : ααα
                                        • mul_assoc₃ : ∀ (a b c : α), a * b * c = a * (b * c)
                                        • one : α
                                        • one_mul : ∀ (a : α), 1 * a = a
                                        • mul_one : ∀ (a : α), a * 1 = a
                                        • mul_comm : ∀ (a b : α), a * b = b * a
                                        Instances
                                          class AddGroup₃ (G : Type) extends AddMonoid₃ , Neg :
                                          • add : GGG
                                          • add_assoc₃ : ∀ (a b c : G), a + b + c = a + (b + c)
                                          • zero : G
                                          • zero_add : ∀ (a : G), 0 + a = a
                                          • add_zero : ∀ (a : G), a + 0 = a
                                          • neg : GG
                                          • neg_add : ∀ (a : G), -a + a = 0
                                          Instances
                                            @[simp]
                                            theorem AddGroup₃.neg_add {G : Type} [self : AddGroup₃ G] (a : G) :
                                            -a + a = 0
                                            class Group₃ (G : Type) extends Monoid₃ , Inv :
                                            • mul : GGG
                                            • mul_assoc₃ : ∀ (a b c : G), a * b * c = a * (b * c)
                                            • one : G
                                            • one_mul : ∀ (a : G), 1 * a = a
                                            • mul_one : ∀ (a : G), a * 1 = a
                                            • inv : GG
                                            • inv_mul : ∀ (a : G), a⁻¹ * a = 1
                                            Instances
                                              @[simp]
                                              theorem Group₃.inv_mul {G : Type} [self : Group₃ G] (a : G) :
                                              a⁻¹ * a = 1
                                              theorem neg_eq_of_add {G : Type} [AddGroup₃ G] {a : G} {b : G} (h : a + b = 0) :
                                              -a = b
                                              theorem inv_eq_of_mul {G : Type} [Group₃ G] {a : G} {b : G} (h : a * b = 1) :
                                              a⁻¹ = b
                                              @[simp]
                                              theorem AddGroup₃.add_neg {G : Type} [AddGroup₃ G] {a : G} :
                                              a + -a = 0
                                              @[simp]
                                              theorem Group₃.mul_inv {G : Type} [Group₃ G] {a : G} :
                                              a * a⁻¹ = 1
                                              theorem add_left_cancel₃ {G : Type} [AddGroup₃ G] {a : G} {b : G} {c : G} (h : a + b = a + c) :
                                              b = c
                                              theorem mul_left_cancel₃ {G : Type} [Group₃ G] {a : G} {b : G} {c : G} (h : a * b = a * c) :
                                              b = c
                                              theorem add_right_cancel₃ {G : Type} [AddGroup₃ G] {a : G} {b : G} {c : G} (h : b + a = c + a) :
                                              b = c
                                              theorem mul_right_cancel₃ {G : Type} [Group₃ G] {a : G} {b : G} {c : G} (h : b * a = c * a) :
                                              b = c
                                              class AddCommGroup₃ (G : Type) extends AddGroup₃ :
                                              • add : GGG
                                              • add_assoc₃ : ∀ (a b c : G), a + b + c = a + (b + c)
                                              • zero : G
                                              • zero_add : ∀ (a : G), 0 + a = a
                                              • add_zero : ∀ (a : G), a + 0 = a
                                              • neg : GG
                                              • neg_add : ∀ (a : G), -a + a = 0
                                              • add_comm : ∀ (a b : G), a + b = b + a
                                              Instances
                                                class CommGroup₃ (G : Type) extends Group₃ :
                                                • mul : GGG
                                                • mul_assoc₃ : ∀ (a b c : G), a * b * c = a * (b * c)
                                                • one : G
                                                • one_mul : ∀ (a : G), 1 * a = a
                                                • mul_one : ∀ (a : G), a * 1 = a
                                                • inv : GG
                                                • inv_mul : ∀ (a : G), a⁻¹ * a = 1
                                                • mul_comm : ∀ (a b : G), a * b = b * a
                                                Instances
                                                  class Ring₃ (R : Type) extends AddGroup₃ , Monoid₃ :
                                                  • add : RRR
                                                  • add_assoc₃ : ∀ (a b c : R), a + b + c = a + (b + c)
                                                  • zero : R
                                                  • zero_add : ∀ (a : R), 0 + a = a
                                                  • add_zero : ∀ (a : R), a + 0 = a
                                                  • neg : RR
                                                  • neg_add : ∀ (a : R), -a + a = 0
                                                  • mul : RRR
                                                  • mul_assoc₃ : ∀ (a b c : R), a * b * c = a * (b * c)
                                                  • one : R
                                                  • one_mul : ∀ (a : R), 1 * a = a
                                                  • mul_one : ∀ (a : R), a * 1 = a
                                                  • zero_mul : ∀ (a : R), 0 * a = 0

                                                    Zero is a left absorbing element for multiplication

                                                  • mul_zero : ∀ (a : R), a * 0 = 0

                                                    Zero is a right absorbing element for multiplication

                                                  • left_distrib : ∀ (a b c : R), a * (b + c) = a * b + a * c

                                                    Multiplication is left distributive over addition

                                                  • right_distrib : ∀ (a b c : R), (a + b) * c = a * c + b * c

                                                    Multiplication is right distributive over addition

                                                  Instances
                                                    theorem Ring₃.left_distrib {R : Type} [self : Ring₃ R] (a : R) (b : R) (c : R) :
                                                    a * (b + c) = a * b + a * c

                                                    Multiplication is left distributive over addition

                                                    theorem Ring₃.right_distrib {R : Type} [self : Ring₃ R] (a : R) (b : R) (c : R) :
                                                    (a + b) * c = a * c + b * c

                                                    Multiplication is right distributive over addition

                                                    Equations
                                                    class LE₁ (α : Type) :
                                                    • le : ααProp

                                                      The Less-or-Equal relation.

                                                    Instances

                                                      The Less-or-Equal relation.

                                                      Equations
                                                      Instances For
                                                        class Preorder₁ (α : Type) :
                                                          Instances
                                                            class PartialOrder₁ (α : Type) :
                                                              Instances
                                                                  Instances
                                                                    class SMul₃ (α : Type) (β : Type) :
                                                                    • smul : αββ

                                                                      Scalar multiplication

                                                                    Instances
                                                                      class Module₁ (R : Type) [Ring₃ R] (M : Type) [AddCommGroup₃ M] extends SMul₃ :
                                                                      • smul : RMM
                                                                      • zero_smul : ∀ (m : M), 0 m = 0
                                                                      • one_smul : ∀ (m : M), 1 m = m
                                                                      • mul_smul : ∀ (a b : R) (m : M), (a * b) m = a b m
                                                                      • add_smul : ∀ (a b : R) (m : M), (a + b) m = a m + b m
                                                                      • smul_add : ∀ (a : R) (m n : M), a (m + n) = a m + a n
                                                                      Instances
                                                                        theorem Module₁.zero_smul {R : Type} :
                                                                        ∀ {inst : Ring₃ R} {M : Type} {inst_1 : AddCommGroup₃ M} [self : Module₁ R M] (m : M), 0 m = 0
                                                                        theorem Module₁.one_smul {R : Type} :
                                                                        ∀ {inst : Ring₃ R} {M : Type} {inst_1 : AddCommGroup₃ M} [self : Module₁ R M] (m : M), 1 m = m
                                                                        theorem Module₁.mul_smul {R : Type} :
                                                                        ∀ {inst : Ring₃ R} {M : Type} {inst_1 : AddCommGroup₃ M} [self : Module₁ R M] (a b : R) (m : M), (a * b) m = a b m
                                                                        theorem Module₁.add_smul {R : Type} :
                                                                        ∀ {inst : Ring₃ R} {M : Type} {inst_1 : AddCommGroup₃ M} [self : Module₁ R M] (a b : R) (m : M), (a + b) m = a m + b m
                                                                        theorem Module₁.smul_add {R : Type} :
                                                                        ∀ {inst : Ring₃ R} {M : Type} {inst_1 : AddCommGroup₃ M} [self : Module₁ R M] (a : R) (m n : M), a (m + n) = a m + a n
                                                                        instance selfModule (R : Type) [Ring₃ R] :
                                                                        Equations
                                                                        def nsmul₁ {M : Type u_1} [Zero M] [Add M] :
                                                                        MM
                                                                        Equations
                                                                        Instances For
                                                                          def zsmul₁ {M : Type u_1} [Zero M] [Add M] [Neg M] :
                                                                          MM
                                                                          Equations
                                                                          Instances For
                                                                            Equations
                                                                            class AddMonoid₄ (M : Type) extends AddSemigroup₃ , Zero :
                                                                            • add : MMM
                                                                            • add_assoc₃ : ∀ (a b c : M), a + b + c = a + (b + c)
                                                                            • zero : M
                                                                            • zero_add : ∀ (a : M), 0 + a = a

                                                                              Zero is a left neutral element for addition

                                                                            • add_zero : ∀ (a : M), a + 0 = a

                                                                              Zero is a right neutral element for addition

                                                                            • nsmul : MM

                                                                              Multiplication by a natural number.

                                                                            • nsmul_zero : ∀ (x : M), AddMonoid₄.nsmul 0 x = 0

                                                                              Multiplication by (0 : ℕ) gives 0.

                                                                            • nsmul_succ : ∀ (n : ) (x : M), AddMonoid₄.nsmul (n + 1) x = x + AddMonoid₄.nsmul n x

                                                                              Multiplication by (n + 1 : ℕ) behaves as expected.

                                                                            Instances
                                                                              theorem AddMonoid₄.nsmul_zero {M : Type} [self : AddMonoid₄ M] (x : M) :

                                                                              Multiplication by (0 : ℕ) gives 0.

                                                                              theorem AddMonoid₄.nsmul_succ {M : Type} [self : AddMonoid₄ M] (n : ) (x : M) :

                                                                              Multiplication by (n + 1 : ℕ) behaves as expected.

                                                                              instance mySMul {M : Type} [AddMonoid₄ M] :
                                                                              Equations
                                                                              • mySMul = { smul := AddMonoid₄.nsmul }
                                                                              Equations