Skip to content

Commit

Permalink
feat(equiv|set|topology): various additions (#5656)
Browse files Browse the repository at this point in the history
define sigma_compact_space
update module doc for topology/subset_properties
define shearing
some lemmas in set.basic, equiv.mul_add and topology.instances.ennreal



Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com>
  • Loading branch information
fpvandoorn and bryangingechen committed Jan 10, 2021
1 parent 62c1912 commit cc6f039
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 12 deletions.
10 changes: 10 additions & 0 deletions src/data/equiv/basic.lean
Expand Up @@ -912,6 +912,16 @@ lemma sigma_equiv_prod_sigma_congr_right :
(prod_congr_right e).trans (sigma_equiv_prod α₁ β₂).symm :=
by { ext ⟨a, b⟩ : 1, simp }

/-- A variation on `equiv.prod_congr` where the equivalence in the second component can depend
on the first component. A typical example is a shear mapping, explaining the name of this
declaration. -/
@[simps {fully_applied := ff}]
def prod_shear {α₁ β₁ α₂ β₂ : Type*} (e₁ : α₁ ≃ α₂) (e₂ : α₁ → β₁ ≃ β₂) : α₁ × β₁ ≃ α₂ × β₂ :=
{ to_fun := λ x : α₁ × β₁, (e₁ x.1, e₂ x.1 x.2),
inv_fun := λ y : α₂ × β₂, (e₁.symm y.1, (e₂ $ e₁.symm y.1).symm y.2),
left_inv := by { rintro ⟨x₁, y₁⟩, simp only [symm_apply_apply] },
right_inv := by { rintro ⟨x₁, y₁⟩, simp only [apply_symm_apply] } }

end prod_congr

namespace perm
Expand Down
14 changes: 13 additions & 1 deletion src/data/equiv/mul_add.lean
Expand Up @@ -102,7 +102,9 @@ def symm (h : M ≃* N) : N ≃* M :=
.. h.to_equiv.symm}

/-- See Note [custom simps projection] -/
@[to_additive add_equiv.simps.inv_fun "See Note [custom simps projection]"]
-- we don't hyperlink the note in the additive version, since that breaks syntax highlighting
-- in the whole file.
@[to_additive add_equiv.simps.inv_fun "See Note custom simps projection"]
def simps.inv_fun (e : M ≃* N) : N → M := e.symm

initialize_simps_projections add_equiv (to_fun → apply, inv_fun → symm_apply)
Expand Down Expand Up @@ -337,6 +339,10 @@ protected def mul_left (a : G) : perm G := (to_units a).mul_left
@[simp, to_additive]
lemma coe_mul_left (a : G) : ⇑(equiv.mul_left a) = (*) a := rfl

/-- extra simp lemma that `dsimp` can use. `simp` will never use this. -/
@[simp, nolint simp_nf, to_additive]
lemma mul_left_symm_apply (a : G) : ((equiv.mul_left a).symm : G → G) = (*) a⁻¹ := rfl

@[simp, to_additive]
lemma mul_left_symm (a : G) : (equiv.mul_left a).symm = equiv.mul_left a⁻¹ :=
ext $ λ x, rfl
Expand All @@ -352,6 +358,12 @@ lemma coe_mul_right (a : G) : ⇑(equiv.mul_right a) = λ x, x * a := rfl
lemma mul_right_symm (a : G) : (equiv.mul_right a).symm = equiv.mul_right a⁻¹ :=
ext $ λ x, rfl

/-- extra simp lemma that `dsimp` can use. `simp` will never use this. -/
@[simp, nolint simp_nf, to_additive]
lemma mul_right_symm_apply (a : G) : ((equiv.mul_right a).symm : G → G) = λ x, x * a⁻¹ := rfl

attribute [nolint simp_nf] add_left_symm_apply add_right_symm_apply

variable (G)

/-- Inversion on a `group` is a permutation of the underlying type. -/
Expand Down
19 changes: 17 additions & 2 deletions src/data/set/basic.lean
Expand Up @@ -46,7 +46,7 @@ Definitions in the file:
* `range f : set β` : the image of `univ` under `f`.
Also works for `{p : Prop} (f : p → α)` (unlike `image`)
* `prod s t : set (α × β)` : the subset `s × t`.
* `s.prod t : set (α × β)` : the subset `s × t`.
* `inclusion s₁ s₂ : ↥s₁ → ↥s₂` : the map `↥s₁ → ↥s₂` induced by an inclusion `s₁ ⊆ s₂`.
Expand Down Expand Up @@ -1964,7 +1964,14 @@ theorem prod_insert {b : β} : s.prod (insert b t) = ((λa, (a, b)) '' s) ∪ s.
by { ext ⟨x, y⟩, simp [image, iff_def, or_imp_distrib, imp.swap] {contextual := tt} }

theorem prod_preimage_eq {f : γ → α} {g : δ → β} :
(preimage f s).prod (preimage g t) = preimage (λp, (f p.1, g p.2)) (s.prod t) := rfl
(f ⁻¹' s).prod (g ⁻¹' t) = (λ p, (f p.1, g p.2)) ⁻¹' s.prod t := rfl

lemma prod_preimage_left {f : γ → α} : (f ⁻¹' s).prod t = (λp, (f p.1, p.2)) ⁻¹' (s.prod t) := rfl

lemma prod_preimage_right {g : δ → β} : s.prod (g ⁻¹' t) = (λp, (p.1, g p.2)) ⁻¹' (s.prod t) := rfl

lemma mk_preimage_prod (f : γ → α) (g : γ → β) :
(λ x, (f x, g x)) ⁻¹' s.prod t = f ⁻¹' s ∩ g ⁻¹' t := rfl

@[simp] lemma mk_preimage_prod_left {y : β} (h : y ∈ t) : (λ x, (x, y)) ⁻¹' s.prod t = s :=
by { ext x, simp [h] }
Expand All @@ -1988,6 +1995,14 @@ lemma mk_preimage_prod_right_eq_if {x : α} [decidable_pred (∈ s)] :
prod.mk x ⁻¹' s.prod t = if x ∈ s then t else ∅ :=
by { split_ifs; simp [h] }

lemma mk_preimage_prod_left_fn_eq_if {y : β} [decidable_pred (∈ t)] (f : γ → α) :
(λ x, (f x, y)) ⁻¹' s.prod t = if y ∈ t then f ⁻¹' s else ∅ :=
by rw [← mk_preimage_prod_left_eq_if, prod_preimage_left, preimage_preimage]

lemma mk_preimage_prod_right_fn_eq_if {x : α} [decidable_pred (∈ s)] (g : δ → β) :
(λ y, (x, g y)) ⁻¹' s.prod t = if x ∈ s then g ⁻¹' t else ∅ :=
by rw [← mk_preimage_prod_right_eq_if, prod_preimage_right, preimage_preimage]

theorem image_swap_eq_preimage_swap : image (@prod.swap α β) = preimage prod.swap :=
image_eq_preimage_of_inverse prod.swap_left_inverse prod.swap_right_inverse

Expand Down
38 changes: 38 additions & 0 deletions src/topology/algebra/group.lean
Expand Up @@ -176,6 +176,24 @@ protected def homeomorph.inv : G ≃ₜ G :=
lemma nhds_one_symm : comap has_inv.inv (𝓝 (1 : G)) = 𝓝 (1 : G) :=
((homeomorph.inv G).comap_nhds_eq _).trans (congr_arg nhds one_inv)

/-- The map `(x, y) ↦ (x, xy)` as a homeomorphism. This is a shear mapping. -/
@[to_additive "The map `(x, y) ↦ (x, x + y)` as a homeomorphism.
This is a shear mapping."]
protected def homeomorph.shear_mul_right : G × G ≃ₜ G × G :=
{ continuous_to_fun := continuous_fst.prod_mk continuous_mul,
continuous_inv_fun := continuous_fst.prod_mk $ continuous_fst.inv.mul continuous_snd,
.. equiv.prod_shear (equiv.refl _) equiv.mul_left }

@[simp, to_additive]
lemma homeomorph.shear_mul_right_coe :
⇑(homeomorph.shear_mul_right G) = λ z : G × G, (z.1, z.1 * z.2) :=
rfl

@[simp, to_additive]
lemma homeomorph.shear_mul_right_symm_coe :
⇑(homeomorph.shear_mul_right G).symm = λ z : G × G, (z.1, z.1⁻¹ * z.2) :=
rfl

variable {G}

@[to_additive]
Expand Down Expand Up @@ -544,8 +562,28 @@ begin
rwa [mem_preimage, inv_mul_cancel_right] }
end


/-- Every locally compact separable topological group is σ-compact.
Note: this is not true if we drop the topological group hypothesis. -/
@[priority 100] instance separable_locally_compact_group.sigma_compact_space
[separable_space G] [locally_compact_space G] : sigma_compact_space G :=
begin
obtain ⟨L, h1L, h2L, h3L⟩ := exists_compact_subset is_open_univ (mem_univ (1 : G)),
refine ⟨⟨λ n, (λ x, x * dense_seq G n) ⁻¹' L, _, _⟩⟩,
{ intro n, exact (homeomorph.mul_right _).compact_preimage.mpr h1L },
{ rw [eq_univ_iff_forall],
intro x,
obtain ⟨_, hn, ⟨n, rfl⟩⟩ : ((λ y, x * y) ⁻¹' L ∩ range (dense_seq G)).nonempty :=
(dense_iff_inter_open.mp (dense_range_dense_seq G) _
((homeomorph.mul_left _).continuous.is_open_preimage _ is_open_interior)
⟨x⁻¹, by simp [homeomorph.mul_left, h2L]⟩).mono
(inter_subset_inter_left _ $ preimage_mono $ interior_subset),
exact mem_Union.mpr ⟨n, hn⟩ }
end

end


section
variables [topological_space G] [comm_group G] [topological_group G]

Expand Down
7 changes: 3 additions & 4 deletions src/topology/instances/ennreal.lean
Expand Up @@ -389,9 +389,6 @@ begin
exact (finset.sum_le_sum $ assume a ha, hf a h) }
end

section priority
-- for some reason the next proof fails without changing the priority of this instance
local attribute [instance, priority 1000] classical.prop_decidable
lemma mul_Sup {s : set ennreal} {a : ennreal} : a * Sup s = ⨆i∈s, a * i :=
begin
by_cases hs : ∀x∈s, x = (0:ennreal),
Expand All @@ -411,7 +408,6 @@ begin
(ennreal.tendsto.const_mul (tendsto_id' inf_le_left) (or.inl s₁))),
rw [this.symm, Sup_image] }
end
end priority

lemma mul_supr {ι : Sort*} {f : ι → ennreal} {a : ennreal} : a * supr f = ⨆i, a * f i :=
by rw [← Sup_range, mul_Sup, supr_range]
Expand Down Expand Up @@ -441,6 +437,9 @@ have Inf ((λb, ↑r - b) '' range b) = ↑r - (⨆i, b i),
(tendsto.comp ennreal.tendsto_coe_sub (tendsto_id' inf_le_left)),
by rw [eq, ←this]; simp [Inf_image, infi_range, -mem_range]; exact le_refl _

lemma supr_eq_zero {ι : Sort*} {f : ι → ennreal} : (⨆ i, f i) = 0 ↔ ∀ i, f i = 0 :=
by simp_rw [← nonpos_iff_eq_zero, supr_le_iff]

end topological_space

section tsum
Expand Down
50 changes: 45 additions & 5 deletions src/topology/subset_properties.lean
Expand Up @@ -9,12 +9,32 @@ import data.finset.order
/-!
# Properties of subsets of topological spaces
In this file we define various properties of subsets of a topological space, and some classes on
topological spaces.
## Main definitions
`compact`, `is_clopen`, `is_irreducible`, `is_connected`, `is_totally_disconnected`,
`is_totally_separated`
We define the following properties for sets in a topological space:
* `is_compact`: each open cover has a finite subcover. This is defined in mathlib using filters.
The main property of a compact set is `is_compact.elim_finite_subcover`.
* `is_clopen`: a set that is both open and closed.
* `is_irreducible`: a nonempty set that has contains no non-trivial pair of disjoint opens.
See also the section below in the module doc.
* `is_connected`: a nonempty set that has no non-trivial open partition.
See also the section below in the module doc.
`connected_component` is the connected component of an element in the space.
* `is_totally_disconnected`: all of its connected components are singletons.
* `is_totally_separated`: any two points can be separated by two disjoint opens that cover the set.
TODO: write better docs
For each of these definitions (except for `is_clopen`), we also have a class stating that the whole
space satisfies that property:
`compact_space`, `irreducible_space`, `connected_space`, `totally_disconnected_space`, `totally_separated_space`.
Furthermore, we have two more classes:
* `locally_compact_space`: for every point `x`, every open neighborhood of `x` contains a compact
neighborhood of `x`. The definition is formulated in terms of the neighborhood filter.
* `sigma_compact_space`: a space that is the union of a countably many compact subspaces.
## On the definition of irreducible and connected sets/spaces
Expand Down Expand Up @@ -66,8 +86,8 @@ begin
exact h₂ (h₁ hs)
end

/-- If `p : set α → Prop` is stable under restriction and union, and each point `x of a compact set `s`
has a neighborhood `t` within `s` such that `p t`, then `p s` holds. -/
/-- If `p : set α → Prop` is stable under restriction and union, and each point `x`
of a compact set `s` has a neighborhood `t` within `s` such that `p t`, then `p s` holds. -/
@[elab_as_eliminator]
lemma is_compact.induction_on {s : set α} (hs : is_compact s) {p : set α → Prop} (he : p ∅)
(hmono : ∀ ⦃s t⦄, s ⊆ t → p t → p s) (hunion : ∀ ⦃s t⦄, p s → p t → p (s ∪ t))
Expand Down Expand Up @@ -618,6 +638,26 @@ begin
exact le_nhds_Lim ⟨x,h⟩,
end

variables (α)
/-- A σ-compact space is a space that is the union of a countable collection of compact subspaces.
Note that a locally compact separable T₂ space need not be σ-compact.
The sequence can be extracted using `topological_space.compact_covering`. -/
class sigma_compact_space (α : Type*) [topological_space α] : Prop :=
(exists_compact_covering : ∃ K : ℕ → set α, (∀ n, is_compact (K n)) ∧ (⋃ n, K n) = univ)

variables [sigma_compact_space α]
open sigma_compact_space

/-- An arbitrary compact covering of a σ-compact space. -/
def compact_covering : ℕ → set α :=
classical.some exists_compact_covering

lemma is_compact_compact_covering (n : ℕ) : is_compact (compact_covering α n) :=
(classical.some_spec sigma_compact_space.exists_compact_covering).1 n

lemma Union_compact_covering : (⋃ n, compact_covering α n) = univ :=
(classical.some_spec sigma_compact_space.exists_compact_covering).2

end compact

section clopen
Expand Down

0 comments on commit cc6f039

Please sign in to comment.