Documentation

Mathlib.Logic.Relation

Relation closures #

This file defines the reflexive, symmetric, transitive, reflexive transitive and equivalence closures of relations and proves some basic results on them.

Note that this is about unbundled relations, that is terms of types of the form α → β → Prop. For the bundled version, see Rel.

Definitions #

theorem Subrelation.antisymm {α : Type u_1} {r r' : α → α → Prop} (h1 : Subrelation r r') (h2 : Subrelation r' r) :
r = r'
@[deprecated refl (since := "2026-03-27")]
theorem Std.Refl.reflexive {α : Sort u_1} {r : α → α → Prop} [Refl r] (a : α) :
r a a

Alias of refl.

@[deprecated refl (since := "2026-01-09")]
theorem IsRefl.reflexive {α : Sort u_1} {r : α → α → Prop} [Std.Refl r] (a : α) :
r a a

Alias of refl.

theorem Std.Refl.rel_of_ne_imp {α : Type u_1} {r : α → α → Prop} [Refl r] {x y : α} (hr : x ≠ y → r x y) :
r x y

To show a reflexive relation r : α → α → Prop holds over x y : α, it suffices to show it holds when x ≠ y.

@[deprecated Std.Refl.rel_of_ne_imp (since := "2026-03-27")]
theorem Reflexive.rel_of_ne_imp {α : Type u_1} {r : α → α → Prop} [Std.Refl r] {x y : α} (hr : x ≠ y → r x y) :
r x y

Alias of Std.Refl.rel_of_ne_imp.


To show a reflexive relation r : α → α → Prop holds over x y : α, it suffices to show it holds when x ≠ y.

theorem Std.Refl.ne_imp_iff {α : Type u_1} {r : α → α → Prop} [Refl r] {x y : α} :
x ≠ y → r x y ↔ r x y

If a reflexive relation r : α → α → Prop holds over x y : α, then it holds whether or not x ≠ y.

@[deprecated Std.Refl.ne_imp_iff (since := "2026-03-27")]
theorem Reflexive.ne_imp_iff {α : Type u_1} {r : α → α → Prop} [Std.Refl r] {x y : α} :
x ≠ y → r x y ↔ r x y

Alias of Std.Refl.ne_imp_iff.


If a reflexive relation r : α → α → Prop holds over x y : α, then it holds whether or not x ≠ y.

@[deprecated Std.Refl.ne_imp_iff (since := "2026-03-27")]
theorem reflexive_ne_imp_iff {α : Type u_1} {r : α → α → Prop} [Std.Refl r] {x y : α} :
x ≠ y → r x y ↔ r x y

Alias of Std.Refl.ne_imp_iff.


If a reflexive relation r : α → α → Prop holds over x y : α, then it holds whether or not x ≠ y.

theorem refl_iff_eq_le {α : Type u_1} {r : α → α → Prop} :
@[deprecated refl_iff_eq_le (since := "2026-06-30")]
theorem refl_iff_subrelation_eq {α : Type u_1} {r : α → α → Prop} :

Alias of refl_iff_eq_le.

@[deprecated refl_iff_eq_le (since := "2026-03-27")]
theorem reflexive_iff_subrelation_eq {α : Type u_1} {r : α → α → Prop} :

Alias of refl_iff_eq_le.

theorem irrefl_iff_le_ne {α : Type u_1} {r : α → α → Prop} :
@[deprecated irrefl_iff_le_ne (since := "2026-06-30")]
theorem irrefl_iff_subrelation_ne {α : Type u_1} {r : α → α → Prop} :

Alias of irrefl_iff_le_ne.

@[deprecated irrefl_iff_le_ne (since := "2026-02-12")]
theorem irreflexive_iff_subrelation_ne {α : Type u_1} {r : α → α → Prop} :

Alias of irrefl_iff_le_ne.

theorem Std.Symm.iff {α : Type u_1} {r : α → α → Prop} [Symm r] (x y : α) :
r x y ↔ r y x
@[deprecated Std.Symm.iff (since := "2026-06-10")]
theorem Symmetric.iff {α : Type u_1} {r : α → α → Prop} [Std.Symm r] (x y : α) :
r x y ↔ r y x

Alias of Std.Symm.iff.

theorem Std.Symm.flip_eq {α : Type u_1} {r : α → α → Prop} [Symm r] :
flip r = r
@[deprecated Std.Symm.flip_eq (since := "2026-06-10")]
theorem Symmetric.flip_eq {α : Type u_1} {r : α → α → Prop} [Std.Symm r] :
flip r = r

Alias of Std.Symm.flip_eq.

theorem Std.Symm.swap_eq {α : Type u_1} {r : α → α → Prop} [Symm r] :
@[deprecated Std.Symm.swap_eq (since := "2026-06-10")]
theorem Symmetric.swap_eq {α : Type u_1} {r : α → α → Prop} [Std.Symm r] :

Alias of Std.Symm.swap_eq.

theorem flip_eq_iff {α : Type u_1} {r : α → α → Prop} :
theorem swap_eq_iff {α : Type u_1} {r : α → α → Prop} :
instance Std.Refl.comap {α : Type u_1} {β : Type u_2} {r : β → β → Prop} [Refl r] (f : α → β) :
@[deprecated Std.Refl.comap (since := "2026-03-27")]
theorem Reflexive.comap {α : Type u_1} {β : Type u_2} {r : β → β → Prop} [Std.Refl r] (f : α → β) :

Alias of Std.Refl.comap.

instance Std.Symm.comap {α : Type u_1} {β : Type u_2} {r : β → β → Prop} [Symm r] (f : α → β) :
@[deprecated Std.Symm.comap (since := "2026-06-10")]
theorem Symmetric.comap {α : Type u_1} {β : Type u_2} {r : β → β → Prop} [Std.Symm r] (f : α → β) :

Alias of Std.Symm.comap.

instance IsTrans.comap {α : Type u_1} {β : Type u_2} {r : β → β → Prop} [IsTrans β r] (f : α → β) :
@[deprecated IsTrans.comap (since := "2026-02-21")]
theorem Transitive.comap {α : Type u_1} {β : Type u_2} {r : β → β → Prop} [IsTrans β r] (f : α → β) :

Alias of IsTrans.comap.

instance IsEquiv.comap {α : Type u_1} {β : Type u_2} {r : β → β → Prop} [IsEquiv β r] (f : α → β) :
theorem Equivalence.comap {α : Type u_1} {β : Type u_2} {r : β → β → Prop} (h : Equivalence r) (f : α → β) :
def Relation.Comp {α : Type u_1} {β : Type u_2} {γ : Type u_3} (r : α → β → Prop) (p : β → γ → Prop) (a : α) (c : γ) :

The composition of two relations, yielding a new relation. The result relates a term of α and a term of γ if there is an intermediate term of β related to both.

Equations
Instances For
    @[simp]
    theorem Relation.comp_eq_fun {α : Type u_1} {β : Type u_2} {γ : Type u_3} {r : α → β → Prop} (f : γ → β) :
    (Comp r fun (x1 : β) (x2 : γ) => x1 = f x2) = fun (x1 : α) (x2 : γ) => r x1 (f x2)
    @[simp]
    theorem Relation.comp_eq {α : Type u_1} {β : Type u_2} {r : α → β → Prop} :
    (Comp r fun (x1 x2 : β) => x1 = x2) = r
    @[simp]
    theorem Relation.fun_eq_comp {α : Type u_1} {β : Type u_2} {γ : Type u_3} {r : α → β → Prop} (f : γ → α) :
    Comp (fun (x1 : γ) (x2 : α) => f x1 = x2) r = fun (x : γ) => r (f x)
    @[simp]
    theorem Relation.eq_comp {α : Type u_1} {β : Type u_2} {r : α → β → Prop} :
    Comp (fun (x1 x2 : α) => x1 = x2) r = r
    @[simp]
    theorem Relation.iff_comp {α : Type u_1} {r : Prop → α → Prop} :
    Comp (fun (x1 x2 : Prop) => x1 ↔ x2) r = r
    @[simp]
    theorem Relation.comp_iff {α : Type u_1} {r : α → Prop → Prop} :
    (Comp r fun (x1 x2 : Prop) => x1 ↔ x2) = r
    theorem Relation.comp_assoc {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} {r : α → β → Prop} {p : β → γ → Prop} {q : γ → δ → Prop} :
    Comp (Comp r p) q = Comp r (Comp p q)
    theorem Relation.flip_comp {α : Type u_1} {β : Type u_2} {γ : Type u_3} {r : α → β → Prop} {p : β → γ → Prop} :
    flip (Comp r p) = Comp (flip p) (flip r)
    def Relation.Fibration {α : Type u_1} {β : Type u_2} (rα : α → α → Prop) (rβ : β → β → Prop) (f : α → β) :

    A function f : α → β is a fibration between the relation rα and rβ if for all a : α and b : β, whenever b : β and f a are related by rβ, b is the image of some a' : α under f, and a' and a are related by rα.

    Equations
    Instances For
      theorem Acc.of_fibration {α : Type u_1} {β : Type u_2} {rα : α → α → Prop} {rβ : β → β → Prop} (f : α → β) (fib : Relation.Fibration rα rβ f) {a : α} (ha : Acc rα a) :
      Acc rβ (f a)

      If f : α → β is a fibration between relations rα and rβ, and a : α is accessible under rα, then f a is accessible under rβ.

      theorem Acc.of_downward_closed {α : Type u_1} {β : Type u_2} {rβ : β → β → Prop} (f : α → β) (dc : ∀ {a : α} {b : β}, rβ b (f a) → ∃ (c : α), f c = b) (a : α) (ha : Acc (InvImage rβ f) a) :
      Acc rβ (f a)
      def Relation.Map {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} (r : α → β → Prop) (f : α → γ) (g : β → δ) :
      γ → δ → Prop

      The map of a relation r through a pair of functions pushes the relation to the codomains of the functions. The resulting relation is defined by having pairs of terms related if they have preimages related by r.

      Equations
      Instances For
        theorem Relation.map_apply {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} {r : α → β → Prop} {f : α → γ} {g : β → δ} {c : γ} {d : δ} :
        Relation.Map r f g c d ↔ ∃ (a : α), ∃ (b : β), r a b ∧ f a = c ∧ g b = d
        @[simp]
        theorem Relation.map_map {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} {ε : Type u_5} {ζ : Type u_6} (r : α → β → Prop) (f₁ : α → γ) (g₁ : β → δ) (f₂ : γ → ε) (g₂ : δ → ζ) :
        Relation.Map (Relation.Map r f₁ g₁) f₂ g₂ = Relation.Map r (f₂ ∘ f₁) (g₂ ∘ g₁)
        @[simp]
        theorem Relation.map_apply_apply {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} {f : α → γ} {g : β → δ} (hf : Function.Injective f) (hg : Function.Injective g) (r : α → β → Prop) (a : α) (b : β) :
        Relation.Map r f g (f a) (g b) ↔ r a b
        @[simp]
        theorem Relation.map_id_id {α : Type u_1} {β : Type u_2} (r : α → β → Prop) :
        @[instance_reducible]
        instance Relation.instDecidableMapOfExistsAndEq {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} {r : α → β → Prop} {f : α → γ} {g : β → δ} {c : γ} {d : δ} [Decidable (∃ (a : α), ∃ (b : β), r a b ∧ f a = c ∧ g b = d)] :
        Equations
        theorem Std.Refl.map {α : Type u_1} {β : Type u_2} {r : α → α → Prop} [Refl r] {f : α → β} (hf : Function.Surjective f) :
        @[deprecated Std.Refl.map (since := "2026-03-27")]
        theorem Relation.map_reflexive {α : Type u_1} {β : Type u_2} {r : α → α → Prop} [Std.Refl r] {f : α → β} (hf : Function.Surjective f) :

        Alias of Std.Refl.map.

        instance Std.Symm.map {α : Type u_1} {β : Type u_2} {r : α → α → Prop} [Symm r] (f : α → β) :
        @[deprecated Std.Symm.map (since := "2026-06-10")]
        theorem Relation.map_symmetric {α : Type u_1} {β : Type u_2} {r : α → α → Prop} [Std.Symm r] (f : α → β) :

        Alias of Std.Symm.map.

        theorem IsTrans.map {α : Type u_1} {β : Type u_2} {r : α → α → Prop} [IsTrans α r] {f : α → β} (hf : ∀ (x y : α), f x = f y → r x y) :
        @[deprecated IsTrans.map (since := "2026-03-27")]
        theorem Relation.isTrans_map {α : Type u_1} {β : Type u_2} {r : α → α → Prop} [IsTrans α r] {f : α → β} (hf : ∀ (x y : α), f x = f y → r x y) :

        Alias of IsTrans.map.

        @[deprecated Relation.isTrans_map (since := "2026-02-21")]
        theorem Relation.map_transitive {α : Type u_1} {β : Type u_2} {r : α → α → Prop} [IsTrans α r] {f : α → β} (hf : ∀ (x y : α), f x = f y → r x y) :

        Alias of Relation.isTrans_map.


        Alias of IsTrans.map.

        theorem Relation.map_equivalence {α : Type u_1} {β : Type u_2} {r : α → α → Prop} (hr : Equivalence r) (f : α → β) (hf : Function.Surjective f) (hf_ker : ∀ (x y : α), f x = f y → r x y) :
        theorem Relation.map_mono {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} {r s : α → β → Prop} {f : α → γ} {g : β → δ} (h : r ≤ s) :
        theorem Relation.le_onFun_map {α : Type u_1} {β : Type u_2} {r : α → α → Prop} (f : α → β) :
        theorem Relation.onFun_map_eq_of_injective {α : Type u_1} {β : Type u_2} {r : α → α → Prop} {f : α → β} (hinj : Function.Injective f) :
        theorem Relation.map_onFun_le {α : Type u_1} {β : Type u_2} {r : β → β → Prop} (f : α → β) :
        theorem Relation.map_onFun_eq_of_surjective {α : Type u_1} {β : Type u_2} {r : β → β → Prop} {f : α → β} (hsurj : Function.Surjective f) :
        theorem Relation.map_onFun_map_eq_map {α : Type u_1} {β : Type u_2} {r : α → α → Prop} (f : α → β) :
        theorem Relation.onFun_map_onFun_eq_onFun {α : Type u_1} {β : Type u_2} {r : β → β → Prop} (f : α → β) :
        theorem Relation.onFun_map_onFun_iff_onFun {α : Type u_1} {β : Type u_2} {r : β → β → Prop} (f : α → β) (a₁ a₂ : α) :
        Relation.Map (Function.onFun r f) f f (f a₁) (f a₂) ↔ r (f a₁) (f a₂)
        inductive Relation.ReflTransGen {α : Type u_1} (r : α → α → Prop) (a : α) :
        α → Prop

        ReflTransGen r: reflexive transitive closure of r

        Instances For
          theorem Relation.ReflTransGen.cases_tail_iff {α : Type u_1} (r : α → α → Prop) (a a✝ : α) :
          ReflTransGen r a a✝ ↔ a✝ = a ∨ ∃ (b : α), ReflTransGen r a b ∧ r b a✝
          inductive Relation.ReflGen {α : Type u_1} (r : α → α → Prop) (a : α) :
          α → Prop

          ReflGen r: reflexive closure of r

          • refl {α : Type u_1} {r : α → α → Prop} {a : α} : ReflGen r a a
          • single {α : Type u_1} {r : α → α → Prop} {a b : α} : r a b → ReflGen r a b
          Instances For
            theorem Relation.reflGen_iff {α : Type u_1} (r : α → α → Prop) (a a✝ : α) :
            ReflGen r a a✝ ↔ a✝ = a ∨ r a a✝
            def Relation.SymmGen {α : Type u_1} (r : α → α → Prop) (a b : α) :

            SymmGen r: symmetric closure of r. This is also the comparability relation, such that SymmGen r a b means that either r a b or r b a (see Mathlib.Order.Comparable).

            Equations
            Instances For
              inductive Relation.EqvGen {α : Type u_1} (r : α → α → Prop) :
              α → α → Prop

              EqvGen r: equivalence closure of r.

              Instances For
                theorem Relation.eqvGen_iff {α : Type u_1} (r : α → α → Prop) (a✝ a✝¹ : α) :
                EqvGen r a✝ a✝¹ ↔ r a✝ a✝¹ ∨ a✝¹ = a✝ ∨ EqvGen r a✝¹ a✝ ∨ ∃ (y : α), EqvGen r a✝ y ∧ EqvGen r y a✝¹
                theorem Relation.transGen_iff {α : Sort u} (r : α → α → Prop) (a✝ a✝¹ : α) :
                TransGen r a✝ a✝¹ ↔ r a✝ a✝¹ ∨ ∃ (b : α), TransGen r a✝ b ∧ r b a✝¹
                theorem Relation.reflGen_le_reflTransGen {α : Type u_1} {r : α → α → Prop} :
                theorem Relation.ReflGen.to_reflTransGen {α : Type u_1} {r : α → α → Prop} {a b : α} :
                ReflGen r a b → ReflTransGen r a b
                theorem Relation.ReflGen.mono {α : Type u_1} {r p : α → α → Prop} (hp : r ≤ p) :
                instance Relation.ReflGen.instRefl {α : Type u_1} {r : α → α → Prop} :
                instance Relation.ReflGen.stdSymm {α : Type u_1} {r : α → α → Prop} [Std.Symm r] :
                @[deprecated Relation.ReflGen.stdSymm (since := "2026-06-10")]
                theorem Relation.ReflGen.symmetric {α : Type u_1} {r : α → α → Prop} [Std.Symm r] :

                Alias of Relation.ReflGen.stdSymm.

                instance Relation.ReflGen.instIsPreorderOfIsTrans {α : Type u_1} {r : α → α → Prop} [IsTrans α r] :
                theorem Relation.SymmGen.of_rel {α : Type u_1} {r : α → α → Prop} {a b : α} (h : r a b) :
                SymmGen r a b
                theorem Relation.SymmGen.of_rel_symm {α : Type u_1} {r : α → α → Prop} {a b : α} (h : r b a) :
                SymmGen r a b
                theorem Relation.SymmGen.swap {α : Type u_1} {r : α → α → Prop} {a b : α} (h : SymmGen r b a) :
                @[simp]
                theorem Relation.SymmGen.refl {α : Type u_1} (r : α → α → Prop) [Std.Refl r] (a : α) :
                SymmGen r a a
                theorem Relation.SymmGen.rfl {α : Type u_1} {r : α → α → Prop} {a : α} [Std.Refl r] :
                SymmGen r a a
                instance Relation.SymmGen.instRefl {α : Type u_1} {r : α → α → Prop} [Std.Refl r] :
                theorem Relation.SymmGen.symm {α : Type u_1} {r : α → α → Prop} {a b : α} :
                SymmGen r a b → SymmGen r b a
                instance Relation.SymmGen.instSymm {α : Type u_1} {r : α → α → Prop} :
                @[instance_reducible]
                instance Relation.SymmGen.decidableRel {α : Type u_1} {r : α → α → Prop} [DecidableRel r] :
                Equations
                theorem Relation.SymmGen.of_le {α : Type u_7} [LE α] {a b : α} (h : a ≤ b) :
                SymmGen (fun (x1 x2 : α) => x1 ≤ x2) a b
                theorem Relation.SymmGen.of_ge {α : Type u_7} [LE α] {a b : α} (h : b ≤ a) :
                SymmGen (fun (x1 x2 : α) => x1 ≤ x2) a b
                theorem LE.le.symmGen {α : Type u_7} [LE α] {a b : α} (h : a ≤ b) :
                Relation.SymmGen (fun (x1 x2 : α) => x1 ≤ x2) a b

                Alias of Relation.SymmGen.of_le.

                theorem LE.le.symmGen_symm {α : Type u_7} [LE α] {a b : α} (h : b ≤ a) :
                Relation.SymmGen (fun (x1 x2 : α) => x1 ≤ x2) a b

                Alias of Relation.SymmGen.of_ge.

                theorem Relation.ReflTransGen.trans {α : Type u_1} {r : α → α → Prop} {a b c : α} (hab : ReflTransGen r a b) (hbc : ReflTransGen r b c) :
                theorem Relation.ReflTransGen.single {α : Type u_1} {r : α → α → Prop} {a b : α} (hab : r a b) :
                theorem Relation.ReflTransGen.le_reflTransGen {α : Type u_1} {r : α → α → Prop} :
                theorem Relation.ReflTransGen.head {α : Type u_1} {r : α → α → Prop} {a b c : α} (hab : r a b) (hbc : ReflTransGen r b c) :
                instance Relation.ReflTransGen.stdSymm {α : Type u_1} {r : α → α → Prop} [Std.Symm r] :
                @[deprecated Relation.ReflTransGen.stdSymm (since := "2026-06-10")]
                theorem Relation.ReflTransGen.symmetric {α : Type u_1} {r : α → α → Prop} [Std.Symm r] :

                Alias of Relation.ReflTransGen.stdSymm.

                theorem Relation.ReflTransGen.cases_tail {α : Type u_1} {r : α → α → Prop} {a b : α} :
                ReflTransGen r a b → b = a ∨ ∃ (c : α), ReflTransGen r a c ∧ r c b
                theorem Relation.ReflTransGen.head_induction_on {α : Type u_1} {r : α → α → Prop} {b : α} {motive : (a : α) → ReflTransGen r a b → Prop} {a : α} (h : ReflTransGen r a b) (refl : motive b ⋯) (head : ∀ {a c : α} (h' : r a c) (h : ReflTransGen r c b), motive c h → motive a ⋯) :
                motive a h
                theorem Relation.ReflTransGen.trans_induction_on {α : Type u_1} {r : α → α → Prop} {motive : {a b : α} → ReflTransGen r a b → Prop} {a b : α} (h : ReflTransGen r a b) (refl : ∀ (a : α), motive ⋯) (single : ∀ {a b : α} (h : r a b), motive ⋯) (trans : ∀ {a b c : α} (h₁ : ReflTransGen r a b) (h₂ : ReflTransGen r b c), motive h₁ → motive h₂ → motive ⋯) :
                motive h
                theorem Relation.ReflTransGen.cases_head {α : Type u_1} {r : α → α → Prop} {a b : α} (h : ReflTransGen r a b) :
                a = b ∨ ∃ (c : α), r a c ∧ ReflTransGen r c b
                theorem Relation.ReflTransGen.cases_head_iff {α : Type u_1} {r : α → α → Prop} {a b : α} :
                ReflTransGen r a b ↔ a = b ∨ ∃ (c : α), r a c ∧ ReflTransGen r c b
                theorem Relation.ReflTransGen.total_of_right_unique {α : Type u_1} {r : α → α → Prop} {a b c : α} (U : Relator.RightUnique r) (ab : ReflTransGen r a b) (ac : ReflTransGen r a c) :
                theorem Relation.transGen_le_reflTransGen {α : Type u_1} {r : α → α → Prop} :
                theorem Relation.TransGen.to_reflTransGen {α : Type u_1} {r : α → α → Prop} {a b : α} :
                TransGen r a b → ReflTransGen r a b
                theorem Relation.TransGen.trans_left {α : Type u_1} {r : α → α → Prop} {a b c : α} (hab : TransGen r a b) (hbc : ReflTransGen r b c) :
                TransGen r a c
                theorem Relation.TransGen.head' {α : Type u_1} {r : α → α → Prop} {a b c : α} (hab : r a b) (hbc : ReflTransGen r b c) :
                TransGen r a c
                theorem Relation.TransGen.tail' {α : Type u_1} {r : α → α → Prop} {a b c : α} (hab : ReflTransGen r a b) (hbc : r b c) :
                TransGen r a c
                theorem Relation.TransGen.head {α : Type u_1} {r : α → α → Prop} {a b c : α} (hab : r a b) (hbc : TransGen r b c) :
                TransGen r a c
                theorem Relation.TransGen.head_induction_on {α : Type u_1} {r : α → α → Prop} {b : α} {motive : (a : α) → TransGen r a b → Prop} {a : α} (h : TransGen r a b) (single : ∀ {a : α} (h : r a b), motive a ⋯) (head : ∀ {a c : α} (h' : r a c) (h : TransGen r c b), motive c h → motive a ⋯) :
                motive a h
                theorem Relation.TransGen.trans_induction_on {α : Type u_1} {r : α → α → Prop} {motive : {a b : α} → TransGen r a b → Prop} {a b : α} (h : TransGen r a b) (single : ∀ {a b : α} (h : r a b), motive ⋯) (trans : ∀ {a b c : α} (h₁ : TransGen r a b) (h₂ : TransGen r b c), motive h₁ → motive h₂ → motive ⋯) :
                motive h
                theorem Relation.TransGen.trans_right {α : Type u_1} {r : α → α → Prop} {a b c : α} (hab : ReflTransGen r a b) (hbc : TransGen r b c) :
                TransGen r a c
                theorem Relation.TransGen.tail'_iff {α : Type u_1} {r : α → α → Prop} {a c : α} :
                TransGen r a c ↔ ∃ (b : α), ReflTransGen r a b ∧ r b c
                theorem Relation.TransGen.head'_iff {α : Type u_1} {r : α → α → Prop} {a c : α} :
                TransGen r a c ↔ ∃ (b : α), r a b ∧ ReflTransGen r b c
                instance Relation.TransGen.stdSymm {α : Type u_1} {r : α → α → Prop} [Std.Symm r] :
                @[deprecated Relation.TransGen.stdSymm (since := "2026-06-10")]
                theorem Relation.TransGen.symmetric {α : Type u_1} {r : α → α → Prop} [Std.Symm r] :

                Alias of Relation.TransGen.stdSymm.

                instance Relation.TransGen.instIsTrans {α : Type u_1} {r : α → α → Prop} :
                instance Relation.TransGen.instIsPreorderOfRefl {α : Type u_1} {r : α → α → Prop} [Std.Refl r] :
                theorem Relation.reflGen_eq_self {α : Type u_1} {r : α → α → Prop} [Std.Refl r] :
                @[deprecated inferInstance (since := "2026-03-27")]
                theorem Relation.reflexive_reflGen {α : Type u_1} {r : α → α → Prop} :
                theorem Relation.reflGen_minimal {α : Type u_1} {r r' : α → α → Prop} [Std.Refl r'] (h : r ≤ r') :
                theorem Relation.symmGen_swap {α : Type u_1} (r : α → α → Prop) :
                theorem Relation.symmGen_swap_apply {α : Type u_1} {a b : α} (r : α → α → Prop) :
                theorem Relation.symmGen_comm {α : Type u_1} {r : α → α → Prop} {a b : α} :
                SymmGen r a b ↔ SymmGen r b a
                @[simp]
                theorem Relation.symmGen_of_total {α : Type u_1} {r : α → α → Prop} [Std.Total r] (a b : α) :
                SymmGen r a b
                @[instance_reducible]
                instance Relation.instTransTransGen_mathlib {α : Type u_1} {r : α → α → Prop} :
                Equations
                @[instance_reducible]
                instance Relation.instTransTransGen_mathlib_1 {α : Type u_1} {r : α → α → Prop} :
                Equations
                @[instance_reducible]
                instance Relation.instTransTransGenReflTransGen {α : Type u_1} {r : α → α → Prop} :
                Equations
                @[instance_reducible]
                instance Relation.instTransReflTransGenTransGen {α : Type u_1} {r : α → α → Prop} :
                Equations
                theorem Relation.transGen_eq_self {α : Type u_1} {r : α → α → Prop} [IsTrans α r] :
                @[deprecated inferInstance (since := "2026-02-21")]
                theorem Relation.transitive_transGen {α : Type u_1} {r : α → α → Prop} :
                @[deprecated Relation.transGen_eq_self (since := "2026-03-27")]
                theorem Relation.transGen_idem {α : Type u_1} {r : α → α → Prop} :
                theorem Relation.TransGen.lift {α : Type u_1} {β : Type u_2} {r : α → α → Prop} {p : β → β → Prop} (f : α → β) (h : r ≤ Function.onFun p f) :
                theorem Relation.TransGen.lift' {α : Type u_1} {β : Type u_2} {r : α → α → Prop} {p : β → β → Prop} (f : α → β) (h : r ≤ Function.onFun (TransGen p) f) :
                theorem Relation.TransGen.closed {α : Type u_1} {r p : α → α → Prop} :
                theorem Relation.TransGen.closed' {α : Type u_1} {r : α → α → Prop} {P : α → Prop} (dc : ∀ {a b : α}, r a b → P b → P a) {a b : α} (h : TransGen r a b) :
                P b → P a
                theorem Relation.TransGen.mono {α : Type u_1} {r p : α → α → Prop} :
                r ≤ p → TransGen r ≤ TransGen p
                theorem Relation.transGen_minimal {α : Type u_1} {r r' : α → α → Prop} [IsTrans α r'] (h : r ≤ r') :
                theorem Relation.TransGen.swap {α : Type u_1} {r : α → α → Prop} :
                theorem Relation.transGen_swap {α : Type u_1} {r : α → α → Prop} {a b : α} :
                theorem Relation.reflTransGen_iff_eq {α : Type u_1} {r : α → α → Prop} {a b : α} (h : ∀ (b : α), ¬r a b) :
                ReflTransGen r a b ↔ b = a
                theorem Relation.reflTransGen_iff_eq_or_transGen {α : Type u_1} {r : α → α → Prop} {a b : α} :
                ReflTransGen r a b ↔ b = a ∨ TransGen r a b
                theorem Relation.ReflTransGen.lift {α : Type u_1} {β : Type u_2} {r : α → α → Prop} {p : β → β → Prop} (f : α → β) (h : r ≤ Function.onFun p f) :
                theorem Relation.ReflTransGen.mono {α : Type u_1} {r p : α → α → Prop} :
                theorem Relation.reflTransGen_eq_self {α : Type u_1} {r : α → α → Prop} [Std.Refl r] [IsTrans α r] :
                @[instance_reducible]
                instance Relation.instTransReflTransGen {α : Type u_1} {r : α → α → Prop} :
                Equations
                @[instance_reducible]
                instance Relation.instTransReflTransGen_1 {α : Type u_1} {r : α → α → Prop} :
                Equations
                instance Relation.instIsPreorderReflTransGen {α : Type u_1} {r : α → α → Prop} :
                @[deprecated inferInstance (since := "2026-03-27")]
                theorem Relation.reflexive_reflTransGen {α : Type u_1} {r : α → α → Prop} :
                @[deprecated inferInstance (since := "2026-02-21")]
                theorem Relation.transitive_reflTransGen {α : Type u_1} {r : α → α → Prop} :
                @[deprecated Relation.reflTransGen_eq_self (since := "2026-03-27")]
                theorem Relation.reflTransGen_idem {α : Type u_1} {r : α → α → Prop} :
                theorem Relation.ReflTransGen.lift' {α : Type u_1} {β : Type u_2} {r : α → α → Prop} {p : β → β → Prop} (f : α → β) (h : r ≤ Function.onFun (ReflTransGen p) f) :
                theorem Relation.reflTransGen_closed {α : Type u_1} {r p : α → α → Prop} :
                theorem Relation.reflTransGen_swap {α : Type u_1} {r : α → α → Prop} {a b : α} :
                @[simp]
                theorem Relation.reflGen_transGen {α : Type u_1} {r : α → α → Prop} :
                @[simp]
                theorem Relation.transGen_reflGen {α : Type u_1} {r : α → α → Prop} :
                @[simp]
                theorem Relation.reflTransGen_reflGen {α : Type u_1} {r : α → α → Prop} :
                @[simp]
                theorem Relation.reflTransGen_transGen {α : Type u_1} {r : α → α → Prop} :
                theorem Relation.reflTransGen_eq_transGen {α : Type u_1} {r : α → α → Prop} [Std.Refl r] :
                theorem Relation.reflTransGen_eq_reflGen {α : Type u_1} {r : α → α → Prop} [IsTrans α r] :
                theorem Relation.EqvGen.is_equivalence {α : Type u_1} (r : α → α → Prop) :
                instance Relation.EqvGen.instIsEquiv {α : Type u_1} (r : α → α → Prop) :
                @[instance_reducible]
                def Relation.EqvGen.setoid {α : Type u_1} (r : α → α → Prop) :

                EqvGen.setoid r is the setoid generated by a relation r.

                The motivation for this definition is that Quot r behaves like Quotient (EqvGen.setoid r), see for example Quot.eqvGen_exact and Quot.eqvGen_sound.

                Equations
                Instances For
                  theorem Relation.EqvGen.mono {α : Type u_1} {r p : α → α → Prop} (hrp : r ≤ p) :
                  theorem Relation.EqvGen.eqvGen_le {α : Type u_1} {r r' : α → α → Prop} [IsEquiv α r'] (h : Subrelation r r') :
                  theorem Relation.EqvGen.eqvGen_mono {α : Type u_1} {r r' : α → α → Prop} (h : Subrelation r r') :
                  theorem Relation.EqvGen.reflGen_le_eqvGen {α : Type u_1} (r : α → α → Prop) :
                  theorem Relation.EqvGen.symmGen_le_eqvGen {α : Type u_1} (r : α → α → Prop) :
                  theorem Relation.EqvGen.transGen_le_eqvGen {α : Type u_1} (r : α → α → Prop) :
                  @[simp]
                  theorem Relation.EqvGen.eqvGen_reflGen {α : Type u_1} (r : α → α → Prop) :
                  @[simp]
                  theorem Relation.EqvGen.eqvGen_transGen {α : Type u_1} (r : α → α → Prop) :
                  @[simp]
                  theorem Relation.EqvGen.eqvGen_symmGen {α : Type u_1} (r : α → α → Prop) :
                  @[simp]
                  theorem Relation.EqvGen.eqvGen_reflTransGen {α : Type u_1} (r : α → α → Prop) :
                  theorem Relation.EqvGen.eqvGen_eq_reflTransGen {α : Type u_1} (r : α → α → Prop) [Std.Symm r] :
                  theorem Relation.EqvGen.reflTransGen_symmGen {α : Type u_1} (r : α → α → Prop) :
                  def Relation.Join {α : Type u_1} (r : α → α → Prop) :
                  α → α → Prop

                  The join of a relation on a single type is a new relation for which pairs of terms are related if there is a third term they are both related to. For example, if r is a relation representing rewrites in a term rewriting system, then confluence is the property that if a rewrites to both b and c, then join r relates b and c (see Relation.church_rosser).

                  Equations
                  Instances For
                    theorem Relation.church_rosser {α : Type u_1} {r : α → α → Prop} {a b c : α} (h : ∀ (a b c : α), r a b → r a c → ∃ (d : α), ReflGen r b d ∧ ReflTransGen r c d) (hab : ReflTransGen r a b) (hac : ReflTransGen r a c) :

                    A sufficient condition for the Church-Rosser property.

                    theorem Relation.le_join_of_refl {α : Type u_1} {r : α → α → Prop} [Std.Refl r] :
                    r ≤ Join r
                    @[deprecated Relation.le_join_of_refl (since := "2026-06-30")]
                    theorem Relation.join_of_single {α : Type u_1} {r : α → α → Prop} [Std.Refl r] :
                    r ≤ Join r

                    Alias of Relation.le_join_of_refl.

                    instance Relation.Join.symm {α : Type u_1} {r : α → α → Prop} :
                    @[deprecated Relation.Join.symm (since := "2026-06-10")]
                    theorem Relation.symmetric_join {α : Type u_1} {r : α → α → Prop} :

                    Alias of Relation.Join.symm.

                    instance Relation.Join.refl {α : Type u_1} {r : α → α → Prop} [Std.Refl r] :
                    @[deprecated Relation.Join.refl (since := "2026-06-10")]
                    theorem Relation.reflexive_join {α : Type u_1} {r : α → α → Prop} [Std.Refl r] :

                    Alias of Relation.Join.refl.

                    theorem Relation.isTrans_join {α : Type u_1} {r : α → α → Prop} [IsTrans α r] (h : ∀ (a b c : α), r a b → r a c → Join r b c) :
                    IsTrans α (Join r)
                    @[deprecated Relation.isTrans_join (since := "2026-02-21")]
                    theorem Relation.transitive_join {α : Type u_1} {r : α → α → Prop} [IsTrans α r] (h : ∀ (a b c : α), r a b → r a c → Join r b c) :
                    IsTrans α (Join r)

                    Alias of Relation.isTrans_join.

                    theorem Relation.equivalence_join {α : Type u_1} {r : α → α → Prop} [IsPreorder α r] (h : ∀ (a b c : α), r a b → r a c → Join r b c) :
                    theorem Relation.equivalence_join_reflTransGen {α : Type u_1} {r : α → α → Prop} (h : ∀ (a b c : α), r a b → r a c → ∃ (d : α), ReflGen r b d ∧ ReflTransGen r c d) :
                    theorem Relation.join_le_of_equivalence_of_le {α : Type u_1} {r r' : α → α → Prop} (hr : Equivalence r) (h : r' ≤ r) :
                    Join r' ≤ r
                    @[deprecated Relation.join_le_of_equivalence_of_le (since := "2026-06-30")]
                    theorem Relation.join_of_equivalence {α : Type u_1} {r r' : α → α → Prop} (hr : Equivalence r) (h : r' ≤ r) :
                    Join r' ≤ r

                    Alias of Relation.join_le_of_equivalence_of_le.

                    theorem Relation.reflTransGen_le_of_le {α : Type u_1} {r r' : α → α → Prop} [Std.Refl r] [IsTrans α r] (h : r' ≤ r) :
                    @[deprecated Relation.reflTransGen_le_of_le (since := "2026-06-30")]
                    theorem Relation.reflTransGen_of_isTrans_reflexive {α : Type u_1} {r r' : α → α → Prop} [Std.Refl r] [IsTrans α r] (h : r' ≤ r) :

                    Alias of Relation.reflTransGen_le_of_le.

                    @[deprecated Relation.reflTransGen_le_of_le (since := "2026-02-21")]
                    theorem Relation.reflTransGen_of_transitive_reflexive {α : Type u_1} {r r' : α → α → Prop} [Std.Refl r] [IsTrans α r] (h : r' ≤ r) :

                    Alias of Relation.reflTransGen_le_of_le.

                    theorem Relation.reflTransGen_le_of_equivalence_of_le {α : Type u_1} {r r' : α → α → Prop} (hr : Equivalence r) :
                    r' ≤ r → ReflTransGen r' ≤ r
                    @[deprecated Relation.reflTransGen_le_of_equivalence_of_le (since := "2026-06-30")]
                    theorem Relation.reflTransGen_of_equivalence {α : Type u_1} {r r' : α → α → Prop} (hr : Equivalence r) :
                    r' ≤ r → ReflTransGen r' ≤ r

                    Alias of Relation.reflTransGen_le_of_equivalence_of_le.

                    theorem Quot.eqvGen_exact {α : Type u_1} {r : α → α → Prop} {a b : α} (H : mk r a = mk r b) :
                    theorem Quot.eqvGen_sound {α : Type u_1} {r : α → α → Prop} {a b : α} (H : Relation.EqvGen r a b) :
                    mk r a = mk r b
                    theorem Equivalence.eqvGen_iff {α : Type u_1} {r : α → α → Prop} {a b : α} (h : Equivalence r) :
                    Relation.EqvGen r a b ↔ r a b
                    theorem Equivalence.eqvGen_eq {α : Type u_1} {r : α → α → Prop} (h : Equivalence r) :