Skip to content

Commit fb031f6

Browse files
committed
chore(Logic/Relation): use Subrelation to state theorems
1 parent 7a9e177 commit fb031f6

6 files changed

Lines changed: 78 additions & 72 deletions

File tree

Mathlib/CategoryTheory/Limits/Types/Filtered.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ protected theorem rel_eq_eqvGen_colimitTypeRel :
112112
constructor
113113
· apply eqvGen_colimitTypeRel_of_rel
114114
· rw [← (FilteredColimit.rel_equiv F).eqvGen_iff]
115-
exact Relation.EqvGen.mono (rel_of_colimitTypeRel F)
115+
exact Relation.EqvGen.mono @(rel_of_colimitTypeRel F)
116116

117117
@[deprecated (since := "2025-06-22")] alias rel_eq_eqvGen_quot_rel :=
118118
FilteredColimit.rel_eq_eqvGen_colimitTypeRel

Mathlib/CategoryTheory/Limits/Types/Shapes.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ theorem coequalizer_preimage_image_eq_of_preimage_eq (π : Y ⟶ Z) (e : f ≫
518518
(mono_iff_injective
519519
(h.coconePointUniqueUpToIso (coequalizerColimit f g).isColimit).inv).mp
520520
inferInstance e'
521-
exact (eqv.eqvGen_iff.mp (Relation.EqvGen.mono lem (Quot.eqvGen_exact e'))).mp hy
521+
exact (eqv.eqvGen_iff.mp (Relation.EqvGen.mono @lem (Quot.eqvGen_exact e'))).mp hy
522522
· exact fun hx => ⟨_, hx, rfl⟩
523523

524524
/-- The categorical coequalizer in `Type u` is the quotient by `f g ~ g x`. -/

Mathlib/Data/Setoid/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def map (r : Setoid α) (f : α → β) : Setoid β :=
369369
equivalence relation on f's codomain defined by x ≈ y ↔ the elements of f⁻¹(x) are related to
370370
the elements of f⁻¹(y) by r. -/
371371
def mapOfSurjective (r : Setoid α) (f : α → β) (h : ker f ≤ r) (hf : Surjective f) : Setoid β :=
372-
⟨Relation.Map r f f, Relation.map_equivalence r.iseqv f hf h⟩
372+
⟨Relation.Map r f f, Relation.map_equivalence r.iseqv f hf @h⟩
373373

374374
/-- A special case of the equivalence closure of an equivalence relation r equaling r. -/
375375
theorem mapOfSurjective_eq_map (h : ker f ≤ r) (hf : Surjective f) :

Mathlib/GroupTheory/FreeGroup/Basic.lean

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ theorem church_rosser : Red L₁ L₂ → Red L₁ L₃ → Join Red L₂ L₃ :
196196

197197
@[to_additive]
198198
theorem cons_cons {p} : Red L₁ L₂ → Red (p :: L₁) (p :: L₂) :=
199-
ReflTransGen.lift (List.cons p) fun _ _ => Step.cons
199+
ReflTransGen.lift (List.cons p) Step.cons
200200

201201
@[to_additive]
202202
theorem cons_cons_iff (p) : Red (p :: L₁) (p :: L₂) ↔ Red L₁ L₂ :=
@@ -226,7 +226,7 @@ theorem append_append_left_iff : ∀ L, Red (L ++ L₁) (L ++ L₂) ↔ Red L₁
226226

227227
@[to_additive]
228228
theorem append_append (h₁ : Red L₁ L₃) (h₂ : Red L₂ L₄) : Red (L₁ ++ L₂) (L₃ ++ L₄) :=
229-
(h₁.lift (fun L => L ++ L₂) fun _ _ => Step.append_right).trans ((append_append_left_iff _).2 h₂)
229+
(h₁.lift (fun L => L ++ L₂) Step.append_right).trans ((append_append_left_iff _).2 h₂)
230230

231231
@[to_additive]
232232
theorem to_append_iff : Red L (L₁ ++ L₂) ↔ ∃ L₃ L₄, L = L₃ ++ L₄ ∧ Red L₃ L₁ ∧ Red L₄ L₂ :=
@@ -316,10 +316,10 @@ theorem Step.sublist (H : Red.Step L₁ L₂) : L₂ <+ L₁ := by
316316
/-- If `w₁ w₂` are words such that `w₁` reduces to `w₂`, then `w₂` is a sublist of `w₁`. -/]
317317
protected theorem sublist : Red L₁ L₂ → L₂ <+ L₁ :=
318318
@reflTransGen_of_transitive_reflexive
319-
_ (fun a b => b <+ a) _ _ _
319+
_ (fun a b => b <+ a) _
320320
(fun l => List.Sublist.refl l)
321321
(fun _a _b _c hab hbc => List.Sublist.trans hbc hab)
322-
(fun _ _ => Red.Step.sublist)
322+
Red.Step.sublist _ _
323323

324324
@[to_additive]
325325
theorem length_le (h : Red L₁ L₂) : L₂.length ≤ L₁.length :=
@@ -367,11 +367,9 @@ theorem join_red_of_step (h : Red.Step L₁ L₂) : Join Red L₁ L₂ :=
367367
@[to_additive]
368368
theorem eqvGen_step_iff_join_red : EqvGen Red.Step L₁ L₂ ↔ Join Red L₁ L₂ :=
369369
Iff.intro
370-
(fun h =>
371-
have : EqvGen (Join Red) L₁ L₂ := h.mono fun _ _ => join_red_of_step
372-
equivalence_join_red.eqvGen_iff.1 this)
373-
(join_of_equivalence (Relation.EqvGen.is_equivalence _) fun _ _ =>
374-
reflTransGen_of_equivalence (Relation.EqvGen.is_equivalence _) EqvGen.rel)
370+
(fun h ↦ equivalence_join_red.eqvGen_iff.mp <| h.mono join_red_of_step)
371+
(join_of_equivalence (Relation.EqvGen.is_equivalence _) <|
372+
reflTransGen_of_equivalence (Relation.EqvGen.is_equivalence _) @(EqvGen.rel))
375373

376374
/-! ### Reduced words -/
377375

@@ -582,7 +580,7 @@ theorem Red.Step.invRev {L₁ L₂ : List (α × Bool)} (h : Red.Step L₁ L₂)
582580

583581
@[to_additive]
584582
theorem Red.invRev {L₁ L₂ : List (α × Bool)} (h : Red L₁ L₂) : Red (invRev L₁) (invRev L₂) :=
585-
Relation.ReflTransGen.lift _ (fun _a _b => Red.Step.invRev) h
583+
ReflTransGen.lift FreeGroup.invRev Red.Step.invRev h
586584

587585
@[to_additive (attr := simp)]
588586
theorem Red.step_invRev_iff :

Mathlib/Logic/Relation.lean

Lines changed: 64 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,13 @@ lemma map_symmetric {r : α → α → Prop} (hr : Symmetric r) (f : α → β)
223223
rintro _ _ ⟨x, y, hxy, rfl, rfl⟩; exact ⟨_, _, hr hxy, rfl, rfl⟩
224224

225225
lemma map_transitive {r : α → α → Prop} (hr : Transitive r) {f : α → β}
226-
(hf : ∀ x y, f x = f y → r x y) :
226+
(hf : Subrelation ((· = ·) on f) r) :
227227
Transitive (Relation.Map r f f) := by
228228
rintro _ _ _ ⟨x, y, hxy, rfl, rfl⟩ ⟨y', z, hyz, hy, rfl⟩
229-
exact ⟨x, z, hr hxy <| hr (hf _ _ hy.symm) hyz, rfl, rfl⟩
229+
exact ⟨x, z, hr hxy <| hr (hf hy.symm) hyz, rfl, rfl⟩
230230

231231
lemma map_equivalence {r : α → α → Prop} (hr : Equivalence r) (f : α → β)
232-
(hf : f.Surjective) (hf_ker : ∀ x y, f x = f y → r x y) :
232+
(hf : f.Surjective) (hf_ker : Subrelation ((· = ·) on f) r) :
233233
Equivalence (Relation.Map r f f) where
234234
refl := map_reflexive hr.reflexive hf
235235
symm := @(map_symmetric hr.symmetric _)
@@ -272,13 +272,13 @@ attribute [refl] ReflGen.refl
272272

273273
namespace ReflGen
274274

275-
theorem to_reflTransGen : ∀ {a b}, ReflGen r a b → ReflTransGen r a b
275+
theorem to_reflTransGen : Subrelation (ReflGen r) (ReflTransGen r)
276276
| a, _, refl => by rfl
277277
| _, _, single h => ReflTransGen.tail ReflTransGen.refl h
278278

279-
theorem mono {p : α → α → Prop} (hp : ∀ a b, r a b → p a b) : ∀ {a b}, ReflGen r a b → ReflGen p a b
279+
theorem mono {p : α → α → Prop} (hp : Subrelation r p) : Subrelation (ReflGen r) (ReflGen p)
280280
| a, _, ReflGen.refl => by rfl
281-
| a, b, single h => single (hp a b h)
281+
| a, b, single h => single <| hp h
282282

283283
instance : IsRefl α (ReflGen r) :=
284284
⟨@refl α r⟩
@@ -293,8 +293,8 @@ theorem trans (hab : ReflTransGen r a b) (hbc : ReflTransGen r b c) : ReflTransG
293293
| refl => assumption
294294
| tail _ hcd hac => exact hac.tail hcd
295295

296-
theorem single (hab : r a b) : ReflTransGen r a b :=
297-
refl.tail hab
296+
theorem single : Subrelation r (ReflTransGen r) :=
297+
refl.tail
298298

299299
theorem head (hab : r a b) (hbc : ReflTransGen r b c) : ReflTransGen r a c := by
300300
induction hbc with
@@ -357,7 +357,7 @@ end ReflTransGen
357357

358358
namespace TransGen
359359

360-
theorem to_reflTransGen {a b} (h : TransGen r a b) : ReflTransGen r a b := by
360+
theorem to_reflTransGen : Subrelation (TransGen r) (ReflTransGen r) := fun h ↦ by
361361
induction h with
362362
| single h => exact ReflTransGen.single h
363363
| tail _ bc ab => exact ReflTransGen.tail ab bc
@@ -432,8 +432,8 @@ lemma reflGen_eq_self (hr : Reflexive r) : ReflGen r = r := by
432432

433433
lemma reflexive_reflGen : Reflexive (ReflGen r) := fun _ ↦ .refl
434434

435-
lemma reflGen_minimal {r' : α → α → Prop} (hr' : Reflexive r') (h : ∀ x y, r x y → r' x y) {x y : α}
436-
(hxy : ReflGen r x y) : r' x y := by
435+
lemma reflGen_minimal {r' : α → α → Prop} (hr' : Reflexive r') (h : Subrelation r r') :
436+
Subrelation (ReflGen r) r' := fun hxy ↦ by
437437
simpa [reflGen_eq_self hr'] using ReflGen.mono h hxy
438438

439439
end reflGen
@@ -467,41 +467,44 @@ theorem transitive_transGen : Transitive (TransGen r) := fun _ _ _ ↦ TransGen.
467467
theorem transGen_idem : TransGen (TransGen r) = TransGen r :=
468468
transGen_eq_self transitive_transGen
469469

470-
theorem TransGen.lift {p : β → β → Prop} {a b : α} (f : α → β) (h : ∀ a b, r a b → p (f a) (f b))
471-
(hab : TransGen r a b) : TransGen p (f a) (f b) := by
470+
theorem TransGen.lift {p : β → β → Prop} (f : α → β) (h : Subrelation r (p on f)) :
471+
Subrelation (TransGen r) (TransGen p on f) := fun hab ↦ by
472472
induction hab with
473-
| single hac => exact TransGen.single (h a _ hac)
474-
| tail _ hcd hac => exact TransGen.tail hac (h _ _ hcd)
473+
| single hac => exact TransGen.single <| h hac
474+
| tail _ hcd hac => exact TransGen.tail hac <| h hcd
475475

476-
theorem TransGen.lift' {p : β → β → Prop} {a b : α} (f : α → β)
477-
(h : ∀ a b, r a b → TransGen p (f a) (f b)) (hab : TransGen r a b) :
478-
TransGen p (f a) (f b) := by
476+
theorem TransGen.lift' {p : β → β → Prop} (f : α → β) (h : Subrelation r (TransGen p on f)) :
477+
Subrelation (TransGen r) (TransGen p on f) := fun hab ↦ by
479478
simpa [transGen_idem] using hab.lift f h
480479

481480
theorem TransGen.closed {p : α → α → Prop} :
482-
(∀ a b, r a b → TransGen p a b) → TransGen r a b → TransGen p a b :=
481+
(Subrelation r (TransGen p))Subrelation (TransGen r) (TransGen p) :=
483482
TransGen.lift' id
484483

485-
lemma TransGen.closed' {P : α → Prop} (dc : ∀ {a b}, r a bP b → P a)
486-
{a b : α} (h : TransGen r a b) : P b → P a :=
487-
h.head_induction_on dc fun hr _ hi ↦ dc hr ∘ hi
484+
lemma TransGen.closed' {P : α → Prop} (dc : Subrelation r (swap (··) on P)) :
485+
Subrelation (TransGen r) (swap (· → ·) on P) :=
486+
fun h ↦ h.head_induction_on dc fun hr _ hi ↦ dc hr ∘ hi
488487

489488
theorem TransGen.mono {p : α → α → Prop} :
490-
(∀ a b, r a b → p a b) → TransGen r a b → TransGen p a b :=
489+
(Subrelation r p) → Subrelation (TransGen r) (TransGen p) :=
491490
TransGen.lift id
492491

493-
lemma transGen_minimal {r' : α → α → Prop} (hr' : Transitive r') (h : ∀ x y, r x y → r' x y)
494-
{x y : α} (hxy : TransGen r x y) : r' x y := by
492+
lemma transGen_minimal {r' : α → α → Prop} (hr' : Transitive r') (h : Subrelation r r') :
493+
Subrelation (TransGen r) r' := fun hxy ↦ by
495494
simpa [transGen_eq_self hr'] using TransGen.mono h hxy
496495

497-
theorem TransGen.swap (h : TransGen r b a) : TransGen (swap r) a b := by
496+
theorem TransGen.swap : Subrelation (swap (TransGen r)) (TransGen (swap r)) := fun h ↦ by
498497
induction h with
499498
| single h => exact TransGen.single h
500499
| tail _ hbc ih => exact ih.head hbc
501500

502-
theorem transGen_swap : TransGen (swap r) a b ↔ TransGen r b a :=
501+
theorem transGen_swap : TransGen (swap r) a b ↔ swap (TransGen r) a b :=
503502
⟨TransGen.swap, TransGen.swap⟩
504503

504+
theorem transGen_swap_eq_swap_transGen : TransGen (swap r) = swap (TransGen r) := by
505+
ext a b
506+
exact transGen_swap
507+
505508
end TransGen
506509

507510
section ReflTransGen
@@ -520,12 +523,12 @@ theorem reflTransGen_iff_eq_or_transGen : ReflTransGen r a b ↔ b = a ∨ Trans
520523
· rfl
521524
· exact h.to_reflTransGen
522525

523-
theorem ReflTransGen.lift {p : β → β → Prop} {a b : α} (f : α → β)
524-
(h : ∀ a b, r a b → p (f a) (f b)) (hab : ReflTransGen r a b) : ReflTransGen p (f a) (f b) :=
525-
ReflTransGen.trans_induction_on hab (fun _ ↦ refl) (ReflTransGen.single ∘ h _ _) fun _ _ ↦ trans
526+
theorem ReflTransGen.lift {p : β → β → Prop} (f : α → β) (h : Subrelation r (p on f)) :
527+
Subrelation (ReflTransGen r) (ReflTransGen p on f) := fun hab ↦
528+
ReflTransGen.trans_induction_on hab (fun _ ↦ refl) (ReflTransGen.single ∘ h) fun _ _ ↦ trans
526529

527-
theorem ReflTransGen.mono {p : α → α → Prop} : (∀ a b, r a b → p a b) →
528-
ReflTransGen r a b → ReflTransGen p a b :=
530+
theorem ReflTransGen.mono {p : α → α → Prop} : (Subrelation r p) →
531+
Subrelation (ReflTransGen r) (ReflTransGen p) :=
529532
ReflTransGen.lift id
530533

531534
theorem reflTransGen_eq_self (refl : Reflexive r) (trans : Transitive r) : ReflTransGen r = r :=
@@ -536,7 +539,7 @@ theorem reflTransGen_eq_self (refl : Reflexive r) (trans : Transitive r) : ReflT
536539
| tail _ h₂ IH => exact trans IH h₂, single⟩
537540

538541
lemma reflTransGen_minimal {r' : α → α → Prop} (hr₁ : Reflexive r') (hr₂ : Transitive r')
539-
(h : ∀ x y, r x y → r' x y) {x y : α} (hxy : ReflTransGen r x y) : r' x y := by
542+
(h : Subrelation r r') : Subrelation (ReflTransGen r) r' := fun hxy ↦ by
540543
simpa [reflTransGen_eq_self hr₁ hr₂] using ReflTransGen.mono h hxy
541544

542545
theorem reflexive_reflTransGen : Reflexive (ReflTransGen r) := fun _ ↦ refl
@@ -558,23 +561,28 @@ instance : IsTrans α (ReflTransGen r) :=
558561
theorem reflTransGen_idem : ReflTransGen (ReflTransGen r) = ReflTransGen r :=
559562
reflTransGen_eq_self reflexive_reflTransGen transitive_reflTransGen
560563

561-
theorem ReflTransGen.lift' {p : β → β → Prop} {a b : α} (f : α → β)
562-
(h : ∀ a b, r a b → ReflTransGen p (f a) (f b))
563-
(hab : ReflTransGen r a b) : ReflTransGen p (f a) (f b) := by
564+
theorem ReflTransGen.lift' {p : β → β → Prop} (f : α → β)
565+
(h : Subrelation r (ReflTransGen p on f)) : Subrelation (ReflTransGen r) (ReflTransGen p on f)
566+
:= fun hab ↦ by
564567
simpa [reflTransGen_idem] using hab.lift f h
565568

566569
theorem reflTransGen_closed {p : α → α → Prop} :
567-
(∀ a b, r a b → ReflTransGen p a b) → ReflTransGen r a b → ReflTransGen p a b :=
570+
(Subrelation r (ReflTransGen p))Subrelation (ReflTransGen r) (ReflTransGen p) :=
568571
ReflTransGen.lift' id
569572

570-
theorem ReflTransGen.swap (h : ReflTransGen r b a) : ReflTransGen (swap r) a b := by
573+
theorem ReflTransGen.swap : Subrelation (swap <| ReflTransGen r) (ReflTransGen <| swap r) := by
574+
intro _ _ h
571575
induction h with
572576
| refl => rfl
573577
| tail _ hbc ih => exact ih.head hbc
574578

575579
theorem reflTransGen_swap : ReflTransGen (swap r) a b ↔ ReflTransGen r b a :=
576580
⟨ReflTransGen.swap, ReflTransGen.swap⟩
577581

582+
theorem reflTransGen_swap_eq_swap_reflTransGen : ReflTransGen (swap r) = swap (ReflTransGen r) := by
583+
ext a b
584+
exact reflTransGen_swap
585+
578586
@[simp] lemma reflGen_transGen : ReflGen (TransGen r) = ReflTransGen r := by
579587
ext x y
580588
simp_rw [reflTransGen_iff_eq_or_transGen, reflGen_iff]
@@ -583,10 +591,10 @@ theorem reflTransGen_swap : ReflTransGen (swap r) a b ↔ ReflTransGen r b a :=
583591
ext x y
584592
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
585593
· simpa [reflTransGen_idem]
586-
using TransGen.to_reflTransGen <| TransGen.mono (fun _ _ ↦ ReflGen.to_reflTransGen) h
594+
using TransGen.to_reflTransGen <| TransGen.mono (ReflGen.to_reflTransGen) h
587595
· obtain (rfl | h) := reflTransGen_iff_eq_or_transGen.mp h
588596
· exact .single .refl
589-
· exact TransGen.mono (fun _ _ ↦ .single) h
597+
· exact TransGen.mono (.single) h
590598

591599
@[simp] lemma reflTransGen_reflGen : ReflTransGen (ReflGen r) = ReflTransGen r := by
592600
simp only [← transGen_reflGen, reflGen_eq_self reflexive_reflGen]
@@ -618,10 +626,10 @@ see for example `Quot.eqvGen_exact` and `Quot.eqvGen_sound`. -/
618626
def setoid : Setoid α :=
619627
Setoid.mk _ (EqvGen.is_equivalence r)
620628

621-
theorem mono {r p : α → α → Prop} (hrp : ∀ a b, r a b → p a b) (h : EqvGen r a b) :
622-
EqvGen p a b := by
629+
theorem mono {r p : α → α → Prop} (hrp : Subrelation r p) : Subrelation (EqvGen r) (EqvGen p) := by
630+
intro _ _ h
623631
induction h with
624-
| rel a b h => exact EqvGen.rel _ _ (hrp _ _ h)
632+
| rel a b h => exact EqvGen.rel _ _ <| hrp h
625633
| refl => exact EqvGen.refl _
626634
| symm a b _ ih => exact EqvGen.symm _ _ ih
627635
| trans a b c _ _ hab hbc => exact EqvGen.trans _ _ _ hab hbc
@@ -665,8 +673,8 @@ theorem church_rosser (h : ∀ a b c, r a b → r a c → ∃ d, ReflGen r b d
665673
| single hba => exact ⟨a, hea, hcb.tail hba⟩
666674

667675

668-
theorem join_of_single (h : Reflexive r) (hab : r a b) : Join r a b :=
669-
⟨b, hab, h b
676+
theorem join_of_single (h : Reflexive r) : Subrelation r (Join r) :=
677+
fun hab ↦ ⟨_, hab, h _
670678

671679
theorem symmetric_join : Symmetric (Join r) := fun _ _ ⟨c, hac, hcb⟩ ↦ ⟨c, hcb, hac⟩
672680

@@ -687,18 +695,18 @@ theorem equivalence_join_reflTransGen
687695
Equivalence (Join (ReflTransGen r)) :=
688696
equivalence_join reflexive_reflTransGen transitive_reflTransGen fun _ _ _ ↦ church_rosser h
689697

690-
theorem join_of_equivalence {r' : α → α → Prop} (hr : Equivalence r) (h : ∀ a b, r' a b → r a b) :
691-
Join r' a b → r a b
692-
| ⟨_, hac, hbc⟩ => hr.trans (h _ _ hac) (hr.symm <| h _ _ hbc)
698+
theorem join_of_equivalence {r' : α → α → Prop} (hr : Equivalence r) (h : Subrelation r' r) :
699+
Subrelation (Join r') r :=
700+
fun ⟨_, hac, hbc⟩ hr.trans (h hac) (hr.symm <| h hbc)
693701

694702
theorem reflTransGen_of_transitive_reflexive {r' : α → α → Prop} (hr : Reflexive r)
695-
(ht : Transitive r) (h : ∀ a b, r' a b → r a b) (h' : ReflTransGen r' a b) : r a b := by
703+
(ht : Transitive r) (h : Subrelation r' r) : Subrelation (ReflTransGen r') r := fun h' ↦ by
696704
induction h' with
697705
| refl => exact hr _
698-
| tail _ hbc ih => exact ht ih (h _ _ hbc)
706+
| tail _ hbc ih => exact ht ih <| h hbc
699707

700708
theorem reflTransGen_of_equivalence {r' : α → α → Prop} (hr : Equivalence r) :
701-
(∀ a b, r' a b → r a b) → ReflTransGen r' a b → r a b :=
709+
(Subrelation r' r) → Subrelation (ReflTransGen r') r :=
702710
reflTransGen_of_transitive_reflexive hr.1 (fun _ _ _ ↦ hr.trans)
703711

704712
end Join
@@ -711,12 +719,12 @@ open Relation
711719

712720
variable {r : α → α → Prop} {a b : α}
713721

714-
theorem Quot.eqvGen_exact (H : Quot.mk r a = Quot.mk r b) : EqvGen r a b :=
715-
@Quotient.exact _ (EqvGen.setoid r) a b (congrArg
716-
(Quot.lift (Quotient.mk (EqvGen.setoid r)) (fun x y h ↦ Quot.sound (EqvGen.rel x y h))) H)
722+
theorem Quot.eqvGen_exact : Subrelation ((· = ·) on Quot.mk r) (EqvGen r) :=
723+
fun H ↦ Quotient.exact <| congrArg
724+
(Quot.lift (Quotient.mk <| EqvGen.setoid r) (fun _ _ h ↦ Quot.sound <| EqvGen.rel _ _ h)) H
717725

718-
theorem Quot.eqvGen_sound (H : EqvGen r a b) : Quot.mk r a = Quot.mk r b :=
719-
EqvGen.rec
726+
theorem Quot.eqvGen_sound : Subrelation (EqvGen r) ((· = ·) on Quot.mk r) :=
727+
fun H ↦ EqvGen.rec
720728
(fun _ _ h ↦ Quot.sound h)
721729
(fun _ ↦ rfl)
722730
(fun _ _ _ IH ↦ Eq.symm IH)

Mathlib/Order/Interval/Finset/Basic.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,22 +1170,22 @@ lemma monotone_iff_forall_wcovBy [Preorder α] [LocallyFiniteOrder α] [Preorder
11701170
(f : α → β) : Monotone f ↔ ∀ a b : α, a ⩿ b → f a ≤ f b := by
11711171
refine ⟨fun hf _ _ h ↦ hf h.le, fun h a b hab ↦ ?_⟩
11721172
simpa [transGen_eq_self (r := (· ≤ · : β → β → Prop)) transitive_le]
1173-
using TransGen.lift f h <| le_iff_transGen_wcovBy.mp hab
1173+
using TransGen.lift f @h <| le_iff_transGen_wcovBy.mp hab
11741174

11751175
/-- A function from a locally finite partial order is monotone if and only if it is monotone when
11761176
restricted to pairs satisfying `a ⋖ b`. -/
11771177
lemma monotone_iff_forall_covBy [PartialOrder α] [LocallyFiniteOrder α] [Preorder β]
11781178
(f : α → β) : Monotone f ↔ ∀ a b : α, a ⋖ b → f a ≤ f b := by
11791179
refine ⟨fun hf _ _ h ↦ hf h.le, fun h a b hab ↦ ?_⟩
11801180
simpa [reflTransGen_eq_self (r := (· ≤ · : β → β → Prop)) IsRefl.reflexive transitive_le]
1181-
using ReflTransGen.lift f h <| le_iff_reflTransGen_covBy.mp hab
1181+
using ReflTransGen.lift f @h <| le_iff_reflTransGen_covBy.mp hab
11821182

11831183
/-- A function from a locally finite preorder is strictly monotone if and only if it is strictly
11841184
monotone when restricted to pairs satisfying `a ⋖ b`. -/
11851185
lemma strictMono_iff_forall_covBy [Preorder α] [LocallyFiniteOrder α] [Preorder β]
11861186
(f : α → β) : StrictMono f ↔ ∀ a b : α, a ⋖ b → f a < f b := by
11871187
refine ⟨fun hf _ _ h ↦ hf h.lt, fun h a b hab ↦ ?_⟩
1188-
have := Relation.TransGen.lift f h (a := a) (b := b)
1188+
have := Relation.TransGen.lift f @h (x := a) (y := b)
11891189
rw [← lt_iff_transGen_covBy, transGen_eq_self (@lt_trans β _)] at this
11901190
exact this hab
11911191

0 commit comments

Comments
 (0)