Documentation

Cslib.Foundations.Data.Relation

theorem WellFounded.ofTransGen {α : Type u_1} {r : ααProp} (trans_wf : WellFounded (Relation.TransGen r)) :
WellFounded r
@[simp]
theorem WellFounded.iff_transGen {α : Type u_1} {r : ααProp} :
WellFounded (Relation.TransGen r) WellFounded r

Relations #

References #

def Relation.emptyHRelation {α : Sort u} {β : Sort v} :
αβProp

The empty (heterogeneous) relation, which always returns False.

Equations
Instances For
    theorem Relation.ReflGen.to_eqvGen {α : Type u_1} {r : ααProp} {a b : α} (h : ReflGen r a b) :
    EqvGen r a b
    theorem Relation.TransGen.to_eqvGen {α : Type u_1} {r : ααProp} {a b : α} (h : TransGen r a b) :
    EqvGen r a b
    theorem Relation.ReflTransGen.to_eqvGen {α : Type u_1} {r : ααProp} {a b : α} (h : ReflTransGen r a b) :
    EqvGen r a b
    theorem Relation.SymmGen.to_eqvGen {α : Type u_1} {r : ααProp} {a b : α} (h : SymmGen r a b) :
    EqvGen r a b
    @[reducible, inline]
    abbrev Relation.MJoin {α : Type u_1} (r : ααProp) :
    ααProp

    The join of the reflexive transitive closure. This is not named in Mathlib, but see #loogle Relation.Join (Relation.ReflTransGen ?r)

    Equations
    Instances For
      theorem Relation.MJoin.refl {α : Type u_1} {r : ααProp} (a : α) :
      MJoin r a a
      theorem Relation.MJoin.symm {α : Type u_1} {r : ααProp} :
      Symmetric (MJoin r)
      theorem Relation.MJoin.single {α : Type u_1} {r : ααProp} {a b : α} (h : ReflTransGen r a b) :
      MJoin r a b
      def Relation.UpTo {α : Type u_1} (r s : ααProp) :
      ααProp

      The relation r 'up to' the relation s.

      Equations
      Instances For
        @[reducible, inline]
        abbrev Relation.Diamond {α : Type u_1} (r : ααProp) :

        A relation has the diamond property when all reductions with a common origin are joinable

        Equations
        Instances For
          @[reducible, inline]
          abbrev Relation.Confluent {α : Type u_1} (r : ααProp) :

          A relation is confluent when its reflexive transitive closure has the diamond property.

          Equations
          Instances For
            @[reducible, inline]
            abbrev Relation.SemiConfluent {α : Type u_1} (r : ααProp) :

            A relation is semi-confluent when single and multiple steps with common origin are multi-joinable.

            Equations
            • Relation.SemiConfluent r = ∀ {x y₁ y₂ : α}, Relation.ReflTransGen r x y₂r x y₁Relation.Join (Relation.ReflTransGen r) y₁ y₂
            Instances For
              @[reducible, inline]
              abbrev Relation.ChurchRosser {α : Type u_1} (r : ααProp) :

              A relation has the Church Rosser property when equivalence implies multi-joinability.

              Equations
              • Relation.ChurchRosser r = ∀ {x y : α}, Relation.EqvGen r x yRelation.Join (Relation.ReflTransGen r) x y
              Instances For
                theorem Relation.Diamond.extend {α : Type u_1} {r : ααProp} {a b c : α} (h : Diamond r) :
                ReflTransGen r a br a cJoin (ReflTransGen r) b c

                Extending a multistep reduction by a single step preserves multi-joinability.

                theorem Relation.Diamond.toConfluent {α : Type u_1} {r : ααProp} (h : Diamond r) :

                The diamond property implies confluence.

                theorem Relation.Confluent.toChurchRosser {α : Type u_1} {r : ααProp} (h : Confluent r) :
                theorem Relation.SemiConfluent.toConfluent {α : Type u_1} {r : ααProp} (h : SemiConfluent r) :
                theorem Relation.Confluent_of_unique_end {α : Type u_1} {r : ααProp} {x : α} (h : ∀ (y : α), ReflTransGen r y x) :
                @[reducible, inline]
                abbrev Relation.Reducible {α : Type u_1} (r : ααProp) (x : α) :

                An element is reducible with respect to a relation if there is a value it is related to.

                Equations
                Instances For
                  @[reducible, inline]
                  abbrev Relation.Normal {α : Type u_1} (r : ααProp) (x : α) :

                  An element is normal if it is not reducible.

                  Equations
                  Instances For
                    theorem Relation.Normal_iff {α : Type u_1} (r : ααProp) (x : α) :
                    Normal r x ∀ (y : α), ¬r x y
                    @[reducible, inline]
                    abbrev Relation.Normalizable {α : Type u_1} (r : ααProp) (x : α) :

                    An element is normalizable if it is related to a normal element.

                    Equations
                    Instances For
                      @[reducible, inline]
                      abbrev Relation.Normalizing {α : Type u_1} (r : ααProp) :

                      A relation is normalizing when every element is normalizable.

                      Equations
                      Instances For
                        theorem Relation.Normal.reflTransGen_eq {α : Type u_1} {r : ααProp} {x y : α} (h : Normal r x) (xy : ReflTransGen r x y) :
                        x = y

                        A multi-step from a normal form must be reflexive.

                        theorem Relation.ChurchRosser.normal_eqvGen_reflTransGen {α : Type u_1} {r : ααProp} {x y : α} (cr : ChurchRosser r) (norm : Normal r x) (xy : EqvGen r y x) :
                        ReflTransGen r y x

                        For a Church-Rosser relation, elements in an equivalence class must be multi-step related.

                        theorem Relation.ChurchRosser.normal_eq {α : Type u_1} {r : ααProp} {x y : α} (cr : ChurchRosser r) (nx : Normal r x) (ny : Normal r y) (xy : EqvGen r x y) :
                        x = y

                        For a Church-Rosser relation there is one normal form in each equivalence class.

                        @[implicit_reducible]
                        def Relation.trans_of_subrelation {α : Type u_1} (s s' r : ααProp) (hr : IsTrans α r) (h : Subrelation s r) (h' : Subrelation s' r) :
                        Trans s s' r

                        A pair of subrelations lifts to transitivity on the relation.

                        Equations
                        Instances For
                          @[implicit_reducible]
                          def Relation.trans_of_subrelation_left {α : Type u_1} (s r : ααProp) (hr : IsTrans α r) (h : Subrelation s r) :
                          Trans s r r

                          A subrelation lifts to transitivity on the left of the relation.

                          Equations
                          Instances For
                            @[implicit_reducible]
                            def Relation.trans_of_subrelation_right {α : Type u_1} (s r : ααProp) (hr : IsTrans α r) (h : Subrelation s r) :
                            Trans r s r

                            A subrelation lifts to transitivity on the right of the relation.

                            Equations
                            Instances For
                              theorem Relation.Confluent.equivalence_join_reflTransGen {α : Type u_1} {r : ααProp} (h : Confluent r) :
                              Equivalence (Join (ReflTransGen r))

                              Confluence implies that multi-step joinability is an equivalence.

                              @[reducible, inline]
                              abbrev Relation.Terminating {α : Type u_1} (r : ααProp) :

                              A relation is terminating when the inverse of its transitive closure is well-founded. Note that this is also called Noetherian or strongly normalizing in the literature.

                              Equations
                              Instances For
                                theorem Relation.Terminating.toTransGen {α : Type u_1} {r : ααProp} (ht : Terminating r) :
                                Terminating (TransGen r)
                                theorem Relation.Terminating.ofTransGen {α : Type u_1} {r : ααProp} :
                                Terminating (TransGen r)Terminating r
                                theorem Relation.Terminating.iff_transGen {α : Type u_1} {r : ααProp} :
                                Terminating (TransGen r) Terminating r
                                theorem Relation.Terminating.subrelation {α : Type u_1} {r r' : ααProp} (hr : Terminating r) (h : Subrelation r' r) :
                                theorem Relation.Terminating.isNormalizing {α : Type u_1} {r : ααProp} (h : Terminating r) :
                                theorem Relation.Terminating.isConfluent_iff_all_unique_Normal {α : Type u_1} {r : ααProp} (ht : Terminating r) :
                                Confluent r ∀ (a : α), ∃! n : α, ReflTransGen r a n Normal r n
                                @[reducible, inline]
                                abbrev Relation.Convergent {α : Type u_1} (r : ααProp) :

                                A relation is convergent when it is both confluent and terminating.

                                Equations
                                Instances For
                                  theorem Relation.Convergent.isTerminating {α : Type u_1} {r : ααProp} (h : Convergent r) :
                                  theorem Relation.Convergent.isConfluent {α : Type u_1} {r : ααProp} (h : Convergent r) :
                                  theorem Relation.Convergent.isNormalizing {α : Type u_1} {r : ααProp} (h : Convergent r) :
                                  theorem Relation.Convergent.unique_Normal {α : Type u_1} {r : ααProp} (h : Convergent r) (a : α) :
                                  ∃! n : α, ReflTransGen r a n Normal r n
                                  @[reducible, inline]
                                  abbrev Relation.LocallyConfluent {α : Type u_1} (r : ααProp) :

                                  A relation is locally confluent when all reductions with a common origin are multi-joinable

                                  Equations
                                  Instances For
                                    theorem Relation.LocallyConfluent.Terminating_toConfluent {α : Type u_1} {r : ααProp} (hlc : LocallyConfluent r) (ht : Terminating r) :

                                    Newman's lemma: a terminating, locally confluent relation is confluent.

                                    @[reducible, inline]
                                    abbrev Relation.StronglyConfluent {α : Type u_1} (r : ααProp) :

                                    A relation is strongly confluent when single steps are reflexive- and multi-joinable.

                                    Equations
                                    • Relation.StronglyConfluent r = ∀ {x y₁ y₂ : α}, r x y₁r x y₂∃ (z : α), Relation.ReflGen r y₁ z Relation.ReflTransGen r y₂ z
                                    Instances For
                                      def Relation.Commute {α : Type u_1} (r₁ r₂ : ααProp) :

                                      Generalization of Confluent to two relations.

                                      Equations
                                      • Relation.Commute r₁ r₂ = ∀ {x y₁ y₂ : α}, Relation.ReflTransGen r₁ x y₁Relation.ReflTransGen r₂ x y₂∃ (z : α), Relation.ReflTransGen r₂ y₁ z Relation.ReflTransGen r₁ y₂ z
                                      Instances For
                                        theorem Relation.Commute.toConfluent {α : Type u_1} {r : ααProp} :
                                        def Relation.StronglyCommute {α : Type u_1} (r₁ r₂ : ααProp) :

                                        Generalization of StronglyConfluent to two relations.

                                        Equations
                                        • Relation.StronglyCommute r₁ r₂ = ∀ {x y₁ y₂ : α}, r₁ x y₁r₂ x y₂∃ (z : α), Relation.ReflGen r₂ y₁ z Relation.ReflTransGen r₁ y₂ z
                                        Instances For
                                          def Relation.DiamondCommute {α : Type u_1} (r₁ r₂ : ααProp) :

                                          Generalization of Diamond to two relations.

                                          Equations
                                          • Relation.DiamondCommute r₁ r₂ = ∀ {x y₁ y₂ : α}, r₁ x y₁r₂ x y₂∃ (z : α), r₂ y₁ z r₁ y₂ z
                                          Instances For
                                            theorem Relation.DiamondCommute.toDiamond {α : Type u_1} {r : ααProp} :
                                            theorem Relation.StronglyCommute.extend {α✝ : Type u_2} {r₁ r₂ : α✝α✝Prop} {x y z : α✝} (h : StronglyCommute r₁ r₂) (xy : ReflTransGen r₁ x y) (xz : r₂ x z) :
                                            ∃ (w : α✝), ReflGen r₂ y w ReflTransGen r₁ z w
                                            theorem Relation.StronglyCommute.toCommute {α✝ : Type u_2} {r₁ r₂ : α✝α✝Prop} (h : StronglyCommute r₁ r₂) :
                                            Commute r₁ r₂
                                            theorem Relation.join_inl {α : Type u_1} {r₁ r₂ : ααProp} {a b : α} (r₁_ab : r₁ a b) :
                                            (r₁r₂) a b
                                            theorem Relation.join_inr {α : Type u_1} {r₁ r₂ : ααProp} {a b : α} (r₂_ab : r₂ a b) :
                                            (r₁r₂) a b
                                            theorem Relation.join_inl_reflTransGen {α : Type u_1} {r₁ r₂ : ααProp} {a b : α} (r₁_ab : ReflTransGen r₁ a b) :
                                            ReflTransGen (r₁r₂) a b
                                            theorem Relation.join_inr_reflTransGen {α : Type u_1} {r₁ r₂ : ααProp} {a b : α} (r₂_ab : ReflTransGen r₂ a b) :
                                            ReflTransGen (r₁r₂) a b
                                            theorem Relation.Commute.join_left {α : Type u_1} {r₁ r₂ r₃ : ααProp} (c₁ : Commute r₁ r₃) (c₂ : Commute r₂ r₃) :
                                            Commute (r₁r₂) r₃
                                            theorem Relation.Commute.join_confluent {α : Type u_1} {r₁ r₂ : ααProp} (c₁ : Confluent r₁) (c₂ : Confluent r₂) (comm : Commute r₁ r₂) :
                                            Confluent (r₁r₂)
                                            theorem Relation.reflTransGen_mono_closed {α : Type u_1} {r₁ r₂ : ααProp} (h₁ : Subrelation r₁ r₂) (h₂ : Subrelation r₂ (ReflTransGen r₁)) :
                                            ReflTransGen r₁ = ReflTransGen r₂

                                            If a relation is squeezed by a relation and its multi-step closure, they are multi-step equal

                                            theorem Relation.ReflGen.compRel_symm {α : Type u_1} {r : ααProp} {a b : α} :
                                            ReflGen (SymmGen r) a bReflGen (SymmGen r) b a
                                            @[simp]
                                            theorem Relation.reflTransGen_compRel {α : Type u_1} {r : ααProp} :
                                            ReflTransGen (SymmGen r) = EqvGen r
                                            theorem Relation.RightUnique.toConfluent {α : Type u_1} {r : ααProp} (hr : Relator.RightUnique r) :

                                            Relator.RightUnique corresponds to deterministic reductions, which are confluent, as all multi-reductions with a common origin start the same (this fact is Relation.ReflTransGen.total_of_right_unique.)

                                            This command adds notations for relations. This should not usually be called directly, but from the reduction_sys attribute.

                                            As an example reduction_notation foo "β" will add the notations "⭢β" and "↠β".

                                            Note that the string used will afterwards be registered as a notation. This means that if you have also used this as a constructor name, you will need quotes to access corresponding cases, e.g. «β» in the above example.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              def Relation.reduction_sys :
                                              Lean.ParserDescr

                                              This attribute calls the reduction_notation command for the annotated declaration, such as in:

                                              @[reduction_sys "ₙ", simp]
                                              def PredReduction (a b : ℕ) : Prop := a = b + 1
                                              
                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For