Documentation

equational_theories.MagmaLaw

structure Law.MagmaLaw (α : Type u_1) :
Type u_1
Instances For
    theorem Law.MagmaLaw.ext {α : Type u_1} {x y : Law.MagmaLaw α} (lhs : x.lhs = y.lhs) (rhs : x.rhs = y.rhs) :
    x = y
    instance Law.instDecidableEqMagmaLaw {α✝ : Type u_1} [DecidableEq α✝] :
    Equations
    • Law.instDecidableEqMagmaLaw = Law.decEqMagmaLaw✝
    @[reducible, inline]
    Equations
    Instances For
      Equations
      Equations
      @[reducible, inline]
      abbrev Ctx (α : Type u_1) :
      Type u_1
      Equations
      Instances For
        instance Ctx.Membership (α : Type u_1) :
        Equations
        Equations
        • instSingletonMagmaLawCtx = { singleton := Set.singleton }
        inductive derive {α : Type u} (Γ : Ctx α) :

        Definition for derivability

        Instances For
          inductive derive' {α : Type u} {β : Type v} (Γ : Ctx α) :
          Law.MagmaLaw βType (max u v)

          Definition for derivability where Subst can only be applied to Ax

          Instances For
            def derive_of_derive' {α : Type u_1} {Γ : Ctx α} {E : Law.MagmaLaw α} :
            Γ ⊢' EΓ E
            Equations
            Instances For
              def derive'_of_derive {α : Type u_1} {Γ : Ctx α} {E : Law.MagmaLaw α} (H : Γ E) :
              Γ ⊢' E
              Equations
              Instances For
                def derive'_of_derive.go {α : Type u_1} {Γ : Ctx α} {β : Type u_1} (σ : αFreeMagma β) {E : Law.MagmaLaw α} :
                Γ EΓ ⊢' E.lhs σ E.rhs σ
                Equations
                Instances For
                  def satisfiesPhi {α : Type u_1} {G : Type u_2} [Magma G] (φ : αG) (E : Law.MagmaLaw α) :

                  Definitions of entailment

                  Equations
                  Instances For
                    def satisfies {α : Type u_1} (G : Type u_2) [Magma G] (E : Law.MagmaLaw α) :

                    satisfies G E, or G ⊧ E, means that all evaluations of E in G are true.

                    Equations
                    Instances For
                      def satisfiesSet {α : Type u_1} (G : Type u_2) [Magma G] (Γ : Ctx α) :

                      satisfiesSet G Γ, or G ⊧ Γ, means that G satisfies every element of Γ.

                      Equations
                      Instances For
                        def models {α : Type u_1} {β : Type u_2} (Γ : Ctx α) (E : Law.MagmaLaw β) :

                        models Γ E, or Γ ⊧ E, means that every magma G satisfying Γ also satisfies E.

                        Equations
                        Instances For

                          Notation for derivability and entailment

                          satisfies G E, or G ⊧ E, means that all evaluations of E in G are true.

                          Equations
                          Instances For

                            satisfiesSet G Γ, or G ⊧ Γ, means that G satisfies every element of Γ.

                            Equations
                            Instances For

                              models Γ E, or Γ ⊧ E, means that every magma G satisfying Γ also satisfies E.

                              Equations
                              Instances For

                                Definition for derivability

                                Equations
                                Instances For

                                  Definition for derivability where Subst can only be applied to Ax

                                  Equations
                                  Instances For
                                    def Law.MagmaLaw.symm {α : Type u_1} (l : Law.MagmaLaw α) :
                                    Equations
                                    • l.symm = l.rhs l.lhs
                                    Instances For
                                      @[simp]
                                      theorem Law.MagmaLaw.symm_symm {α : Type u_1} (l : Law.MagmaLaw α) :
                                      l.symm.symm = l
                                      def Law.MagmaLaw.map {α : Type u_1} {β : Type u_2} (f : αβ) :
                                      Equations
                                      Instances For
                                        theorem Law.MagmaLaw.map_id {α : Type u_1} (m : Law.MagmaLaw α) :
                                        theorem Law.MagmaLaw.map_comp {α : Type u_1} {β : Type u_2} {γ : Type u_3} (f : αβ) (g : βγ) (m : Law.MagmaLaw α) :
                                        theorem Law.MagmaLaw.map_symm {α : Type u_1} {β : Type u_2} (f : αβ) (m : Law.MagmaLaw α) :
                                        Law.MagmaLaw.map f m.symm = (Law.MagmaLaw.map f m).symm
                                        def Law.MagmaLaw.Mem {α : Type u_1} (a : α) (m : Law.MagmaLaw α) :
                                        Equations
                                        Instances For
                                          def Law.MagmaLaw.toList {α : Type u_1} (m : Law.MagmaLaw α) :
                                          List α
                                          Equations
                                          • m.toList = m.lhs.toList ++ m.rhs.toList
                                          Instances For
                                            @[simp]
                                            def Law.MagmaLaw.map_toList {α : Type u_1} {β : Type u_2} (m : Law.MagmaLaw α) (f : αβ) :
                                            (Law.MagmaLaw.map f m).toList = List.map f m.toList
                                            Equations
                                            • =
                                            Instances For
                                              def Law.MagmaLaw.elems {α : Type u_1} [DecidableEq α] (m : Law.MagmaLaw α) :
                                              { l : List α // l.Nodup ∀ (a : α), a l Law.MagmaLaw.Mem a m }
                                              Equations
                                              • m.elems = match m.lhs.elems with | l, => match m.rhs.elems with | r, => l r,
                                              Instances For
                                                def Law.MagmaLaw.finEquiv {α : Type u_1} [DecidableEq α] (m : Law.MagmaLaw α) :
                                                Fin (↑m.elems).length { a : α // Law.MagmaLaw.Mem a m }
                                                Equations
                                                Instances For
                                                  def Law.MagmaLaw.pmap {α : Type u_1} {β : Type u_2} (m : Law.MagmaLaw α) :
                                                  ((a : α) → Law.MagmaLaw.Mem a mβ)Law.MagmaLaw β
                                                  Equations
                                                  Instances For
                                                    def Law.MagmaLaw.attach {α : Type u_1} (m : Law.MagmaLaw α) :
                                                    Law.MagmaLaw { a : α // Law.MagmaLaw.Mem a m }
                                                    Equations
                                                    • m.attach = m.pmap Subtype.mk
                                                    Instances For
                                                      theorem Law.MagmaLaw.attach_map_val {α : Type u_1} (m : Law.MagmaLaw α) :
                                                      Law.MagmaLaw.map (fun (x : { a : α // Law.MagmaLaw.Mem a m }) => x) m.attach = m
                                                      def Law.MagmaLaw.toFin {α : Type u_1} [DecidableEq α] (m : Law.MagmaLaw α) :
                                                      Law.MagmaLaw (Fin (↑m.elems).length)
                                                      Equations
                                                      Instances For
                                                        Equations
                                                        Instances For
                                                          theorem Law.MagmaLaw.pmap_eq_map {α : Type u_1} {β : Type u_2} (m : Law.MagmaLaw α) (f : (a : α) → Law.MagmaLaw.Mem a mβ) (g : αβ) (h : ∀ (a : α) (h : Law.MagmaLaw.Mem a m), f a h = g a) :
                                                          m.pmap f = Law.MagmaLaw.map g m
                                                          theorem Law.satisfiesPhi_symm_law {α : Type u_1} {G : Type u_2} [Magma G] (φ : αG) (E : Law.MagmaLaw α) (h : satisfiesPhi φ E) :
                                                          satisfiesPhi φ E.symm
                                                          theorem Law.satisfiesPhi_map {α : Type u_1} {β : Type u_2} {G : Type u_3} [Magma G] {φ : βG} {f : αβ} {E : Law.MagmaLaw α} :
                                                          theorem Law.satisfiesPhi_pmap {α : Type u_1} {β : Type u_2} {G : Type u_3} [Magma G] {φ : βG} {ψ : αG} (E : Law.MagmaLaw α) (f : (a : α) → Law.MagmaLaw.Mem a Eβ) (H : ∀ (a : α) (h : Law.MagmaLaw.Mem a E), φ (f a h) = ψ a) :
                                                          satisfiesPhi φ (E.pmap f) satisfiesPhi ψ E
                                                          theorem Law.satisfiesPhi_pmap_mk {α : Type u_1} {G : Type u_2} [Magma G] {φ : αG} {E : Law.MagmaLaw α} (P : αProp) (hp : ∀ (a : α), Law.MagmaLaw.Mem a EP a) :
                                                          satisfiesPhi (fun (x : Subtype P) => φ x) (E.pmap fun (a : α) (h : Law.MagmaLaw.Mem a E) => a, ) satisfiesPhi φ E
                                                          theorem Law.satisfiesPhi_attach {α : Type u_1} {G : Type u_2} [Magma G] {φ : αG} {E : Law.MagmaLaw α} :
                                                          satisfiesPhi (fun (x : { a : α // Law.MagmaLaw.Mem a E }) => φ x) E.attach satisfiesPhi φ E
                                                          theorem Law.satisfiesPhi_symm {α : Type u_1} {G : Type u_2} [Magma G] (φ : αG) (w₁ w₂ : FreeMagma α) (h : satisfiesPhi φ (w₁ w₂)) :
                                                          satisfiesPhi φ (w₂ w₁)
                                                          theorem Law.satisfiesPhi_evalHom {α G : Type} [Magma G] (φ : αG) (E : Law.MagmaLaw α) (f : G →◇ G) :
                                                          satisfiesPhi (f φ) E f (E.lhs φ) = f (E.rhs φ)
                                                          theorem Law.equiv_satisfiesPhi {α : Type u_1} {G : Type u_2} {H : Type u_3} [Magma G] [Magma H] {φ : αG} (e : G ≃◇ H) {E : Law.MagmaLaw α} :
                                                          satisfiesPhi (e φ) E satisfiesPhi φ E
                                                          theorem Law.satisfies_symm_law {α : Type u_1} {G : Type u_2} [Magma G] {E : Law.MagmaLaw α} (h : G E) :
                                                          G E.symm
                                                          theorem Law.satisfies_map {α : Type u_1} {β : Type u_2} {G : Type u_3} [Magma G] (f : αβ) {E : Law.MagmaLaw α} (h : G E) :
                                                          theorem Law.satisfies_map_injective {α : Type u_1} {β : Type u_2} {G : Type u_3} [Magma G] (f : αβ) (hf : Function.Injective f) {E : Law.MagmaLaw α} :
                                                          theorem Law.satisfies_map_equiv {α : Type u_1} {β : Type u_2} {G : Type u_3} [Magma G] (f : α β) {E : Law.MagmaLaw α} :
                                                          G Law.MagmaLaw.map (⇑f) E G E
                                                          theorem Law.satisfies_pmap_mk {α : Type u_1} {G : Type u_2} [DecidableEq α] [Magma G] {E : Law.MagmaLaw α} (P : αProp) (hp : ∀ (a : α), Law.MagmaLaw.Mem a EP a) :
                                                          (G E.pmap fun (a : α) (h : Law.MagmaLaw.Mem a E) => a, ) G E
                                                          theorem Law.satisfies_attach {α : Type u_1} {G : Type u_2} [DecidableEq α] [Magma G] {E : Law.MagmaLaw α} :
                                                          G E.attach G E
                                                          theorem Law.satisfies_toFin {α : Type u_1} {G : Type u_2} [DecidableEq α] [Magma G] {E : Law.MagmaLaw α} :
                                                          G E.toFin G E
                                                          theorem Law.satisfies_toNat {α : Type u_1} {G : Type u_2} [DecidableEq α] [Magma G] {E : Law.MagmaLaw α} :
                                                          G E.toNat G E
                                                          theorem Law.satisfies_symm {α : Type u_1} {G : Type u_2} [Magma G] {w₁ w₂ : FreeMagma α} (h : G w₁ w₂) :
                                                          G w₂ w₁
                                                          theorem Law.satisfies_equiv {α : Type u_1} {G : Type u_2} {H : Type u_3} [Magma G] [Magma H] (e : G ≃◇ H) {E : Law.MagmaLaw α} :
                                                          G E H E
                                                          theorem Law.satisfiesSet_symm {α : Type u_1} {G : Type u_2} [Magma G] {Γ : Ctx α} (h : G Γ) :
                                                          G (fun (x : Law.MagmaLaw α) => x.symm) '' Γ
                                                          theorem Law.satisfiesSet_singleton {α : Type} {G : Type u_1} [Magma G] {E : Law.MagmaLaw α} :
                                                          G {E} G E
                                                          theorem Law.satisfiesSet_equiv {α : Type u_1} {G : Type u_2} {H : Type u_3} [Magma G] [Magma H] (e : G ≃◇ H) {Γ : Ctx α} :
                                                          G Γ H Γ
                                                          theorem Law.satisfiesSet_toNat {α : Type u_1} {G : Type u_2} [DecidableEq α] [Magma G] {Γ : Ctx α} :
                                                          G (fun (x : Law.MagmaLaw α) => x.toNat) '' Γ G Γ
                                                          theorem Law.models_symm_law {α : Type u_1} {Γ : Ctx α} {E : Law.MagmaLaw α} (h : Γ E) :
                                                          Γ E.symm
                                                          theorem Law.models_symm {α : Type u_1} (Γ : Ctx α) (w₁ w₂ : FreeMagma α) (h : Γ w₁ w₂) :
                                                          Γ w₂ w₁
                                                          theorem Law.models_toNat {α : Type u_1} {β : Type u_2} [DecidableEq β] {Γ : Ctx α} {E : Law.MagmaLaw β} :
                                                          Γ E.toNat Γ E
                                                          theorem Law.toNat_models {α : Type u_1} {β : Type u_2} [DecidableEq α] {Γ : Ctx α} {E : Law.MagmaLaw β} :
                                                          (fun (x : Law.MagmaLaw α) => x.toNat) '' Γ E Γ E
                                                          @[irreducible]
                                                          def Law.derive'_map {α : Type u_1} {β : Type u_2} {γ : Type u_3} {f : βγ} {Γ : Ctx α} {E : Law.MagmaLaw β} :
                                                          Γ ⊢' EΓ ⊢' Law.MagmaLaw.map f E
                                                          Equations
                                                          Instances For
                                                            theorem Law.derive'_map_injective {α : Type u_1} {β : Type u_2} {γ : Type u_3} {f : βγ} (hf : Function.Injective f) {Γ : Ctx α} {E : Law.MagmaLaw β} :
                                                            def Law.derive'_pmap {α : Type u_1} {β : Type u_2} {γ : Type u_3} [DecidableEq β] {Γ : Ctx α} {E : Law.MagmaLaw β} (f : (a : β) → Law.MagmaLaw.Mem a Eγ) :
                                                            Γ ⊢' EΓ ⊢' E.pmap f
                                                            Equations
                                                            Instances For
                                                              def Law.derive'_attach {α : Type u_1} {β : Type u_2} [DecidableEq β] {Γ : Ctx α} {E : Law.MagmaLaw β} :
                                                              Γ ⊢' EΓ ⊢' E.attach
                                                              Equations
                                                              Instances For
                                                                theorem Law.derive'_attach_iff {α : Type u_1} {β : Type u_2} [DecidableEq β] {Γ : Ctx α} {E : Law.MagmaLaw β} :
                                                                Nonempty (Γ ⊢' E.attach) Nonempty (Γ ⊢' E)
                                                                theorem Law.derive'_toFin_iff {α : Type u_1} {β : Type u_2} [DecidableEq β] {Γ : Ctx α} {E : Law.MagmaLaw β} :
                                                                Nonempty (Γ ⊢' E.toFin) Nonempty (Γ ⊢' E)
                                                                theorem Law.derive'_toNat_iff {α : Type u_1} {β : Type u_2} [DecidableEq β] {Γ : Ctx α} {E : Law.MagmaLaw β} :
                                                                Nonempty (Γ ⊢' E.toNat) Nonempty (Γ ⊢' E)
                                                                theorem Law.satisfies_fin_satisfies_nat {n : } (G : Type u_1) [Magma G] (E : Law.MagmaLaw (Fin n)) :
                                                                G Law.MagmaLaw.map Fin.val E G E