Documentation

Bookshelf.Enderton.Set.Relation

Enderton.Set.Relation #

A representation of a relation, i.e. a set of ordered pairs. Like Set, it is assumed a relation is homogeneous.

@[inline, reducible]
abbrev Set.HRelation (α : Type) (β : Type) :

A relation type as defined by Enderton.

We choose to use tuples to represent our ordered pairs, as opposed to Kuratowski's definition of a set.

Not to be confused with the Lean-provided Rel.

Equations
Instances For
    @[inline, reducible]
    abbrev Set.Relation (α : Type) :

    A homogeneous variant of the HRelation type.

    Equations
    Instances For

      Domain and Range #

      def Set.Relation.dom {α : Type} {β : Type} (R : Set.HRelation α β) :
      Set α

      The domain of a Relation.

      Equations
      Instances For
        theorem Set.Relation.mem_pair_imp_fst_mem_dom {α : Type} {β : Type} {x : α} {y : β} {R : Set.HRelation α β} (h : (x, y) R) :

        The first component of any pair in a Relation must be a member of the Relation's domain.

        theorem Set.Relation.dom_exists {α : Type} {β : Type} {x : α} {R : Set.HRelation α β} (hx : x Set.Relation.dom R) :
        ∃ (y : β), (x, y) R

        If x ∈ dom R, there exists some y such that ⟨x, y⟩ ∈ R.

        def Set.Relation.ran {α : Type} {β : Type} (R : Set.HRelation α β) :
        Set β

        The range of a Relation.

        Equations
        Instances For
          theorem Set.Relation.mem_pair_imp_snd_mem_ran {α : Type} {β : Type} {x : α} {y : β} {R : Set.HRelation α β} (h : (x, y) R) :
          theorem Set.Relation.ran_exists {α : Type} {β : Type} {x : β} {R : Set.HRelation α β} (hx : x Set.Relation.ran R) :
          ∃ (t : α), (t, x) R

          If x ∈ ran R, there exists some t such that ⟨t, x⟩ ∈ R.

          def Set.Relation.fld {α : Type} (R : Set.Relation α) :
          Set α

          The field of a Relation.

          Equations
          Instances For
            def Set.Relation.inv {α : Type} {β : Type} (R : Set.HRelation α β) :

            The inverse of a Relation.

            Equations
            Instances For
              @[simp]
              theorem Set.Relation.mem_self_comm_mem_inv {α : Type} {β : Type} {y : β} {x : α} {R : Set.HRelation α β} :
              (y, x) Set.Relation.inv R (x, y) R

              (x, y) is a member of relation R iff (y, x) is a member of R⁻¹.

              @[simp]

              The inverse of the inverse of a Relation is the Relation.

              @[simp]

              For a set F, dom F⁻¹ = ran F.

              @[simp]

              For a set F, ran F⁻¹ = dom F.

              Restriction #

              def Set.Relation.restriction {α : Type} {β : Type} (R : Set.HRelation α β) (A : Set α) :

              The restriction of a Relation to a Set.

              Equations
              Instances For

                Image #

                def Set.Relation.image {α : Type} {β : Type} (R : Set.HRelation α β) (A : Set α) :
                Set β

                The image of a Relation under a Set.

                Equations
                Instances For

                  Single-Rooted and Single-Valued #

                  def Set.Relation.isSingleRooted {α : Type} {β : Type} (R : Set.HRelation α β) :

                  A Relation R is said to be single-rooted iff for all y ∈ ran R, there exists exactly one x such that ⟨x, y⟩ ∈ R.

                  Equations
                  Instances For
                    theorem Set.Relation.single_rooted_eq_unique {α : Type} {β : Type} {R : Set.HRelation α β} {x₁ : α} {x₂ : α} {y : β} (hR : Set.Relation.isSingleRooted R) :
                    (x₁, y) R(x₂, y) Rx₁ = x₂

                    A single-rooted Relation should map the same output to the same input.

                    def Set.Relation.isSingleValued {α : Type} {β : Type} (R : Set.HRelation α β) :

                    A Relation R is said to be single-valued iff for all x ∈ dom R, there exists exactly one y such that ⟨x, y⟩ ∈ R.

                    Notice, a Relation that is single-valued is a function.

                    Equations
                    Instances For
                      theorem Set.Relation.single_valued_eq_unique {α : Type} {β : Type} {R : Set.HRelation α β} {x : α} {y₁ : β} {y₂ : β} (hR : Set.Relation.isSingleValued R) :
                      (x, y₁) R(x, y₂) Ry₁ = y₂

                      A single-valued Relation should map the same input to the same output.

                      For a set F, F⁻¹ is a function iff F is single-rooted.

                      For a relation F, F is a function iff F⁻¹ is single-rooted.

                      The subset of a function must also be a function.

                      Injections #

                      def Set.Relation.isOneToOne {α : Type} {β : Type} (R : Set.HRelation α β) :

                      A Relation R is one-to-one if it is a single-rooted function.

                      Equations
                      Instances For

                        Surjections #

                        structure Set.Relation.mapsInto {α : Type} {β : Type} (F : Set.HRelation α β) (A : Set α) (B : Set β) :

                        Indicates Relation F is a function from A to B.

                        This is usually denoted as F : A → B.

                        Instances For
                          structure Set.Relation.mapsOnto {α : Type} {β : Type} (F : Set.HRelation α β) (A : Set α) (B : Set β) :

                          Indicates Relation F is a function from A to ran F = B.

                          Instances For

                            Composition #

                            def Set.Relation.comp {β : Type} {γ : Type} {α : Type} (F : Set.HRelation β γ) (G : Set.HRelation α β) :

                            The composition of two Relations.

                            Equations
                            Instances For
                              theorem Set.Relation.dom_comp_imp_dom_self {β : Type} {γ : Type} {α : Type} {x : α} {F : Set.HRelation β γ} {G : Set.HRelation α β} :

                              If x ∈ dom (F ∘ G), then x ∈ dom G.

                              theorem Set.Relation.ran_comp_imp_ran_self {β : Type} {γ : Type} {α : Type} {y : γ} {F : Set.HRelation β γ} {G : Set.HRelation α β} :

                              If y ∈ ran (F ∘ G), then y ∈ ran F.

                              theorem Set.Relation.comp_assoc {γ : Type} {δ : Type} {β : Type} {α : Type} {R : Set.HRelation γ δ} {S : Set.HRelation β γ} {T : Set.HRelation α β} :

                              Composition of functions is associative.

                              The composition of two functions is itself a function.

                              The composition of two one-to-one Relations is one-to-one.

                              For Relations F and G, (F ∘ G)⁻¹ = G⁻¹ ∘ F⁻¹.

                              Ordered Pairs #

                              Convert a Relation into an equivalent representation using OrderedPairs.

                              Equations
                              Instances For

                                Equivalence Classes #

                                def Set.Relation.isReflexive {α : Type} (R : Set.Relation α) (A : Set α) :

                                A binary Relation R is reflexive on A iff xRx for all x ∈ A.

                                Equations
                                Instances For

                                  A binary Relation R is symmetric iff whenever xRy then yRx.

                                  Equations
                                  Instances For

                                    A binary Relation R is transitive iff whenever xRy and yRz, then xRz.

                                    Equations
                                    Instances For
                                      structure Set.Relation.isEquivalence {α : Type} (R : Set.Relation α) (A : Set α) :

                                      Relation R is an equivalence relation on set A iff R is a binary relation on A that is relexive on A, symmetric, and transitive.

                                      Instances For
                                        def Set.Relation.neighborhood {α : Type} (R : Set.Relation α) (x : α) :
                                        Set α

                                        A set of members related to x via Relation R.

                                        The term "neighborhood" here was chosen to reflect this relationship between x and the members of the set. It isn't standard in anyway.

                                        Equations
                                        Instances For
                                          theorem Set.Relation.neighborhood_self_mem {α : Type} {x : α} {R : Set.Relation α} {A : Set α} (hR : Set.Relation.isEquivalence R A) (hx : x A) :

                                          The neighborhood with some respect to an equivalence relation R on set A and member x contains x.

                                          theorem Set.Relation.neighborhood_eq_iff_mem_relate {α : Type} {x : α} {y : α} {R : Set.Relation α} {A : Set α} (hR : Set.Relation.isEquivalence R A) :

                                          Assume that R is an equivalence relation on A and that x and y belong to A. Then [x]_R = [y]_R ↔ xRy.

                                          theorem Set.Relation.neighborhood_mem_imp_relate {α : Type} {x : α} {z : α} {y : α} {R : Set.Relation α} {A : Set α} (hR : Set.Relation.isEquivalence R A) (hx : x Set.Relation.neighborhood R z) (hy : y Set.Relation.neighborhood R z) :
                                          (x, y) R

                                          Assume that R is an equivalence relation on A. If two sets x and y belong to the same neighborhood, then xRy.

                                          structure Set.Relation.Partition {α : Type u_1} (P : Set (Set α)) (A : Set α) :

                                          A partition Π of a set A is a set of nonempty subsets of A that is disjoint and exhaustive.

                                          • p_subset : pP, p A
                                          • nonempty : pP, Set.Nonempty p
                                          • disjoint : aP, bP, a ba b =
                                          • exhaustive : aA, ∃ p ∈ P, a p
                                          Instances For
                                            theorem Set.Relation.partition_mem_mem_eq {α : Type u_1} {x : α} {P : Set (Set α)} {A : Set α} (hP : Set.Relation.Partition P A) (hx : x A) :
                                            ∃! (B : Set α), B P x B

                                            Membership of sets within P is unique.

                                            def Set.Relation.modEquiv {α : Type} {A : Set α} {R : Set.Relation α} :

                                            The partition A / R induced by an equivalence relation R.

                                            Equations
                                            Instances For

                                              Show the sets formed by modEquiv do indeed form a partition.