Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 8e74c62

Browse files
urkudmergify[bot]
authored andcommitted
chore(data/finset,order/filter): simplify a few proofs (#1747)
Also add `finset.image_mono` and `finset.range_mono`.
1 parent 198fb09 commit 8e74c62

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

src/data/finset.lean

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -754,11 +754,7 @@ range_succ
754754

755755
@[simp] theorem range_subset {n m} : range n ⊆ range m ↔ n ≤ m := range_subset
756756

757-
theorem exists_nat_subset_range (s : finset ℕ) : ∃n : ℕ, s ⊆ range n :=
758-
finset.induction_on s ⟨0, empty_subset _⟩ $ λ a s ha ⟨n, hn⟩,
759-
⟨max (a + 1) n, insert_subset.2
760-
by simpa only [mem_range] using le_max_left (a+1) n,
761-
subset.trans hn (by simpa only [range_subset] using le_max_right (a+1) n)⟩⟩
757+
theorem range_mono : monotone range := λ _ _, range_subset.2
762758

763759
end range
764760

@@ -986,6 +982,8 @@ eq_of_veq $ by simp only [image_val, erase_dup_map_erase_dup_eq, multiset.map_ma
986982
theorem image_subset_image {s₁ s₂ : finset α} (h : s₁ ⊆ s₂) : s₁.image f ⊆ s₂.image f :=
987983
by simp only [subset_def, image_val, subset_erase_dup', erase_dup_subset', multiset.map_subset_map h]
988984

985+
theorem image_mono (f : α → β) : monotone (finset.image f) := λ _ _, image_subset_image
986+
989987
theorem image_filter {p : β → Prop} [decidable_pred p] :
990988
(s.image f).filter p = (s.filter (p ∘ f)).image f :=
991989
ext.2 $ λ b, by simp only [mem_filter, mem_image, exists_prop]; exact
@@ -1566,6 +1564,12 @@ end,
15661564
by letI := classical.dec_eq β; from
15671565
finset.induction_on s (by simp [bot]) (by simp [A] {contextual := tt})
15681566

1567+
theorem subset_range_sup_succ (s : finset ℕ) : s ⊆ range (s.sup id).succ :=
1568+
λ n hn, mem_range.2 $ nat.lt_succ_of_le $ le_sup hn
1569+
1570+
theorem exists_nat_subset_range (s : finset ℕ) : ∃n : ℕ, s ⊆ range n :=
1571+
⟨_, s.subset_range_sup_succ⟩
1572+
15691573
end sup
15701574

15711575
lemma sup_eq_supr [complete_lattice β] (s : finset α) (f : α → β) : s.sup f = (⨆a∈s, f a) :=

src/order/filter/basic.lean

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,16 +1579,13 @@ lemma tendsto_at_top_at_top_of_monotone [nonempty α] [semilattice_sup α] [preo
15791579
alias tendsto_at_top_at_top_of_monotone ← monotone.tendsto_at_top_at_top
15801580

15811581
lemma tendsto_finset_range : tendsto finset.range at_top at_top :=
1582-
(tendsto_at_top_at_top _).2 (λ s, ⟨s.sup id + 1, λ N hN n hn,
1583-
finset.mem_range.2 $ lt_of_le_of_lt (finset.le_sup hn) $ nat.lt_of_succ_le hN⟩)
1582+
finset.range_mono.tendsto_at_top_at_top.2 finset.exists_nat_subset_range
15841583

15851584
lemma tendsto_finset_image_at_top_at_top {i : β → γ} {j : γ → β} (h : ∀x, j (i x) = x) :
1586-
tendsto (λs:finset γ, s.image j) at_top at_top :=
1587-
tendsto_infi.2 $ assume s, tendsto_infi' (s.image i) $ tendsto_principal_principal.2 $
1588-
assume t (ht : s.image i ⊆ t),
1589-
calc s = (s.image i).image j :
1590-
by simp only [finset.image_image, (∘), h]; exact finset.image_id.symm
1591-
... ⊆ t.image j : finset.image_subset_image ht
1585+
tendsto (finset.image j) at_top at_top :=
1586+
have j ∘ i = id, from funext h,
1587+
(finset.image_mono j).tendsto_at_top_at_top.2 $ assume s,
1588+
⟨s.image i, by simp only [finset.image_image, this, finset.image_id, le_refl]⟩
15921589

15931590
lemma prod_at_top_at_top_eq {β₁ β₂ : Type*} [inhabited β₁] [inhabited β₂] [semilattice_sup β₁]
15941591
[semilattice_sup β₂] : filter.prod (@at_top β₁ _) (@at_top β₂ _) = @at_top (β₁ × β₂) _ :=

0 commit comments

Comments
 (0)