Skip to content

Commit

Permalink
chore(Data/Finset/Lattice): better docs for gcongr lemmas (#11067)
Browse files Browse the repository at this point in the history
I accidentally merged #9520
before pushing these changes requested by @Vierkantor
  • Loading branch information
urkud committed Feb 29, 2024
1 parent 51b9fc4 commit 2f2096e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Mathlib/Data/Finset/Lattice.lean
Expand Up @@ -966,7 +966,9 @@ theorem sup'_mono {s₁ s₂ : Finset β} (h : s₁ ⊆ s₂) (h₁ : s₁.Nonem
s₁.sup' h₁ f ≤ s₂.sup' (h₁.mono h) f :=
Finset.sup'_le h₁ _ (fun _ hb => le_sup' _ (h hb))

/-- A version of `Finset.sup'_mono` acceptable for `@[gcongr]`. -/
/-- A version of `Finset.sup'_mono` acceptable for `@[gcongr]`.
Instead of deducing `s₂.Nonempty` from `s₁.Nonempty` and `s₁ ⊆ s₂`,
this version takes it as an argument. -/
@[gcongr]
lemma _root_.GCongr.finset_sup'_le {s₁ s₂ : Finset β} (h : s₁ ⊆ s₂)
{h₁ : s₁.Nonempty} {h₂ : s₂.Nonempty} : s₁.sup' h₁ f ≤ s₂.sup' h₂ f :=
Expand Down Expand Up @@ -1143,7 +1145,9 @@ theorem inf'_mono {s₁ s₂ : Finset β} (h : s₁ ⊆ s₂) (h₁ : s₁.Nonem
s₂.inf' (h₁.mono h) f ≤ s₁.inf' h₁ f :=
Finset.le_inf' h₁ _ (fun _ hb => inf'_le _ (h hb))

/-- A version of `Finset.inf'_mono` acceptable for `@[gcongr]`. -/
/-- A version of `Finset.inf'_mono` acceptable for `@[gcongr]`.
Instead of deducing `s₂.Nonempty` from `s₁.Nonempty` and `s₁ ⊆ s₂`,
this version takes it as an argument. -/
@[gcongr]
lemma _root_.GCongr.finset_inf'_mono {s₁ s₂ : Finset β} (h : s₁ ⊆ s₂)
{h₁ : s₁.Nonempty} {h₂ : s₂.Nonempty} : s₂.inf' h₂ f ≤ s₁.inf' h₁ f :=
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Order/Filter/AtTopBot.lean
Expand Up @@ -1907,7 +1907,7 @@ theorem exists_seq_monotone_tendsto_atTop_atTop (α : Type*) [SemilatticeSup α]
obtain ⟨ys, h⟩ := exists_seq_tendsto (atTop : Filter α)
let xs : ℕ → α := fun n => Finset.sup' (Finset.range (n + 1)) Finset.nonempty_range_succ ys
have h_mono : Monotone xs := fun i j hij ↦ by
simp only -- Need to unfold `xs` and do alpha reduction, otherwise `gcongr` fails
simp only [xs] -- Need to unfold `xs` and do alpha reduction, otherwise `gcongr` fails
gcongr
refine ⟨xs, h_mono, tendsto_atTop_mono (fun n ↦ Finset.le_sup' _ ?_) h⟩
simp
Expand Down

0 comments on commit 2f2096e

Please sign in to comment.