fact
stringlengths
6
3.84k
type
stringclasses
11 values
library
stringclasses
32 values
imports
listlengths
1
14
filename
stringlengths
20
95
symbolic_name
stringlengths
1
90
docstring
stringlengths
7
20k
nonempty_ulift : Nonempty (ULift α) ↔ Nonempty α := Iff.intro (fun ⟨⟨a⟩⟩ ↦ ⟨a⟩) fun ⟨a⟩ ↦ ⟨⟨a⟩⟩
theorem
Logic
[ "Mathlib.Tactic.TypeStar" ]
Mathlib/Logic/Nonempty.lean
nonempty_ulift
null
IsSymmOp (op : α → α → β) : Prop where /-- A symmetric operation satisfies `op a b = op b a`. -/ symm_op : ∀ a b, op a b = op b a
class
Logic
[ "Mathlib.Init" ]
Mathlib/Logic/OpClass.lean
IsSymmOp
`IsSymmOp op` where `op : α → α → β` says that `op` is a symmetric operation, i.e. `op a b = op b a`. It is the natural generalisation of `Std.Commutative` (`β = α`) and `IsSymm` (`β = Prop`).
LeftCommutative (op : α → β → β) : Prop where /-- A left-commutative operation satisfies `op a₁ (op a₂ b) = op a₂ (op a₁ b)`. -/ left_comm : (a₁ a₂ : α) → (b : β) → op a₁ (op a₂ b) = op a₂ (op a₁ b)
class
Logic
[ "Mathlib.Init" ]
Mathlib/Logic/OpClass.lean
LeftCommutative
`LeftCommutative op` where `op : α → β → β` says that `op` is a left-commutative operation, i.e. `op a₁ (op a₂ b) = op a₂ (op a₁ b)`.
RightCommutative (op : β → α → β) : Prop where /-- A right-commutative operation satisfies `op (op b a₁) a₂ = op (op b a₂) a₁`. -/ right_comm : (b : β) → (a₁ a₂ : α) → op (op b a₁) a₂ = op (op b a₂) a₁
class
Logic
[ "Mathlib.Init" ]
Mathlib/Logic/OpClass.lean
RightCommutative
`RightCommutative op` where `op : β → α → β` says that `op` is a right-commutative operation, i.e. `op (op b a₁) a₂ = op (op b a₂) a₁`.
IsSymmOp.flip_eq (op : α → α → β) [IsSymmOp op] : flip op = op := funext fun a ↦ funext fun b ↦ (IsSymmOp.symm_op a b).symm
theorem
Logic
[ "Mathlib.Init" ]
Mathlib/Logic/OpClass.lean
IsSymmOp.flip_eq
null
Pairwise (r : α → α → Prop) := ∀ ⦃i j⦄, i ≠ j → r i j
def
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Data.Set.Defs" ]
Mathlib/Logic/Pairwise.lean
Pairwise
A relation `r` holds pairwise if `r i j` for all `i ≠ j`.
Pairwise.mono (hr : Pairwise r) (h : ∀ ⦃i j⦄, r i j → p i j) : Pairwise p := fun _i _j hij => h <| hr hij
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Data.Set.Defs" ]
Mathlib/Logic/Pairwise.lean
Pairwise.mono
null
protected Pairwise.eq (h : Pairwise r) : ¬r a b → a = b := not_imp_comm.1 <| @h _ _ @[simp]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Data.Set.Defs" ]
Mathlib/Logic/Pairwise.lean
Pairwise.eq
null
protected Subsingleton.pairwise [Subsingleton α] : Pairwise r := fun _ _ h ↦ False.elim <| h.elim <| Subsingleton.elim _ _
lemma
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Data.Set.Defs" ]
Mathlib/Logic/Pairwise.lean
Subsingleton.pairwise
null
Function.injective_iff_pairwise_ne : Injective f ↔ Pairwise ((· ≠ ·) on f) := forall₂_congr fun _i _j => not_imp_not.symm alias ⟨Function.Injective.pairwise_ne, _⟩ := Function.injective_iff_pairwise_ne
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Data.Set.Defs" ]
Mathlib/Logic/Pairwise.lean
Function.injective_iff_pairwise_ne
null
Pairwise.comp_of_injective (hr : Pairwise r) {f : β → α} (hf : Injective f) : Pairwise (r on f) := fun _ _ h ↦ hr <| hf.ne h
lemma
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Data.Set.Defs" ]
Mathlib/Logic/Pairwise.lean
Pairwise.comp_of_injective
null
Pairwise.of_comp_of_surjective {f : β → α} (hr : Pairwise (r on f)) (hf : Surjective f) : Pairwise r := hf.forall₂.2 fun _ _ h ↦ hr <| ne_of_apply_ne f h
lemma
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Data.Set.Defs" ]
Mathlib/Logic/Pairwise.lean
Pairwise.of_comp_of_surjective
null
Function.Bijective.pairwise_comp_iff {f : β → α} (hf : Bijective f) : Pairwise (r on f) ↔ Pairwise r := ⟨fun hr ↦ hr.of_comp_of_surjective hf.surjective, fun hr ↦ hr.comp_of_injective hf.injective⟩
lemma
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Data.Set.Defs" ]
Mathlib/Logic/Pairwise.lean
Function.Bijective.pairwise_comp_iff
null
pairwise_fin_succ_iff {n : ℕ} {R : Fin n.succ → Fin n.succ → Prop} : Pairwise R ↔ (∀ i, R (Fin.succ i) 0) ∧ (∀ j, R 0 (Fin.succ j)) ∧ Pairwise fun i j => R (Fin.succ i) (Fin.succ j) where mp h := ⟨ fun _ => h (Fin.succ_ne_zero _), fun _ => h (Fin.succ_ne_zero _).symm, fun _i _j hij => h <| Fin.succ_inj.not.2 hij⟩ mpr | ⟨hi, hj, h⟩ => Fin.cases (Fin.cases nofun fun j _ => hj j) (fun i => Fin.cases (fun _ => hi i) fun _j hij => h (ne_of_apply_ne _ hij))
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Data.Set.Defs" ]
Mathlib/Logic/Pairwise.lean
pairwise_fin_succ_iff
null
pairwise_fin_succ_iff_of_isSymm {n : ℕ} {R : Fin n.succ → Fin n.succ → Prop} [IsSymm _ R] : Pairwise R ↔ (∀ j, R 0 (Fin.succ j)) ∧ Pairwise fun i j => R (Fin.succ i) (Fin.succ j) := by simp only [pairwise_fin_succ_iff, comm (b := 0) (r := R), and_self_left]
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Data.Set.Defs" ]
Mathlib/Logic/Pairwise.lean
pairwise_fin_succ_iff_of_isSymm
null
protected Pairwise (s : Set α) (r : α → α → Prop) := ∀ ⦃x⦄, x ∈ s → ∀ ⦃y⦄, y ∈ s → x ≠ y → r x y
def
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Data.Set.Defs" ]
Mathlib/Logic/Pairwise.lean
Pairwise
The relation `r` holds pairwise on the set `s` if `r x y` for all *distinct* `x y ∈ s`.
pairwise_of_forall (s : Set α) (r : α → α → Prop) (h : ∀ a b, r a b) : s.Pairwise r := fun a _ b _ _ => h a b
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Data.Set.Defs" ]
Mathlib/Logic/Pairwise.lean
pairwise_of_forall
null
Pairwise.imp_on (h : s.Pairwise r) (hrp : s.Pairwise fun ⦃a b : α⦄ => r a b → p a b) : s.Pairwise p := fun _a ha _b hb hab => hrp ha hb hab <| h ha hb hab
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Data.Set.Defs" ]
Mathlib/Logic/Pairwise.lean
Pairwise.imp_on
null
Pairwise.imp (h : s.Pairwise r) (hpq : ∀ ⦃a b : α⦄, r a b → p a b) : s.Pairwise p := h.imp_on <| pairwise_of_forall s _ hpq
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Data.Set.Defs" ]
Mathlib/Logic/Pairwise.lean
Pairwise.imp
null
protected Pairwise.eq (hs : s.Pairwise r) (ha : a ∈ s) (hb : b ∈ s) (h : ¬r a b) : a = b := of_not_not fun hab => h <| hs ha hb hab
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Data.Set.Defs" ]
Mathlib/Logic/Pairwise.lean
Pairwise.eq
null
_root_.Reflexive.set_pairwise_iff (hr : Reflexive r) : s.Pairwise r ↔ ∀ ⦃a⦄, a ∈ s → ∀ ⦃b⦄, b ∈ s → r a b := forall₄_congr fun a _ _ _ => or_iff_not_imp_left.symm.trans <| or_iff_right_of_imp <| Eq.ndrec <| hr a
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Data.Set.Defs" ]
Mathlib/Logic/Pairwise.lean
_root_.Reflexive.set_pairwise_iff
null
Pairwise.on_injective (hs : s.Pairwise r) (hf : Function.Injective f) (hfs : ∀ x, f x ∈ s) : Pairwise (r on f) := fun i j hij => hs (hfs i) (hfs j) (hf.ne hij)
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Data.Set.Defs" ]
Mathlib/Logic/Pairwise.lean
Pairwise.on_injective
null
Pairwise.set_pairwise (h : Pairwise r) (s : Set α) : s.Pairwise r := fun _ _ _ _ w => h w
theorem
Logic
[ "Mathlib.Logic.Function.Basic", "Mathlib.Data.Set.Defs" ]
Mathlib/Logic/Pairwise.lean
Pairwise.set_pairwise
null
IsRefl.reflexive [IsRefl α r] : Reflexive r := fun x ↦ IsRefl.refl x
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
IsRefl.reflexive
null
Reflexive.rel_of_ne_imp (h : Reflexive r) {x y : α} (hr : x ≠ y → r x y) : r x y := by grind [Reflexive]
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
Reflexive.rel_of_ne_imp
To show a reflexive relation `r : α → α → Prop` holds over `x y : α`, it suffices to show it holds when `x ≠ y`.
Reflexive.ne_imp_iff (h : Reflexive r) {x y : α} : x ≠ y → r x y ↔ r x y := ⟨h.rel_of_ne_imp, fun hr _ ↦ hr⟩
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
Reflexive.ne_imp_iff
If a reflexive relation `r : α → α → Prop` holds over `x y : α`, then it holds whether or not `x ≠ y`.
reflexive_ne_imp_iff [IsRefl α r] {x y : α} : x ≠ y → r x y ↔ r x y := IsRefl.reflexive.ne_imp_iff
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
reflexive_ne_imp_iff
If a reflexive relation `r : α → α → Prop` holds over `x y : α`, then it holds whether or not `x ≠ y`. Unlike `Reflexive.ne_imp_iff`, this uses `[IsRefl α r]`.
protected Symmetric.iff (H : Symmetric r) (x y : α) : r x y ↔ r y x := ⟨fun h ↦ H h, fun h ↦ H h⟩
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
Symmetric.iff
null
Symmetric.flip_eq (h : Symmetric r) : flip r = r := funext₂ fun _ _ ↦ propext <| h.iff _ _
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
Symmetric.flip_eq
null
Symmetric.swap_eq : Symmetric r → swap r = r := Symmetric.flip_eq
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
Symmetric.swap_eq
null
flip_eq_iff : flip r = r ↔ Symmetric r := ⟨fun h _ _ ↦ (congr_fun₂ h _ _).mp, Symmetric.flip_eq⟩
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
flip_eq_iff
null
swap_eq_iff : swap r = r ↔ Symmetric r := flip_eq_iff
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
swap_eq_iff
null
Reflexive.comap (h : Reflexive r) (f : α → β) : Reflexive (r on f) := fun a ↦ h (f a)
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
Reflexive.comap
null
Symmetric.comap (h : Symmetric r) (f : α → β) : Symmetric (r on f) := fun _ _ hab ↦ h hab
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
Symmetric.comap
null
Transitive.comap (h : Transitive r) (f : α → β) : Transitive (r on f) := fun _ _ _ hab hbc ↦ h hab hbc
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
Transitive.comap
null
Equivalence.comap (h : Equivalence r) (f : α → β) : Equivalence (r on f) := ⟨fun a ↦ h.refl (f a), h.symm, h.trans⟩
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
Equivalence.comap
null
Comp (r : α → β → Prop) (p : β → γ → Prop) (a : α) (c : γ) : Prop := ∃ b, r a b ∧ p b c @[inherit_doc] local infixr:80 " ∘r " => Relation.Comp @[simp]
def
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
Comp
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.
comp_eq_fun (f : γ → β) : r ∘r (· = f ·) = (r · <| f ·) := by ext x y simp [Comp] @[simp]
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
comp_eq_fun
null
comp_eq : r ∘r (· = ·) = r := comp_eq_fun .. @[simp]
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
comp_eq
null
fun_eq_comp (f : γ → α) : (f · = ·) ∘r r = (r <| f ·) := by ext x y simp [Comp] @[simp]
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
fun_eq_comp
null
eq_comp : (· = ·) ∘r r = r := fun_eq_comp .. @[simp]
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
eq_comp
null
iff_comp {r : Prop → α → Prop} : (· ↔ ·) ∘r r = r := by grind [eq_comp] @[simp]
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
iff_comp
null
comp_iff {r : α → Prop → Prop} : r ∘r (· ↔ ·) = r := by grind [comp_eq]
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
comp_iff
null
comp_assoc : (r ∘r p) ∘r q = r ∘r p ∘r q := by funext a d apply propext constructor · exact fun ⟨c, ⟨b, hab, hbc⟩, hcd⟩ ↦ ⟨b, hab, c, hbc, hcd⟩ · exact fun ⟨b, hab, c, hbc, hcd⟩ ↦ ⟨c, ⟨b, hab, hbc⟩, hcd⟩
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
comp_assoc
null
flip_comp : flip (r ∘r p) = flip p ∘r flip r := by funext c a apply propext constructor · exact fun ⟨b, hab, hbc⟩ ↦ ⟨b, hbc, hab⟩ · exact fun ⟨b, hbc, hab⟩ ↦ ⟨b, hab, hbc⟩
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
flip_comp
null
Fibration := ∀ ⦃a b⦄, rβ b (f a) → ∃ a', rα a' a ∧ f a' = b variable {rα rβ}
def
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
Fibration
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α`.
_root_.Acc.of_fibration (fib : Fibration rα rβ f) {a} (ha : Acc rα a) : Acc rβ (f a) := by induction ha with | intro a _ ih => ?_ refine Acc.intro (f a) fun b hr ↦ ?_ obtain ⟨a', hr', rfl⟩ := fib hr exact ih a' hr'
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
_root_.Acc.of_fibration
If `f : α → β` is a fibration between relations `rα` and `rβ`, and `a : α` is accessible under `rα`, then `f a` is accessible under `rβ`.
_root_.Acc.of_downward_closed (dc : ∀ {a b}, rβ b (f a) → ∃ c, f c = b) (a : α) (ha : Acc (InvImage rβ f) a) : Acc rβ (f a) := ha.of_fibration f fun a _ h ↦ let ⟨a', he⟩ := dc h ⟨a', by simp_all [InvImage], he⟩
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
_root_.Acc.of_downward_closed
null
protected Map (r : α → β → Prop) (f : α → γ) (g : β → δ) : γ → δ → Prop := fun c d ↦ ∃ a b, r a b ∧ f a = c ∧ g b = d
def
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
Map
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`.
map_apply : Relation.Map r f g c d ↔ ∃ a b, r a b ∧ f a = c ∧ g b = d := Iff.rfl @[simp] lemma map_map (r : α → β → Prop) (f₁ : α → γ) (g₁ : β → δ) (f₂ : γ → ε) (g₂ : δ → ζ) : Relation.Map (Relation.Map r f₁ g₁) f₂ g₂ = Relation.Map r (f₂ ∘ f₁) (g₂ ∘ g₁) := by grind [Relation.Map] @[simp]
lemma
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
map_apply
null
map_apply_apply (hf : Injective f) (hg : Injective g) (r : α → β → Prop) (a : α) (b : β) : Relation.Map r f g (f a) (g b) ↔ r a b := by simp [Relation.Map, hf.eq_iff, hg.eq_iff] @[simp] lemma map_id_id (r : α → β → Prop) : Relation.Map r id id = r := by ext; simp [Relation.Map]
lemma
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
map_apply_apply
null
map_reflexive {r : α → α → Prop} (hr : Reflexive r) {f : α → β} (hf : f.Surjective) : Reflexive (Relation.Map r f f) := by intro x obtain ⟨y, rfl⟩ := hf x exact ⟨y, y, hr y, rfl, rfl⟩
lemma
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
map_reflexive
null
map_symmetric {r : α → α → Prop} (hr : Symmetric r) (f : α → β) : Symmetric (Relation.Map r f f) := by rintro _ _ ⟨x, y, hxy, rfl, rfl⟩; exact ⟨_, _, hr hxy, rfl, rfl⟩
lemma
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
map_symmetric
null
map_transitive {r : α → α → Prop} (hr : Transitive r) {f : α → β} (hf : ∀ x y, f x = f y → r x y) : Transitive (Relation.Map r f f) := by rintro _ _ _ ⟨x, y, hxy, rfl, rfl⟩ ⟨y', z, hyz, hy, rfl⟩ exact ⟨x, z, hr hxy <| hr (hf _ _ hy.symm) hyz, rfl, rfl⟩
lemma
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
map_transitive
null
map_equivalence {r : α → α → Prop} (hr : Equivalence r) (f : α → β) (hf : f.Surjective) (hf_ker : ∀ x y, f x = f y → r x y) : Equivalence (Relation.Map r f f) where refl := map_reflexive hr.reflexive hf symm := @(map_symmetric hr.symmetric _) trans := @(map_transitive hr.transitive hf_ker)
lemma
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
map_equivalence
null
map_mono {r s : α → β → Prop} {f : α → γ} {g : β → δ} (h : ∀ x y, r x y → s x y) : ∀ x y, Relation.Map r f g x y → Relation.Map s f g x y := fun _ _ ⟨x, y, hxy, hx, hy⟩ => ⟨x, y, h _ _ hxy, hx, hy⟩
lemma
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
map_mono
null
@[mk_iff ReflTransGen.cases_tail_iff] ReflTransGen (r : α → α → Prop) (a : α) : α → Prop | refl : ReflTransGen r a a | tail {b c} : ReflTransGen r a b → r b c → ReflTransGen r a c attribute [refl] ReflTransGen.refl
inductive
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
ReflTransGen
`ReflTransGen r`: reflexive transitive closure of `r`
@[mk_iff] ReflGen (r : α → α → Prop) (a : α) : α → Prop | refl : ReflGen r a a | single {b} : r a b → ReflGen r a b variable (r) in
inductive
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
ReflGen
`ReflGen r`: reflexive closure of `r`
@[mk_iff] EqvGen : α → α → Prop | rel x y : r x y → EqvGen x y | refl x : EqvGen x x | symm x y : EqvGen x y → EqvGen y x | trans x y z : EqvGen x y → EqvGen y z → EqvGen x z attribute [mk_iff] TransGen attribute [refl] ReflGen.refl
inductive
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
EqvGen
`EqvGen r`: equivalence closure of `r`.
to_reflTransGen : ∀ {a b}, ReflGen r a b → ReflTransGen r a b | a, _, refl => by rfl | _, _, single h => ReflTransGen.tail ReflTransGen.refl h
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
to_reflTransGen
null
mono {p : α → α → Prop} (hp : ∀ a b, r a b → p a b) : ∀ {a b}, ReflGen r a b → ReflGen p a b | a, _, ReflGen.refl => by rfl | a, b, single h => single (hp a b h)
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
mono
null
@[trans] trans (hab : ReflTransGen r a b) (hbc : ReflTransGen r b c) : ReflTransGen r a c := by induction hbc with | refl => assumption | tail _ hcd hac => exact hac.tail hcd
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
trans
null
single (hab : r a b) : ReflTransGen r a b := refl.tail hab
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
single
null
head (hab : r a b) (hbc : ReflTransGen r b c) : ReflTransGen r a c := by induction hbc with | refl => exact refl.tail hab | tail _ hcd hac => exact hac.tail hcd
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
head
null
symmetric (h : Symmetric r) : Symmetric (ReflTransGen r) := by intro x y h induction h with | refl => rfl | tail _ b c => apply Relation.ReflTransGen.head (h b) c
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
symmetric
null
cases_tail : ReflTransGen r a b → b = a ∨ ∃ c, ReflTransGen r a c ∧ r c b := (cases_tail_iff r a b).1 @[elab_as_elim]
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
cases_tail
null
head_induction_on {motive : ∀ a : α, ReflTransGen r a b → Prop} {a : α} (h : ReflTransGen r a b) (refl : motive b refl) (head : ∀ {a c} (h' : r a c) (h : ReflTransGen r c b), motive c h → motive a (h.head h')) : motive a h := by induction h with | refl => exact refl | @tail b c _ hbc ih => apply ih · exact head hbc _ refl · exact fun h1 h2 ↦ head h1 (h2.tail hbc) @[elab_as_elim]
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
head_induction_on
null
trans_induction_on {motive : ∀ {a b : α}, ReflTransGen r a b → Prop} {a b : α} (h : ReflTransGen r a b) (refl : ∀ a, @motive a a refl) (single : ∀ {a b} (h : r a b), motive (single h)) (trans : ∀ {a b c} (h₁ : ReflTransGen r a b) (h₂ : ReflTransGen r b c), motive h₁ → motive h₂ → motive (h₁.trans h₂)) : motive h := by induction h with | refl => exact refl a | tail hab hbc ih => exact trans hab (.single hbc) ih (single hbc)
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
trans_induction_on
null
cases_head (h : ReflTransGen r a b) : a = b ∨ ∃ c, r a c ∧ ReflTransGen r c b := by induction h using Relation.ReflTransGen.head_induction_on <;> grind
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
cases_head
null
cases_head_iff : ReflTransGen r a b ↔ a = b ∨ ∃ c, r a c ∧ ReflTransGen r c b := by use cases_head rintro (rfl | ⟨c, hac, hcb⟩) · rfl · exact head hac hcb
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
cases_head_iff
null
total_of_right_unique (U : Relator.RightUnique r) (ab : ReflTransGen r a b) (ac : ReflTransGen r a c) : ReflTransGen r b c ∨ ReflTransGen r c b := by induction ab with | refl => exact Or.inl ac | tail _ bd IH => rcases IH with (IH | IH) · rcases cases_head IH with (rfl | ⟨e, be, ec⟩) · exact Or.inr (single bd) · cases U bd be exact Or.inl ec · exact Or.inr (IH.tail bd)
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
total_of_right_unique
null
to_reflTransGen {a b} (h : TransGen r a b) : ReflTransGen r a b := by induction h with | single h => exact ReflTransGen.single h | tail _ bc ab => exact ReflTransGen.tail ab bc
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
to_reflTransGen
null
trans_left (hab : TransGen r a b) (hbc : ReflTransGen r b c) : TransGen r a c := by induction hbc with | refl => assumption | tail _ hcd hac => exact hac.tail hcd attribute [trans] trans
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
trans_left
null
head' (hab : r a b) (hbc : ReflTransGen r b c) : TransGen r a c := trans_left (single hab) hbc
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
head'
null
tail' (hab : ReflTransGen r a b) (hbc : r b c) : TransGen r a c := by induction hab generalizing c with | refl => exact single hbc | tail _ hdb IH => exact tail (IH hdb) hbc
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
tail'
null
head (hab : r a b) (hbc : TransGen r b c) : TransGen r a c := head' hab hbc.to_reflTransGen @[elab_as_elim]
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
head
null
head_induction_on {motive : ∀ a : α, TransGen r a b → Prop} {a : α} (h : TransGen r a b) (single : ∀ {a} (h : r a b), motive a (single h)) (head : ∀ {a c} (h' : r a c) (h : TransGen r c b), motive c h → motive a (h.head h')) : motive a h := by induction h with | single h => exact single h | @tail b c _ hbc h_ih => apply h_ih · exact fun h ↦ head h (.single hbc) (single hbc) · exact fun hab hbc ↦ head hab _ @[elab_as_elim]
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
head_induction_on
null
trans_induction_on {motive : ∀ {a b : α}, TransGen r a b → Prop} {a b : α} (h : TransGen r a b) (single : ∀ {a b} (h : r a b), motive (single h)) (trans : ∀ {a b c} (h₁ : TransGen r a b) (h₂ : TransGen r b c), motive h₁ → motive h₂ → motive (h₁.trans h₂)) : motive h := by induction h with | single h => exact single h | tail hab hbc h_ih => exact trans hab (.single hbc) h_ih (single hbc)
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
trans_induction_on
null
trans_right (hab : ReflTransGen r a b) (hbc : TransGen r b c) : TransGen r a c := by induction hbc with | single hbc => exact tail' hab hbc | tail _ hcd hac => exact hac.tail hcd
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
trans_right
null
tail'_iff : TransGen r a c ↔ ∃ b, ReflTransGen r a b ∧ r b c := by refine ⟨fun h ↦ ?_, fun ⟨b, hab, hbc⟩ ↦ tail' hab hbc⟩ cases h with | single hac => exact ⟨_, by rfl, hac⟩ | tail hab hbc => exact ⟨_, hab.to_reflTransGen, hbc⟩
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
tail'_iff
null
head'_iff : TransGen r a c ↔ ∃ b, r a b ∧ ReflTransGen r b c := by refine ⟨fun h ↦ ?_, fun ⟨b, hab, hbc⟩ ↦ head' hab hbc⟩ induction h with | single hac => exact ⟨_, hac, by rfl⟩ | tail _ hbc IH => rcases IH with ⟨d, had, hdb⟩ exact ⟨_, had, hdb.tail hbc⟩
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
head'_iff
null
reflGen_eq_self (hr : Reflexive r) : ReflGen r = r := by ext x y simpa only [reflGen_iff, or_iff_right_iff_imp] using fun h ↦ h ▸ hr y
lemma
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
reflGen_eq_self
null
reflexive_reflGen : Reflexive (ReflGen r) := fun _ ↦ .refl
lemma
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
reflexive_reflGen
null
reflGen_minimal {r' : α → α → Prop} (hr' : Reflexive r') (h : ∀ x y, r x y → r' x y) {x y : α} (hxy : ReflGen r x y) : r' x y := by simpa [reflGen_eq_self hr'] using ReflGen.mono h hxy
lemma
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
reflGen_minimal
null
transGen_eq_self (trans : Transitive r) : TransGen r = r := funext fun a ↦ funext fun b ↦ propext <| ⟨fun h ↦ by induction h with | single hc => exact hc | tail _ hcd hac => exact trans hac hcd, TransGen.single⟩
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
transGen_eq_self
null
transitive_transGen : Transitive (TransGen r) := fun _ _ _ ↦ TransGen.trans
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
transitive_transGen
null
transGen_idem : TransGen (TransGen r) = TransGen r := transGen_eq_self transitive_transGen
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
transGen_idem
null
TransGen.lift {p : β → β → Prop} {a b : α} (f : α → β) (h : ∀ a b, r a b → p (f a) (f b)) (hab : TransGen r a b) : TransGen p (f a) (f b) := by induction hab with | single hac => exact TransGen.single (h a _ hac) | tail _ hcd hac => exact TransGen.tail hac (h _ _ hcd)
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
TransGen.lift
null
TransGen.lift' {p : β → β → Prop} {a b : α} (f : α → β) (h : ∀ a b, r a b → TransGen p (f a) (f b)) (hab : TransGen r a b) : TransGen p (f a) (f b) := by simpa [transGen_idem] using hab.lift f h
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
TransGen.lift'
null
TransGen.closed {p : α → α → Prop} : (∀ a b, r a b → TransGen p a b) → TransGen r a b → TransGen p a b := TransGen.lift' id
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
TransGen.closed
null
TransGen.closed' {P : α → Prop} (dc : ∀ {a b}, r a b → P b → P a) {a b : α} (h : TransGen r a b) : P b → P a := h.head_induction_on dc fun hr _ hi ↦ dc hr ∘ hi
lemma
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
TransGen.closed'
null
TransGen.mono {p : α → α → Prop} : (∀ a b, r a b → p a b) → TransGen r a b → TransGen p a b := TransGen.lift id
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
TransGen.mono
null
transGen_minimal {r' : α → α → Prop} (hr' : Transitive r') (h : ∀ x y, r x y → r' x y) {x y : α} (hxy : TransGen r x y) : r' x y := by simpa [transGen_eq_self hr'] using TransGen.mono h hxy
lemma
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
transGen_minimal
null
TransGen.swap (h : TransGen r b a) : TransGen (swap r) a b := by induction h with | single h => exact TransGen.single h | tail _ hbc ih => exact ih.head hbc
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
TransGen.swap
null
transGen_swap : TransGen (swap r) a b ↔ TransGen r b a := ⟨TransGen.swap, TransGen.swap⟩
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
transGen_swap
null
reflTransGen_iff_eq (h : ∀ b, ¬r a b) : ReflTransGen r a b ↔ b = a := by rw [cases_head_iff]; simp [h, eq_comm]
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
reflTransGen_iff_eq
null
reflTransGen_iff_eq_or_transGen : ReflTransGen r a b ↔ b = a ∨ TransGen r a b := by refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ · cases h with | refl => exact Or.inl rfl | tail hac hcb => exact Or.inr (TransGen.tail' hac hcb) · rcases h with (rfl | h) · rfl · exact h.to_reflTransGen
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
reflTransGen_iff_eq_or_transGen
null
ReflTransGen.lift {p : β → β → Prop} {a b : α} (f : α → β) (h : ∀ a b, r a b → p (f a) (f b)) (hab : ReflTransGen r a b) : ReflTransGen p (f a) (f b) := ReflTransGen.trans_induction_on hab (fun _ ↦ refl) (ReflTransGen.single ∘ h _ _) fun _ _ ↦ trans
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
ReflTransGen.lift
null
ReflTransGen.mono {p : α → α → Prop} : (∀ a b, r a b → p a b) → ReflTransGen r a b → ReflTransGen p a b := ReflTransGen.lift id
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
ReflTransGen.mono
null
reflTransGen_eq_self (refl : Reflexive r) (trans : Transitive r) : ReflTransGen r = r := funext fun a ↦ funext fun b ↦ propext <| ⟨fun h ↦ by induction h with | refl => apply refl | tail _ h₂ IH => exact trans IH h₂, single⟩
theorem
Logic
[ "Mathlib.Logic.Relator", "Mathlib.Tactic.Use", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Tactic.SimpRw", "Mathlib.Logic.Basic", "Mathlib.Order.Defs.Unbundled" ]
Mathlib/Logic/Relation.lean
reflTransGen_eq_self
null