Skip to content

Commit

Permalink
feat(topology/subset_properties): locally_compact_space instance fo…
Browse files Browse the repository at this point in the history
…r `Π` types (leanprover-community#15707)

This PR adds 
- `locally_compact_space.pi` mirroring `locally_compact_space.prod` and
- `locally_compact_space.pi_finite` for finite products

Proof by: @alreadydone 



Co-authored-by: Junyan Xu <junyanxumath@gmail.com>
  • Loading branch information
2 people authored and bottine committed Jul 30, 2022
1 parent b7ba5bd commit 025c700
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/topology/subset_properties.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,40 @@ instance locally_compact_space.prod (α : Type*) (β : Type*) [topological_space
have _ := λ x : α × β, (compact_basis_nhds x.1).prod_nhds' (compact_basis_nhds x.2),
locally_compact_space_of_has_basis this $ λ x s ⟨⟨_, h₁⟩, _, h₂⟩, h₁.prod h₂

section pi

variables [Π i, topological_space (π i)] [∀ i, locally_compact_space (π i)]

/--In general it suffices that all but finitely many of the spaces are compact,
but that's not straightforward to state and use. -/
instance locally_compact_space.pi_finite [finite ι] : locally_compact_space (Π i, π i) :=
⟨λ t n hn, begin
rw [nhds_pi, filter.mem_pi] at hn,
obtain ⟨s, hs, n', hn', hsub⟩ := hn,
choose n'' hn'' hsub' hc using λ i, locally_compact_space.local_compact_nhds (t i) (n' i) (hn' i),
refine ⟨(set.univ : set ι).pi n'', _, subset_trans (λ _ h, _) hsub, is_compact_univ_pi hc⟩,
{ exact (set_pi_mem_nhds_iff (@set.finite_univ ι _) _).mpr (λ i hi, hn'' i), },
{ exact λ i hi, hsub' i (h i trivial), },
end

/-- For spaces that are not Hausdorff. -/
instance locally_compact_space.pi [∀ i, compact_space (π i)] : locally_compact_space (Π i, π i) :=
⟨λ t n hn, begin
rw [nhds_pi, filter.mem_pi] at hn,
obtain ⟨s, hs, n', hn', hsub⟩ := hn,
choose n'' hn'' hsub' hc using λ i, locally_compact_space.local_compact_nhds (t i) (n' i) (hn' i),
refine ⟨s.pi n'', _, subset_trans (λ _, _) hsub, _⟩,
{ exact (set_pi_mem_nhds_iff hs _).mpr (λ i _, hn'' i), },
{ exact forall₂_imp (λ i hi hi', hsub' i hi'), },
{ rw ← set.univ_pi_ite,
refine is_compact_univ_pi (λ i, _),
by_cases i ∈ s,
{ rw if_pos h, exact hc i, },
{ rw if_neg h, exact compact_space.compact_univ, } },
end

end pi

/-- A reformulation of the definition of locally compact space: In a locally compact space,
every open set containing `x` has a compact subset containing `x` in its interior. -/
lemma exists_compact_subset [locally_compact_space α] {x : α} {U : set α}
Expand Down

0 comments on commit 025c700

Please sign in to comment.