From f8fa3a39a30d13fe30ae26e33223f39e3fc4f087 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Wed, 12 Feb 2025 18:20:39 +0100 Subject: [PATCH 001/129] started compactsystems --- .../Topology/Compactness/CompactSystem.lean | 373 ++++++++++++++++++ 1 file changed, 373 insertions(+) create mode 100644 Mathlib/Topology/Compactness/CompactSystem.lean diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean new file mode 100644 index 00000000000000..e18327e6ecdcb0 --- /dev/null +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -0,0 +1,373 @@ +/- +Copyright (c) 2023 Rémy Degenne. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Rémy Degenne, Peter Pfaffelhuber +-/ +import Mathlib.Topology.Compactness.Compact + +open Set + +section definition + +variable {α : Type*} {p : Set α → Prop} {C : ℕ → Set α} + +/-- A set of sets is a compact system if, whenever a countable subfamily has empty intersection, +then finitely many of them already have empty intersection. -/ +def IsCompactSystem (p : Set α → Prop) : Prop := + ∀ C : ℕ → Set α, (∀ i, p (C i)) → ⋂ i, C i = ∅ → ∃ (n : ℕ), ⋂ i ≤ n, C i = ∅ + +/-- In a compact system, given a countable family with empty intersection, we choose a finite +subfamily with empty intersection-/ +noncomputable +def IsCompactSystem.max_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) + (hC_empty : ⋂ i, C i = ∅) : ℕ := + (hp C hC hC_empty).choose + +lemma IsCompactSystem.iInter_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) + (hC_empty : ⋂ i, C i = ∅) : + ⋂ i ≤ hp.max_of_empty hC hC_empty, C i = ∅ := + (hp C hC hC_empty).choose_spec + + + + +example (i n : ℕ) : i ∈ Finset.range (n + 1) ↔ i ≤ n := by exact Finset.mem_range_succ_iff + +example (n : ℕ) : { i // i < n+1} = {i // i ≤ n} := by + simp_rw [Nat.lt_add_one_iff] + +example (i n : ℕ) : i < n+1 ↔ i ≤ n := by exact Nat.lt_add_one_iff + +example (C : ℕ → Set α) (n : ℕ) : ⋂ i < n+1, C i = ⋂ i ≤ n, C i := + by simp_rw [Nat.lt_add_one_iff] + +example (n : ℕ) : (Finset.range (n + 1)).Nonempty := by exact Finset.nonempty_range_succ + +example (C : ℕ → Set α) (s : Finset ℕ) (hs : s = ∅): ⋂ i ∈ s, C i = ∅ := by apply? + +lemma iInter_empty_iff (C : ℕ → Set α) : (∃ n : ℕ, ⋂ i ≤ n, C i = ∅) ↔ + (∃ (s : Finset ℕ) (hs : s.Nonempty), ⋂ i ∈ s, C i = ∅) := by + refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ + · obtain ⟨n, hn⟩ := h + use (Finset.range (n + 1)), Finset.nonempty_range_succ + simp_rw [Finset.mem_range_succ_iff] + exact hn + · obtain ⟨s, hs1, hs⟩ := h + use (s.max' hs1) + + + sorry + + simp_rw [← Finset.mem_range_succ_iff] + + sorry + + sorry + + +theorem IsCompactSystem.iff_le : (IsCompactSystem p) ↔ ∀ C : ℕ → Set α, (∀ i, p (C i)) ↔ + ⋂ i, C i = ∅ → ∃ (s : Finset ℕ), ⋂ i ∈ s, C i = ∅ := by + sorry + + +theorem IsCompactSystem.iff_mono : (IsCompactSystem p) ↔ ∀ (C : ℕ → Set α) (h : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → ⋂ i, C i = ∅ → + ∃ (s : Finset ℕ), ⋂ i ∈ s, C i = ∅ := by + rw [IsCompactSystem.iff_le] + refine ⟨fun h ↦ fun C _ i ↦ h C i, fun h C ↦ ?_⟩ + let D := fun n ↦ ⋂ i ≤ n, C i + have h' := h C + have h1 : ∀ n, ⋂ i ≤ n, D i = ⋂ i ≤ n, C i := by sorry -- exact fun n ↦ Eq.symm biInter_le_eq_iInter + have h1' : ⋂ i, D i = ⋂ i, C i := by exact biInter_le_eq_iInter + have h2 : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) D := by + refine directed_of_isDirected_le ?_ + intro i j hij + simp [D] + sorry + have h3 : ∀ (i : ℕ), p (D i) := by sorry + intro i hi + obtain h5 := h D h2 h3 (h1' ▸ hi) + rcases h5 with ⟨s, hs⟩ + use Finset.range (s.max' ?_) + + sorry + + + + refine ⟨h D h2 h3 hi (h1' ▸ hi)⟩ + simp_rw [← h1] + -- have h3 : + sorry + apply fun C i ↦ h C _ i + + · sorry + -- refine ⟨?_, fun h_↦ h ⟩ + + sorry +≤ +end definition + +/-- +section Compact + +variable {α : Type*} [TopologicalSpace α] + +theorem IsCompact.isCompactSystem : IsCompactSystem {s // IsCompact s} := by + simp [IsCompactSystem] + + sorry + + +end Compact + +section ClosedCompactCylinders + +/-! We prove that the `closedCompactCylinders` are a compact system. -/ + +variable {ι : Type*} {α : ι → Type*} [∀ i, TopologicalSpace (α i)] {s : ℕ → Set (Π i, α i)} + +local notation "Js" => closedCompactCylinders.finset +local notation "As" => closedCompactCylinders.set + +section AllProj + +/-- All indices in `ι` that are constrained by the condition `∀ n, s n ∈ closedCompactCylinders α`. +That is, the union of all indices in the bases of the cylinders. -/ +def allProj (hs : ∀ n, s n ∈ closedCompactCylinders α) : Set ι := ⋃ n, Js (hs n) + +theorem subset_allProj (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : + ↑(Js (hs n)) ⊆ allProj hs := + subset_iUnion (fun i ↦ (Js (hs i) : Set ι)) n + +theorem exists_nat_proj (hs : ∀ n, s n ∈ closedCompactCylinders α) (i : ι) (hi : i ∈ allProj hs) : + ∃ n, i ∈ Js (hs n) := by + simpa only [allProj, mem_iUnion, Finset.mem_coe] using hi + +open Classical in +/-- The smallest `n` such that `i ∈ Js (hs n)`. That is, the first `n` such that `i` belongs to the +finset defining the cylinder for `s n`. -/ +noncomputable def indexProj (hs : ∀ n, s n ∈ closedCompactCylinders α) (i : allProj hs) : ℕ := + Nat.find (exists_nat_proj hs i i.2) + +open Classical in +theorem mem_indexProj (hs : ∀ n, s n ∈ closedCompactCylinders α) (i : allProj hs) : + (i : ι) ∈ Js (hs (indexProj hs i)) := + Nat.find_spec (exists_nat_proj hs i i.2) + +open Classical in +theorem indexProj_le (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) (i : Js (hs n)) : + indexProj hs ⟨i, subset_allProj hs n i.2⟩ ≤ n := + Nat.find_le i.2 + +lemma surjective_proj_allProj [∀ i, Nonempty (α i)] (hs : ∀ n, s n ∈ closedCompactCylinders α) : + Function.Surjective (fun (f : (Π i, α i)) (i : allProj hs) ↦ f (i : ι)) := by + intro y + let x := (inferInstance : Nonempty (Π i, α i)).some + classical + refine ⟨fun i ↦ if hi : i ∈ allProj hs then y ⟨i, hi⟩ else x i, ?_⟩ + ext i + simp only [Subtype.coe_prop, dite_true] + +end AllProj + +section projCylinder + +/-- Given a countable family of closed cylinders, consider one of them as depending only on +the countably many coordinates that appear in all of them. -/ +def projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : + Set (∀ i : allProj hs, α i) := + (fun (f : ∀ i : allProj hs, α i) (i : Js (hs n)) ↦ f ⟨i, subset_allProj hs _ i.2⟩) ⁻¹' (As (hs n)) + +lemma mem_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) + (x : ∀ i : allProj hs, α i) : + x ∈ projCylinder hs n ↔ (fun (i : Js (hs n)) ↦ x ⟨i, subset_allProj hs _ i.2⟩) ∈ As (hs n) := by + simp only [projCylinder, mem_preimage] + +theorem preimage_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : + (fun (f : ∀ i, α i) (i : allProj hs) ↦ f i) ⁻¹' (projCylinder hs n) = s n := by + conv_rhs => rw [closedCompactCylinders.eq_cylinder (hs n)] + rfl + +lemma nonempty_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) + (n : ℕ) (hs_nonempty : (s n).Nonempty) : + (projCylinder hs n).Nonempty := by + rw [← preimage_projCylinder hs n] at hs_nonempty + exact nonempty_of_nonempty_preimage hs_nonempty + +lemma nonempty_projCylinder_iff [∀ i, Nonempty (α i)] + (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : + (projCylinder hs n).Nonempty ↔ (s n).Nonempty := by + refine ⟨fun h ↦ ?_, nonempty_projCylinder hs n⟩ + obtain ⟨x, hx⟩ := h + rw [mem_projCylinder] at hx + rw [closedCompactCylinders.eq_cylinder (hs n), MeasureTheory.cylinder] + refine Set.Nonempty.preimage ?_ ?_ + · exact ⟨_, hx⟩ + · intro y + let x := (inferInstance : Nonempty (∀ i, α i)).some + classical + refine ⟨fun i ↦ if hi : i ∈ Js (hs n) then y ⟨i, hi⟩ else x i, ?_⟩ + ext i + simp only [Finset.restrict_def, Finset.coe_mem, dite_true] + +theorem isClosed_projCylinder + (hs : ∀ n, s n ∈ closedCompactCylinders α) (hs_closed : ∀ n, IsClosed (As (hs n))) (n : ℕ) : + IsClosed (projCylinder hs n) := + (hs_closed n).preimage (by exact continuous_pi (fun i ↦ continuous_apply _)) + +end projCylinder + +section piCylinderSet + +open Classical in +/-- Given countably many closed compact cylinders, the product set which, in each relevant +coordinate, is the projection of the first cylinder for which this coordinate is relevant. -/ +def piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : + Set (∀ i : allProj hs, α i) := + {x : ∀ i : allProj hs, α i | + ∀ i, x i ∈ (fun a : ∀ j : Js (hs (indexProj hs i)), α j ↦ a ⟨i, mem_indexProj hs i⟩) '' + (As (hs (indexProj hs i)))} + +lemma mem_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) + (x : ∀ i : allProj hs, α i) : + x ∈ piCylinderSet hs ↔ + ∀ i, x i ∈ (fun a : ∀ j : Js (hs (indexProj hs i)), α j ↦ a ⟨i, mem_indexProj hs i⟩) '' + (As (hs (indexProj hs i))) := by + simp only [piCylinderSet, mem_image, Subtype.forall, mem_setOf_eq] + +theorem isCompact_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : + IsCompact (piCylinderSet hs) := + isCompact_pi_infinite fun _ ↦ + (closedCompactCylinders.isCompact (hs _)).image (continuous_apply _) + +theorem piCylinderSet_eq_pi_univ (hs : ∀ n, s n ∈ closedCompactCylinders α) : + piCylinderSet hs = + pi univ fun i ↦ + (fun a : ∀ j : Js (hs (indexProj hs i)), α j ↦ a ⟨i, mem_indexProj hs i⟩) '' + (As (hs (indexProj hs i))) := by + ext; simp only [piCylinderSet, mem_univ_pi]; rfl + +theorem isClosed_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : + IsClosed (piCylinderSet hs) := by + rw [piCylinderSet_eq_pi_univ] + exact isClosed_set_pi fun i _ ↦ IsClosed.isClosed_image_restrict_singleton _ + (closedCompactCylinders.isCompact (hs _)) (closedCompactCylinders.isClosed (hs _)) + +theorem nonempty_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) + (hs_nonempty : ∀ i, (s i).Nonempty) : + (piCylinderSet hs).Nonempty := by + have hs_nonempty' i : (As (hs i)).Nonempty := by + specialize hs_nonempty i + rw [closedCompactCylinders.eq_cylinder (hs i)] at hs_nonempty + exact nonempty_of_nonempty_preimage hs_nonempty + let b i := (hs_nonempty' (indexProj hs i)).some + have hb_mem i : b i ∈ As (hs (indexProj hs i)) := (hs_nonempty' (indexProj hs i)).choose_spec + let a : ∀ i : allProj hs, α i := fun i ↦ b i ⟨i, mem_indexProj hs i⟩ + refine ⟨a, ?_⟩ + simp only [piCylinderSet, mem_image, SetCoe.forall, mem_setOf_eq] + exact fun j hj ↦ ⟨b ⟨j, hj⟩, hb_mem _, rfl⟩ + +end piCylinderSet + +theorem iInter_subset_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : + (⋂ n, projCylinder hs n) ⊆ piCylinderSet hs := by + intro x hx + rw [mem_iInter] at hx + rw [mem_piCylinderSet] + intro i + specialize hx (indexProj hs i) + rw [mem_projCylinder] at hx + exact ⟨fun i : Js (hs (indexProj hs i)) ↦ x ⟨i, subset_allProj hs _ i.2⟩, hx, rfl⟩ + +theorem nonempty_iInter_projCylinder_inter_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) + (hs_nonempty : ∀ i, (s i).Nonempty) + (h_nonempty : ∀ n, (⋂ i ≤ n, projCylinder hs i).Nonempty) (n : ℕ) : + ((⋂ i ≤ n, projCylinder hs i) ∩ piCylinderSet hs).Nonempty := by + obtain ⟨x, hx⟩ := nonempty_piCylinderSet hs hs_nonempty + obtain ⟨y, hy⟩ := h_nonempty n + let z := fun i : allProj hs ↦ if indexProj hs i ≤ n then y i else x i + refine ⟨z, mem_inter ?_ ?_⟩ + · simp only [mem_iInter, mem_projCylinder] + intro i hi + have : (fun j : Js (hs i) ↦ + ite (indexProj hs ⟨j, subset_allProj hs i j.2⟩ ≤ n) (y ⟨j, subset_allProj hs i j.2⟩) + (x ⟨j, subset_allProj hs i j.2⟩)) = + fun j : Js (hs i) ↦ y ⟨j, subset_allProj hs i j.2⟩ := by + ext j + rw [if_pos] + refine le_trans (le_of_eq ?_) ((indexProj_le hs i j).trans hi) + congr + rw [this] + have hyi : y ∈ projCylinder hs i := by + suffices ⋂ j ≤ n, projCylinder hs j ⊆ projCylinder hs i by exact this hy + exact biInter_subset_of_mem hi + rwa [mem_projCylinder] at hyi + · rw [mem_piCylinderSet] + intro i + by_cases hi_le : indexProj hs i ≤ n + · let m := indexProj hs i + have hy' : y ∈ projCylinder hs m := by + suffices ⋂ j ≤ n, projCylinder hs j ⊆ projCylinder hs m by exact this hy + exact biInter_subset_of_mem hi_le + rw [mem_projCylinder] at hy' + refine ⟨fun j ↦ y ⟨j, subset_allProj hs _ j.2⟩, hy', ?_⟩ + simp_rw [z, if_pos hi_le] + · rw [mem_piCylinderSet] at hx + specialize hx i + obtain ⟨x', hx'_mem, hx'_eq⟩ := hx + refine ⟨x', hx'_mem, ?_⟩ + simp_rw [z, if_neg hi_le] + exact hx'_eq + +theorem nonempty_iInter_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) + (hs_nonempty : ∀ i, (s i).Nonempty) + (h_nonempty : ∀ n, (⋂ i ≤ n, projCylinder hs i).Nonempty) : + (⋂ i, projCylinder hs i).Nonempty := by + suffices ((⋂ i, projCylinder hs i) ∩ piCylinderSet hs).Nonempty by + rwa [inter_eq_left.mpr (iInter_subset_piCylinderSet hs)] at this + have : (⋂ n, projCylinder hs n) = (⋂ n, ⋂ i ≤ n, projCylinder hs i) := by + ext x + simp only [mem_iInter] + exact ⟨fun h i j _ ↦ h j, fun h i ↦ h i i le_rfl⟩ + rw [this, iInter_inter] + have h_closed : ∀ n, IsClosed (⋂ i ≤ n, projCylinder hs i) := + fun n ↦ isClosed_biInter (fun i _ ↦ isClosed_projCylinder hs + (fun n ↦ (closedCompactCylinders.isClosed (hs n))) i) + refine IsCompact.nonempty_iInter_of_sequence_nonempty_isCompact_isClosed + (fun n ↦ (⋂ i ≤ n, projCylinder hs i) ∩ piCylinderSet hs) ?_ ?_ ?_ ?_ + · refine fun i ↦ inter_subset_inter ?_ subset_rfl + simp_rw [Set.biInter_le_succ] + exact inter_subset_left + · exact fun n ↦ nonempty_iInter_projCylinder_inter_piCylinderSet hs hs_nonempty h_nonempty n + · exact (isCompact_piCylinderSet hs).inter_left (h_closed _) + · exact fun n ↦ IsClosed.inter (h_closed n) (isClosed_piCylinderSet hs) + +lemma exists_finset_iInter_projCylinder_eq_empty [∀ i, Nonempty (α i)] + (hs : ∀ n, s n ∈ closedCompactCylinders α) (h : ⋂ n, projCylinder hs n = ∅) : + ∃ t : Finset ℕ, (⋂ i ∈ t, projCylinder hs i) = ∅ := by + by_contra! h_nonempty + refine absurd h (Set.Nonempty.ne_empty ?_) + refine nonempty_iInter_projCylinder hs (fun i ↦ ?_) (fun n ↦ ?_) + · specialize h_nonempty {i} + simp only [Finset.mem_singleton, iInter_iInter_eq_left, ne_eq] at h_nonempty + rwa [nonempty_projCylinder_iff] at h_nonempty + · specialize h_nonempty (Finset.range (n + 1)) + simp only [Finset.mem_range, ne_eq, Nat.lt_succ_iff] at h_nonempty + exact h_nonempty + +/-- The `closedCompactCylinders` are a compact system. -/ +theorem isCompactSystem_closedCompactCylinders : IsCompactSystem (closedCompactCylinders α) := by + intro s hs h + by_cases hα : ∀ i, Nonempty (α i) + swap; · exact ⟨∅, by simpa [not_nonempty_iff] using hα⟩ + have h' : ⋂ n, projCylinder hs n = ∅ := by + simp_rw [← preimage_projCylinder hs, ← preimage_iInter] at h + have h_surj : Function.Surjective (fun (f : (∀ i, α i)) (i : allProj hs) ↦ f (i : ι)) := + surjective_proj_allProj hs + rwa [← not_nonempty_iff_eq_empty, ← Function.Surjective.nonempty_preimage h_surj, + not_nonempty_iff_eq_empty] + obtain ⟨t, ht⟩ := exists_finset_iInter_projCylinder_eq_empty hs h' + refine ⟨t, ?_⟩ + simp_rw [← preimage_projCylinder hs, ← preimage_iInter₂, ht, preimage_empty] + +end ClosedCompactCylinders +-/ From 82db797ac52c2e5bd1b108991cca8568818f38cf Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Thu, 13 Feb 2025 00:37:12 +0100 Subject: [PATCH 002/129] not there for compact --- .../Topology/Compactness/CompactSystem.lean | 178 ++++++++++++------ 1 file changed, 122 insertions(+), 56 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index e18327e6ecdcb0..201d039aacf6f7 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -4,8 +4,9 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ import Mathlib.Topology.Compactness.Compact +import Mathlib.MeasureTheory.PiSystem -open Set +open Set Finset Nat section definition @@ -29,7 +30,15 @@ lemma IsCompactSystem.iInter_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C (hp C hC hC_empty).choose_spec +example (i n : ℕ) : i < n+1 ↔ i ≤ n := by exact Nat.lt_add_one_iff + +lemma l1 (s : Finset ℕ) (hs : s.Nonempty) : s ⊆ Finset.range (s.max' hs + 1) := by + intro i hi + rw [Finset.mem_range, Nat.lt_add_one_iff] + exact s.le_max' i hi +example (s : Finset ℕ) (hs : s.Nonempty) (i : ℕ) (hi : i ∈ s) : i ≤ s.max' hs := by + exact Finset.le_max' s i hi example (i n : ℕ) : i ∈ Finset.range (n + 1) ↔ i ≤ n := by exact Finset.mem_range_succ_iff @@ -45,65 +54,122 @@ example (n : ℕ) : (Finset.range (n + 1)).Nonempty := by exact Finset.nonempty_ example (C : ℕ → Set α) (s : Finset ℕ) (hs : s = ∅): ⋂ i ∈ s, C i = ∅ := by apply? -lemma iInter_empty_iff (C : ℕ → Set α) : (∃ n : ℕ, ⋂ i ≤ n, C i = ∅) ↔ - (∃ (s : Finset ℕ) (hs : s.Nonempty), ⋂ i ∈ s, C i = ∅) := by - refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ - · obtain ⟨n, hn⟩ := h - use (Finset.range (n + 1)), Finset.nonempty_range_succ +@[simp] +lemma iInter_empty_iff [Inhabited α] {C : ℕ → Set α} : (∃ n : ℕ, ⋂ i ≤ n, C i = ∅) ↔ + (∃ (s : Finset ℕ), ⋂ i ∈ s, C i = ∅) := by + refine ⟨fun ⟨n, hn⟩ ↦ ?_, fun ⟨s, hs⟩ ↦ ?_⟩ + · use (Finset.range (n + 1)) simp_rw [Finset.mem_range_succ_iff] exact hn - · obtain ⟨s, hs1, hs⟩ := h - use (s.max' hs1) - - - sorry - - simp_rw [← Finset.mem_range_succ_iff] - - sorry - - sorry - - -theorem IsCompactSystem.iff_le : (IsCompactSystem p) ↔ ∀ C : ℕ → Set α, (∀ i, p (C i)) ↔ - ⋂ i, C i = ∅ → ∃ (s : Finset ℕ), ⋂ i ∈ s, C i = ∅ := by - sorry - - -theorem IsCompactSystem.iff_mono : (IsCompactSystem p) ↔ ∀ (C : ℕ → Set α) (h : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → ⋂ i, C i = ∅ → - ∃ (s : Finset ℕ), ⋂ i ∈ s, C i = ∅ := by - rw [IsCompactSystem.iff_le] - refine ⟨fun h ↦ fun C _ i ↦ h C i, fun h C ↦ ?_⟩ - let D := fun n ↦ ⋂ i ≤ n, C i - have h' := h C - have h1 : ∀ n, ⋂ i ≤ n, D i = ⋂ i ≤ n, C i := by sorry -- exact fun n ↦ Eq.symm biInter_le_eq_iInter - have h1' : ⋂ i, D i = ⋂ i, C i := by exact biInter_le_eq_iInter - have h2 : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) D := by - refine directed_of_isDirected_le ?_ - intro i j hij - simp [D] - sorry - have h3 : ∀ (i : ℕ), p (D i) := by sorry + · have h2 : s.Nonempty := by + rw [s.nonempty_iff_ne_empty] + intro h + rw [h] at hs + simp only [Finset.not_mem_empty, iInter_of_empty, iInter_univ, Set.univ_eq_empty_iff, + not_isEmpty_of_nonempty] at hs + use (s.max' h2) + have h : ⋂ i, ⋂ (_ : i ≤ s.max' h2), C i ⊆ ⋂ i ∈ s, C i := by + simp_rw [← Finset.mem_range_succ_iff] + exact biInter_mono (l1 s h2) (fun _ _ ⦃a_1⦄ a ↦ a) + exact subset_empty_iff.mp <| le_trans h hs.le + +theorem IsCompactSystem.iff_le [Inhabited α] : (IsCompactSystem p) ↔ + (∀ C : ℕ → Set α, (∀ i, p (C i)) → ⋂ i, C i = ∅ → ∃ (s : Finset ℕ), ⋂ i ∈ s, C i = ∅) := by + refine ⟨fun h C hp he ↦ ?_, fun h C hp he ↦ ?_ ⟩ + · apply iInter_empty_iff.mp <| h C hp he + · apply iInter_empty_iff.mpr <| h C hp he + + + + +theorem biInter_decumulate (s : ℕ → Set α) (n : ℕ): + ⋂ x ≤ n, ⋂ y ≤ x, s y = ⋂ y ≤ n, s y := by + apply Set.Subset.antisymm + · apply iInter_mono + intro z x hx + simp at hx + simp only [mem_iInter] + exact fun h ↦ hx h z <| Nat.le_refl z + · simp only [subset_iInter_iff] + intro i hi x hx + refine biInter_subset_of_mem ?_ + simp only [le_eq] + exact le_trans hx hi + +theorem decumulate_succ (s : ℕ → Set α) (n : ℕ) : + ⋂ i ≤ n + 1, s i = (⋂ i ≤ n, s i) ∩ s (n + 1) := by + ext x + refine ⟨fun hx ↦ ?_, fun hx ↦ ?_⟩ + · simp only [mem_inter_iff, mem_iInter] at * + exact ⟨fun i hi ↦ hx i <| le_trans hi <| le_add_right n 1, hx (n + 1) <| Nat.le_refl (n + 1)⟩ + · simp only [mem_inter_iff, mem_iInter] at * intro i hi - obtain h5 := h D h2 h3 (h1' ▸ hi) - rcases h5 with ⟨s, hs⟩ - use Finset.range (s.max' ?_) - - sorry - - - - refine ⟨h D h2 h3 hi (h1' ▸ hi)⟩ - simp_rw [← h1] - -- have h3 : - sorry - apply fun C i ↦ h C _ i - - · sorry - -- refine ⟨?_, fun h_↦ h ⟩ + by_cases h : i ≤ n + · exact hx.1 i h + · simp only [not_le] at h + exact Nat.le_antisymm hi h ▸ hx.2 + +theorem iInter_decumulate (s : ℕ → Set α) (n : ℕ): ⋂ x, ⋂ y ≤ x, s y = ⋂ y, s y := by + apply Set.Subset.antisymm + · apply iInter_mono + intro z x hx + simp at hx + apply hx z <| Nat.le_refl z + · simp only [subset_iInter_iff] + intro i x hx + exact iInter_subset_of_subset x fun ⦃a⦄ a ↦ a + +def IsPiSystem' (C : Set (Set α)) := ∀ s ∈ C, ∀ t ∈ C, s ∩ t ∈ C + +lemma prime (C : Set (Set α)) (hC : ∅ ∈ C) : (IsPiSystem C) ↔ (IsPiSystem' C) := by + refine ⟨fun h s hs t ht ↦ ?_, fun h s hs t ht _ ↦ h s hs t ht⟩ + by_cases h' : (s ∩ t).Nonempty + · exact h s hs t ht h' + · push_neg at h' + exact h' ▸ hC + +example (C D : ℕ → Set α) (n : ℕ) (hCD : C = D) : ⋂ i ≤ n, C i = ⋂ i ≤ n, D i := by + exact iInter₂_congr fun i j ↦ congrFun hCD i + +lemma l2 (C : Set (Set α)) (hC : IsPiSystem' C) (s : ℕ → Set α) (hs : ∀ n, s n ∈ C) (n : ℕ) : + ⋂ i ≤ n, s i ∈ C := by + induction n with + | zero => + simp only [le_zero_eq, iInter_iInter_eq_left] + exact hs 0 + | succ n hn => + rw [decumulate_succ s n] + exact hC (⋂ i, ⋂ (_ : i ≤ n), s i) hn (s (n + 1)) (hs (n + 1)) + +theorem IsCompactSystem.iff_mono [Inhabited α] (hpi : IsPiSystem' p) : (IsCompactSystem p) ↔ + (∀ (C : ℕ → Set α) (h : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → + ⋂ i, C i = ∅ → ∃ (s : Finset ℕ), ⋂ i ∈ s, C i = ∅) := by + rw [IsCompactSystem.iff_le] + refine ⟨fun h ↦ fun C _ i ↦ h C i, fun h C ↦ ?_⟩ + let D := fun n ↦ ⋂ i ≤ n, C i + have h' := h C + have h1 (n : ℕ) : ⋂ i ≤ n, D i = ⋂ i ≤ n, C i := biInter_decumulate C n + have h1' : ⋂ i, D i = ⋂ i, C i := by exact biInter_le_eq_iInter + have h2 : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) D := by + refine directed_of_isDirected_le ?_ + intro i j hij + simp [D] + intro k hk + refine biInter_subset_of_mem ?_ + exact le_trans hk hij + intro hi hi' + have h3 (i : ℕ) : p (D i) := by + simp [D, hpi] + obtain h4 := l2 {s : Set α | p s} hpi C + obtain h5 := h4 hi i + exact h5 + obtain h5 := h D h2 h3 (h1' ▸ hi') + obtain h6 := h D h2 + rw [← iInter_empty_iff] at * + rcases h5 with ⟨n, hn⟩ + use n + rwa [← h1 n] - sorry -≤ end definition /-- From 2d4e46605fad38575af5250a2e8656230412273b Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 14 Feb 2025 00:35:53 +0100 Subject: [PATCH 003/129] not done yet --- .../Topology/Compactness/CompactSystem.lean | 49 +++++++++++++++++-- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 201d039aacf6f7..61be3ce9729976 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -29,6 +29,21 @@ lemma IsCompactSystem.iInter_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C ⋂ i ≤ hp.max_of_empty hC hC_empty, C i = ∅ := (hp C hC hC_empty).choose_spec +def IsCompactSystem' (p : Set α → Prop) : Prop := + ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ (n : ℕ), (⋂ i ≤ n, C i).Nonempty) → (⋂ i, C i).Nonempty + +theorem IsCompactSystem_iff_IsCompactSystem' (p : Set α → Prop) : + IsCompactSystem p ↔ IsCompactSystem' p := by + refine ⟨fun h C hC hn ↦ ?_, fun h C hC ↦ ?_⟩ + · have h2 := h C hC + rw [← not_imp_not] at h2 + push_neg at h2 + simp_rw [Set.nonempty_iff_ne_empty] at * + exact h2 hn + · have h2 := h C hC + rw [← not_imp_not] at h2 + push_neg at h2 + exact h2 example (i n : ℕ) : i < n+1 ↔ i ≤ n := by exact Nat.lt_add_one_iff @@ -141,8 +156,11 @@ lemma l2 (C : Set (Set α)) (hC : IsPiSystem' C) (s : ℕ → Set α) (hs : ∀ rw [decumulate_succ s n] exact hC (⋂ i, ⋂ (_ : i ≤ n), s i) hn (s (n + 1)) (hs (n + 1)) +lemma l3 (C : ℕ → Set α) (hC : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C) : + ∃ (s : Finset ℕ), ⋂ i ∈ s, C i = ∅ ↔ ∃ n, C n = ∅ := by sorry + theorem IsCompactSystem.iff_mono [Inhabited α] (hpi : IsPiSystem' p) : (IsCompactSystem p) ↔ - (∀ (C : ℕ → Set α) (h : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → + (∀ (C : ℕ → Set α) (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → ⋂ i, C i = ∅ → ∃ (s : Finset ℕ), ⋂ i ∈ s, C i = ∅) := by rw [IsCompactSystem.iff_le] refine ⟨fun h ↦ fun C _ i ↦ h C i, fun h C ↦ ?_⟩ @@ -170,21 +188,46 @@ theorem IsCompactSystem.iff_mono [Inhabited α] (hpi : IsPiSystem' p) : (IsCompa use n rwa [← h1 n] +lemma l4 : (∀ (n : ℕ), (C n).Nonempty → + (⋂ i, C i).Nonempty) ↔ ((⋂ i, C i) = ∅ → ∃ (n : ℕ), (C n) = ∅) := by + + sorry + +theorem IsCompactSystem.iff_mono' [Inhabited α] (hpi : IsPiSystem' p) : (IsCompactSystem p) ↔ + ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → + ∀ (n : ℕ), (C n).Nonempty → + (⋂ i, C i).Nonempty := by + rw [IsCompactSystem.iff_mono hpi] + refine ⟨fun h1 h2 ↦ ?_, fun h1 h2 h3 h4 h5 ↦ ?_⟩ + · sorry + · sorry + + + end definition -/-- section Compact variable {α : Type*} [TopologicalSpace α] -theorem IsCompact.isCompactSystem : IsCompactSystem {s // IsCompact s} := by +theorem IsCompact.isCompactSystem {α : Type*} [Inhabited α] [TopologicalSpace α] : + IsCompactSystem (⋃ (s : Set α) (_ : IsCompact s), {s}) := by + have h : IsPiSystem' (⋃ (s : Set α) (_ : IsCompact s), {s}) := by sorry + rw [IsCompactSystem.iff_mono' h] + apply IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed + -- IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed + sorry + simp [IsCompactSystem] + intro C hC h_empty sorry + end Compact +/-- section ClosedCompactCylinders /-! We prove that the `closedCompactCylinders` are a compact system. -/ From 8eababbd5cf08eba3700def90f64198938217f57 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 14 Feb 2025 14:32:10 +0100 Subject: [PATCH 004/129] found emptyset --- .../Topology/Compactness/CompactSystem.lean | 51 ++++++++++++++----- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 61be3ce9729976..1d96e1a369f179 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -195,7 +195,7 @@ lemma l4 : (∀ (n : ℕ), (C n).Nonempty → theorem IsCompactSystem.iff_mono' [Inhabited α] (hpi : IsPiSystem' p) : (IsCompactSystem p) ↔ ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → - ∀ (n : ℕ), (C n).Nonempty → + (∀ (n : ℕ), (C n).Nonempty) → (⋂ i, C i).Nonempty := by rw [IsCompactSystem.iff_mono hpi] refine ⟨fun h1 h2 ↦ ?_, fun h1 h2 h3 h4 h5 ↦ ?_⟩ @@ -208,22 +208,49 @@ end definition section Compact -variable {α : Type*} [TopologicalSpace α] +variable {α : Type*} -theorem IsCompact.isCompactSystem {α : Type*} [Inhabited α] [TopologicalSpace α] : - IsCompactSystem (⋃ (s : Set α) (_ : IsCompact s), {s}) := by - have h : IsPiSystem' (⋃ (s : Set α) (_ : IsCompact s), {s}) := by sorry - rw [IsCompactSystem.iff_mono' h] - apply IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed - -- IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed - sorry +@[simp] +lemma l5 (p : α → Prop) (s : α) : p s ↔ (s ∈ ⋃ (i : α) (_ : p i), {i}) := by + rw [Set.mem_iUnion₂] + refine ⟨fun h ↦ ?_, fun h ↦ ?_ ⟩ + · use s, h + simp only [mem_singleton_iff] + · obtain ⟨i, hi, h⟩ := h + simp only [mem_singleton_iff] at h + exact h ▸ hi + +lemma l6 (p q : α → Prop) (s : α) : (p s ∧ q s) ↔ (s ∈ ⋃ (i : α) (_ : p i) (_ : q i), {i}) := by + rw [Set.mem_iUnion₂] + simp_rw [mem_iUnion] + refine ⟨fun h ↦ ?_, fun h ↦ ?_ ⟩ + · use s, h.1, h.2 + simp only [mem_singleton_iff] + · obtain ⟨i, hi, h1, h2⟩ := h + simp only [mem_singleton_iff] at h2 + exact h2 ▸ ⟨hi, h1⟩ + +lemma l7 (p : α → Prop) (s : α) : (s ∈ ⋃ (i : α) (_ : p i), {i}) ↔ (⋃ (i : α) (_ : p i), {i}) s:= by + rfl - simp [IsCompactSystem] - intro C hC h_empty +variable {α : Type*} [TopologicalSpace α] - sorry +example (p : α → Prop) (s : α) : (⋃ (i : α) (_ : p i), {i}) s ↔ p s := by + apply? +theorem IsCompact.isCompactSystem {α : Type*} [Inhabited α] [TopologicalSpace α] : + IsCompactSystem (⋃ (s : Set α) (_ : IsCompact s) (_ : IsClosed s), {s}) := by + have h : IsPiSystem' (⋃ (s : Set α) (_ : IsCompact s) (_ : IsClosed s), {s}) := by + simp_rw [(l6 IsCompact IsClosed)] + sorry + rw [IsCompactSystem.iff_mono' h] + intro C hC h1 hn + have h1' (i : ℕ) : IsCompact (C i) ∧ IsClosed (C i):= by + rw [(l6 IsCompact IsClosed (C i))] + exact h1 i + exact IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed C hC hn + (fun i ↦ (h1' i).1) (fun i ↦ (h1' i).2) end Compact From 1b79bf284ad8fb537f9532a7d7e8cd7de733d648 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sat, 15 Feb 2025 00:31:14 +0100 Subject: [PATCH 005/129] added mono --- .../Topology/Compactness/CompactSystem.lean | 71 ++++++++++++++++--- 1 file changed, 61 insertions(+), 10 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 1d96e1a369f179..303b6e7925ae91 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -88,6 +88,9 @@ lemma iInter_empty_iff [Inhabited α] {C : ℕ → Set α} : (∃ n : ℕ, ⋂ i exact biInter_mono (l1 s h2) (fun _ _ ⦃a_1⦄ a ↦ a) exact subset_empty_iff.mp <| le_trans h hs.le + + + theorem IsCompactSystem.iff_le [Inhabited α] : (IsCompactSystem p) ↔ (∀ C : ℕ → Set α, (∀ i, p (C i)) → ⋂ i, C i = ∅ → ∃ (s : Finset ℕ), ⋂ i ∈ s, C i = ∅) := by refine ⟨fun h C hp he ↦ ?_, fun h C hp he ↦ ?_ ⟩ @@ -161,9 +164,44 @@ lemma l3 (C : ℕ → Set α) (hC : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) theorem IsCompactSystem.iff_mono [Inhabited α] (hpi : IsPiSystem' p) : (IsCompactSystem p) ↔ (∀ (C : ℕ → Set α) (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → - ⋂ i, C i = ∅ → ∃ (s : Finset ℕ), ⋂ i ∈ s, C i = ∅) := by - rw [IsCompactSystem.iff_le] - refine ⟨fun h ↦ fun C _ i ↦ h C i, fun h C ↦ ?_⟩ + ⋂ i, C i = ∅ → ∃ (n : ℕ), C n = ∅) := by + have hs (C : ℕ → Set α) (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C) : (∃ n, C n = ∅) ↔ (∃ n, ⋂ i ≤ n, C i = ∅) := by + refine ⟨fun h ↦ ?_, ?_⟩ + · obtain ⟨n, hn⟩ := h + use n + by_cases hn' : n = 0 + · rw [hn'] + simp only [le_zero_eq, iInter_iInter_eq_left] + exact hn' ▸ hn + · obtain ⟨k, hk⟩ := exists_eq_succ_of_ne_zero hn' + rw [hk, decumulate_succ, ← succ_eq_add_one, ← hk, hn, Set.inter_empty] + · have h3 (n : ℕ) : ∃ m, ⋂ i ≤ n, C i ⊇ C m := by + induction n with + | zero => + use 0 + simp + | succ n hn => + obtain ⟨m, hm⟩ := hn + rw [decumulate_succ] + obtain ⟨k, hk⟩ := hd m (n+1) + simp at hk + use k + simp only [Set.subset_inter_iff] + exact ⟨le_trans hk.1 hm, hk.2⟩ + rw [← not_imp_not] + push_neg + intro h n + obtain h2 := hd n (n + 1) + simp at h2 + obtain ⟨m, hm⟩ := h3 n + exact Set.Nonempty.mono hm (h m) + -- rw [IsCompactSystem.iff_le] + refine ⟨fun h ↦ fun C hdi hi ↦ ?_, fun h C ↦ ?_⟩ + · rw [hs C hdi] + exact h C hi + · + sorry + let D := fun n ↦ ⋂ i ≤ n, C i have h' := h C have h1 (n : ℕ) : ⋂ i ≤ n, D i = ⋂ i ≤ n, C i := biInter_decumulate C n @@ -190,16 +228,23 @@ theorem IsCompactSystem.iff_mono [Inhabited α] (hpi : IsPiSystem' p) : (IsCompa lemma l4 : (∀ (n : ℕ), (C n).Nonempty → (⋂ i, C i).Nonempty) ↔ ((⋂ i, C i) = ∅ → ∃ (n : ℕ), (C n) = ∅) := by - sorry +example (P Q : Prop) : (P → Q) ↔ (¬ Q → ¬ P) := by exact Iff.symm not_imp_not + + theorem IsCompactSystem.iff_mono' [Inhabited α] (hpi : IsPiSystem' p) : (IsCompactSystem p) ↔ ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → (∀ (n : ℕ), (C n).Nonempty) → (⋂ i, C i).Nonempty := by - rw [IsCompactSystem.iff_mono hpi] - refine ⟨fun h1 h2 ↦ ?_, fun h1 h2 h3 h4 h5 ↦ ?_⟩ - · sorry + -- rw [IsCompactSystem.iff_mono hpi] + refine ⟨fun h1 C h3 h4 ↦ ?_, fun h1 h2 h3 h4 ↦ ?_⟩ + · rw [← not_imp_not] + push_neg + + refine h1 C h4 + simp only [nonempty_iInter, not_exists, not_forall] + sorry · sorry @@ -238,12 +283,16 @@ variable {α : Type*} [TopologicalSpace α] example (p : α → Prop) (s : α) : (⋃ (i : α) (_ : p i), {i}) s ↔ p s := by apply? +example (x y : Set α) (hx : IsClosed x) (hy : IsClosed y) : IsClosed (x ∩ y) := by + exact IsClosed.inter hx hy + + theorem IsCompact.isCompactSystem {α : Type*} [Inhabited α] [TopologicalSpace α] : IsCompactSystem (⋃ (s : Set α) (_ : IsCompact s) (_ : IsClosed s), {s}) := by have h : IsPiSystem' (⋃ (s : Set α) (_ : IsCompact s) (_ : IsClosed s), {s}) := by - - simp_rw [(l6 IsCompact IsClosed)] - sorry + intro x hx y hy + rw [← (l6 IsCompact IsClosed)] at * + exact ⟨IsCompact.inter_left hy.1 hx.2, IsClosed.inter hx.2 hy.2 ⟩ rw [IsCompactSystem.iff_mono' h] intro C hC h1 hn have h1' (i : ℕ) : IsCompact (C i) ∧ IsClosed (C i):= by @@ -252,6 +301,8 @@ theorem IsCompact.isCompactSystem {α : Type*} [Inhabited α] [TopologicalSpace exact IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed C hC hn (fun i ↦ (h1' i).1) (fun i ↦ (h1' i).2) + + end Compact /-- From f0774fc40a0f7645b1167a2c3f7dc2366d0595b1 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sat, 15 Feb 2025 01:18:20 +0100 Subject: [PATCH 006/129] compiles --- .../Topology/Compactness/CompactSystem.lean | 141 ++++++++---------- 1 file changed, 62 insertions(+), 79 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 303b6e7925ae91..2b6251c95d39de 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -67,8 +67,6 @@ example (C : ℕ → Set α) (n : ℕ) : ⋂ i < n+1, C i = ⋂ i ≤ n, C i := example (n : ℕ) : (Finset.range (n + 1)).Nonempty := by exact Finset.nonempty_range_succ -example (C : ℕ → Set α) (s : Finset ℕ) (hs : s = ∅): ⋂ i ∈ s, C i = ∅ := by apply? - @[simp] lemma iInter_empty_iff [Inhabited α] {C : ℕ → Set α} : (∃ n : ℕ, ⋂ i ≤ n, C i = ∅) ↔ (∃ (s : Finset ℕ), ⋂ i ∈ s, C i = ∅) := by @@ -127,7 +125,7 @@ theorem decumulate_succ (s : ℕ → Set α) (n : ℕ) : · simp only [not_le] at h exact Nat.le_antisymm hi h ▸ hx.2 -theorem iInter_decumulate (s : ℕ → Set α) (n : ℕ): ⋂ x, ⋂ y ≤ x, s y = ⋂ y, s y := by +theorem iInter_decumulate (s : ℕ → Set α) : ⋂ x, ⋂ y ≤ x, s y = ⋂ y, s y := by apply Set.Subset.antisymm · apply iInter_mono intro z x hx @@ -159,76 +157,64 @@ lemma l2 (C : Set (Set α)) (hC : IsPiSystem' C) (s : ℕ → Set α) (hs : ∀ rw [decumulate_succ s n] exact hC (⋂ i, ⋂ (_ : i ≤ n), s i) hn (s (n + 1)) (hs (n + 1)) -lemma l3 (C : ℕ → Set α) (hC : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C) : - ∃ (s : Finset ℕ), ⋂ i ∈ s, C i = ∅ ↔ ∃ n, C n = ∅ := by sorry +lemma l10 (C : ℕ → Set α) (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C) : + (∃ n, C n = ∅) ↔ (∃ n, ⋂ i ≤ n, C i = ∅) := by + refine ⟨fun h ↦ ?_, ?_⟩ + · obtain ⟨n, hn⟩ := h + use n + by_cases hn' : n = 0 + · rw [hn'] + simp only [le_zero_eq, iInter_iInter_eq_left] + exact hn' ▸ hn + · obtain ⟨k, hk⟩ := exists_eq_succ_of_ne_zero hn' + rw [hk, decumulate_succ, ← succ_eq_add_one, ← hk, hn, Set.inter_empty] + · have h3 (n : ℕ) : ∃ m, ⋂ i ≤ n, C i ⊇ C m := by + induction n with + | zero => + use 0 + simp + | succ n hn => + obtain ⟨m, hm⟩ := hn + rw [decumulate_succ] + obtain ⟨k, hk⟩ := hd m (n+1) + simp at hk + use k + simp only [Set.subset_inter_iff] + exact ⟨le_trans hk.1 hm, hk.2⟩ + rw [← not_imp_not] + push_neg + intro h n + obtain h2 := hd n (n + 1) + simp at h2 + obtain ⟨m, hm⟩ := h3 n + exact Set.Nonempty.mono hm (h m) theorem IsCompactSystem.iff_mono [Inhabited α] (hpi : IsPiSystem' p) : (IsCompactSystem p) ↔ - (∀ (C : ℕ → Set α) (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → + (∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → ⋂ i, C i = ∅ → ∃ (n : ℕ), C n = ∅) := by - have hs (C : ℕ → Set α) (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C) : (∃ n, C n = ∅) ↔ (∃ n, ⋂ i ≤ n, C i = ∅) := by - refine ⟨fun h ↦ ?_, ?_⟩ - · obtain ⟨n, hn⟩ := h - use n - by_cases hn' : n = 0 - · rw [hn'] - simp only [le_zero_eq, iInter_iInter_eq_left] - exact hn' ▸ hn - · obtain ⟨k, hk⟩ := exists_eq_succ_of_ne_zero hn' - rw [hk, decumulate_succ, ← succ_eq_add_one, ← hk, hn, Set.inter_empty] - · have h3 (n : ℕ) : ∃ m, ⋂ i ≤ n, C i ⊇ C m := by - induction n with - | zero => - use 0 - simp - | succ n hn => - obtain ⟨m, hm⟩ := hn - rw [decumulate_succ] - obtain ⟨k, hk⟩ := hd m (n+1) - simp at hk - use k - simp only [Set.subset_inter_iff] - exact ⟨le_trans hk.1 hm, hk.2⟩ - rw [← not_imp_not] - push_neg - intro h n - obtain h2 := hd n (n + 1) - simp at h2 - obtain ⟨m, hm⟩ := h3 n - exact Set.Nonempty.mono hm (h m) - -- rw [IsCompactSystem.iff_le] - refine ⟨fun h ↦ fun C hdi hi ↦ ?_, fun h C ↦ ?_⟩ - · rw [hs C hdi] + refine ⟨fun h ↦ fun C hdi hi ↦ ?_, fun h C h1 h2 ↦ ?_⟩ + · rw [l10 C hdi] exact h C hi - · - sorry - - let D := fun n ↦ ⋂ i ≤ n, C i - have h' := h C - have h1 (n : ℕ) : ⋂ i ≤ n, D i = ⋂ i ≤ n, C i := biInter_decumulate C n - have h1' : ⋂ i, D i = ⋂ i, C i := by exact biInter_le_eq_iInter - have h2 : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) D := by - refine directed_of_isDirected_le ?_ - intro i j hij - simp [D] - intro k hk - refine biInter_subset_of_mem ?_ - exact le_trans hk hij - intro hi hi' - have h3 (i : ℕ) : p (D i) := by - simp [D, hpi] - obtain h4 := l2 {s : Set α | p s} hpi C - obtain h5 := h4 hi i - exact h5 - obtain h5 := h D h2 h3 (h1' ▸ hi') - obtain h6 := h D h2 - rw [← iInter_empty_iff] at * - rcases h5 with ⟨n, hn⟩ - use n - rwa [← h1 n] - -lemma l4 : (∀ (n : ℕ), (C n).Nonempty → - (⋂ i, C i).Nonempty) ↔ ((⋂ i, C i) = ∅ → ∃ (n : ℕ), (C n) = ∅) := by - sorry + · let D := fun n ↦ ⋂ i ≤ n, C i + have h' := h C + have h8 (n : ℕ) : ⋂ i ≤ n, D i = ⋂ i ≤ n, C i := biInter_decumulate C n + have h1' : ⋂ i, D i = ⋂ i, C i := by exact biInter_le_eq_iInter + have h9 : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) D := by + refine directed_of_isDirected_le ?_ + intro i j hij + simp [D] + intro k hk + refine biInter_subset_of_mem ?_ + exact le_trans hk hij + have h3 (i : ℕ) : p (D i) := by + simp [D, hpi] + obtain h4 := l2 {s : Set α | p s} hpi C + obtain h5 := h4 h1 i + exact h5 + obtain h5 := h D h9 h3 (h1' ▸ h2) + obtain h6 := h D h9 + rcases h5 with ⟨n, hn⟩ + use n example (P Q : Prop) : (P → Q) ↔ (¬ Q → ¬ P) := by exact Iff.symm not_imp_not @@ -237,15 +223,15 @@ theorem IsCompactSystem.iff_mono' [Inhabited α] (hpi : IsPiSystem' p) : (IsComp ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → (∀ (n : ℕ), (C n).Nonempty) → (⋂ i, C i).Nonempty := by - -- rw [IsCompactSystem.iff_mono hpi] - refine ⟨fun h1 C h3 h4 ↦ ?_, fun h1 h2 h3 h4 ↦ ?_⟩ + rw [IsCompactSystem.iff_mono hpi] + refine ⟨fun h1 C h3 h4 ↦ ?_, fun h1 C h3 ↦ ?_⟩ · rw [← not_imp_not] push_neg - - refine h1 C h4 - simp only [nonempty_iInter, not_exists, not_forall] - sorry - · sorry + exact h1 C h3 h4 + · intro s + rw [← not_imp_not] + push_neg + exact h1 C h3 s @@ -280,9 +266,6 @@ lemma l7 (p : α → Prop) (s : α) : (s ∈ ⋃ (i : α) (_ : p i), {i}) ↔ ( variable {α : Type*} [TopologicalSpace α] -example (p : α → Prop) (s : α) : (⋃ (i : α) (_ : p i), {i}) s ↔ p s := by - apply? - example (x y : Set α) (hx : IsClosed x) (hy : IsClosed y) : IsClosed (x ∩ y) := by exact IsClosed.inter hx hy From ba7252d13119135804ca0d0a22743ee33838ffdd Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sat, 15 Feb 2025 13:32:58 +0100 Subject: [PATCH 007/129] dissipate --- Mathlib/Data/Set/Dissipate.lean | 109 ++++++++++++++++++ .../Topology/Compactness/CompactSystem.lean | 4 +- 2 files changed, 110 insertions(+), 3 deletions(-) create mode 100644 Mathlib/Data/Set/Dissipate.lean diff --git a/Mathlib/Data/Set/Dissipate.lean b/Mathlib/Data/Set/Dissipate.lean new file mode 100644 index 00000000000000..d9a38cf1172ba3 --- /dev/null +++ b/Mathlib/Data/Set/Dissipate.lean @@ -0,0 +1,109 @@ +/- +Copyright (c) 2025 Peter Pfaffelhuber. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Peter Pfaffelhuber +-/ +import Mathlib.Data.Set.Lattice + +/-! +# Accumulate + +The function `Dissipate` takes a set `s` and returns `⋂ y ≤ x, s y`. +-/ + + +variable {α β : Type*} {s : α → Set β} + +namespace Set + +/-- `Dissipate s` is the intersection of `s y` for `y ≤ x`. -/ +def Dissipate [LE α] (s : α → Set β) (x : α) : Set β := + ⋂ y ≤ x, s y + +theorem dissipate_def [LE α] {x : α} : Dissipate s x = ⋂ y ≤ x, s y := + rfl + +@[simp] +theorem mem_dissipate [LE α] {x : α} {z : β} : z ∈ Dissipate s x ↔ ∀ y ≤ x, z ∈ s y := by + simp_rw [dissipate_def, mem_iInter₂] + +theorem dissipate_subset [Preorder α] {x y : α} (hy : y ≤ x): Dissipate s x ⊆ s y := + biInter_subset_of_mem hy + +theorem dissipate_subset_iInter [Preorder α] (x : α) : ⋂ i, s i ⊆ Dissipate s x := by + simp [Dissipate] + exact fun x h ↦ iInter_subset_of_subset x fun ⦃a⦄ a ↦ a + +theorem antitone_dissipate [Preorder α] : Antitone (Dissipate s) := + fun _ _ hab ↦ biInter_subset_biInter_left fun _ hz => le_trans hz hab + +@[gcongr] +theorem dissipate_subset_dissipate [Preorder α] {x y} (h : y ≤ x) : + Dissipate s x ⊆ Dissipate s y := + antitone_dissipate h + +#check antitone_dissipate + +example [Preorder α] (x : α) : x ≤ x := by exact Preorder.le_refl x + +@[simp] +theorem biInter_dissipate [Preorder α] {s : α → Set β} {x : α} : + ⋂ y ≤ x, s y = ⋂ y ≤ x, ⋂ z ≤ y, s z := by + apply Set.Subset.antisymm + · sorry + · exact iInter₂_mono fun y _ => dissipate_subset (le_refl y) + + have h := fun y hy ↦ antitone_dissipate hy + refine iInter₂_subset + +-- antitone_dissipate hy + + sorry + simp only [subset_iInter_iff, Dissipate] + exact fun i hi z hz ↦ biInter_subset_of_mem <| le_trans hz hi + · apply iInter_mono + intro z y hy + simp only [mem_iInter, mem_dissipate] at * + exact fun h ↦ hy h z <| le_refl z + +@[simp] +theorem biInter_dissipate [Preorder α] {s : α → Set β} {x : α} : + ⋂ y ≤ x, s y = ⋂ y ≤ x, ⋂ z ≤ y, s z := by + apply Set.Subset.antisymm + · simp only [subset_iInter_iff, Dissipate] + exact fun i hi z hz ↦ biInter_subset_of_mem <| le_trans hz hi + · apply iInter_mono + intro z y hy + simp only [mem_iInter, mem_dissipate] at * + exact fun h ↦ hy h z <| le_refl z + + +theorem biInter_dissipate' [Preorder α] (x : α) : ⋃ y ≤ x, Accumulate s y = ⋃ y ≤ x, s y := by + apply Subset.antisymm + · exact iUnion₂_subset fun y hy => monotone_accumulate hy + · exact iUnion₂_mono fun y _ => subset_accumulate + +theorem iUnion_accumulate [Preorder α] : ⋃ x, Accumulate s x = ⋃ x, s x := by + apply Subset.antisymm + · simp only [subset_def, mem_iUnion, exists_imp, mem_accumulate] + intro z x x' ⟨_, hz⟩ + exact ⟨x', hz⟩ + · exact iUnion_mono fun i => subset_accumulate + +@[simp] +lemma accumulate_bot [PartialOrder α] [OrderBot α] (s : α → Set β) : Accumulate s ⊥ = s ⊥ := by + simp [Set.accumulate_def] + +@[simp] +lemma accumulate_zero_nat (s : ℕ → Set β) : Accumulate s 0 = s 0 := by + simp [accumulate_def] + +open Function in +theorem disjoint_accumulate [Preorder α] (hs : Pairwise (Disjoint on s)) {i j : α} (hij : i < j) : + Disjoint (Accumulate s i) (s j) := by + apply disjoint_left.2 (fun x hx ↦ ?_) + simp only [Accumulate, mem_iUnion, exists_prop] at hx + rcases hx with ⟨k, hk, hx⟩ + exact disjoint_left.1 (hs (hk.trans_lt hij).ne) hx + +end Set diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 2b6251c95d39de..95ccca80427e27 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -170,9 +170,7 @@ lemma l10 (C : ℕ → Set α) (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2 rw [hk, decumulate_succ, ← succ_eq_add_one, ← hk, hn, Set.inter_empty] · have h3 (n : ℕ) : ∃ m, ⋂ i ≤ n, C i ⊇ C m := by induction n with - | zero => - use 0 - simp + | zero => use 0; simp | succ n hn => obtain ⟨m, hm⟩ := hn rw [decumulate_succ] From 119f2aa947447a8087df1f8309da39c547915b7e Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sun, 16 Feb 2025 00:21:22 +0100 Subject: [PATCH 008/129] added dissipate --- Mathlib/Data/Set/Dissipate.lean | 106 +++++++++--------- .../Topology/Compactness/CompactSystem.lean | 31 ++--- 2 files changed, 64 insertions(+), 73 deletions(-) diff --git a/Mathlib/Data/Set/Dissipate.lean b/Mathlib/Data/Set/Dissipate.lean index d9a38cf1172ba3..b340afa2d8c8b1 100644 --- a/Mathlib/Data/Set/Dissipate.lean +++ b/Mathlib/Data/Set/Dissipate.lean @@ -6,12 +6,11 @@ Authors: Peter Pfaffelhuber import Mathlib.Data.Set.Lattice /-! -# Accumulate +# Dissipate The function `Dissipate` takes a set `s` and returns `⋂ y ≤ x, s y`. -/ - variable {α β : Type*} {s : α → Set β} namespace Set @@ -42,68 +41,71 @@ theorem dissipate_subset_dissipate [Preorder α] {x y} (h : y ≤ x) : Dissipate s x ⊆ Dissipate s y := antitone_dissipate h -#check antitone_dissipate - -example [Preorder α] (x : α) : x ≤ x := by exact Preorder.le_refl x - -@[simp] -theorem biInter_dissipate [Preorder α] {s : α → Set β} {x : α} : - ⋂ y ≤ x, s y = ⋂ y ≤ x, ⋂ z ≤ y, s z := by - apply Set.Subset.antisymm - · sorry - · exact iInter₂_mono fun y _ => dissipate_subset (le_refl y) - - have h := fun y hy ↦ antitone_dissipate hy - refine iInter₂_subset - --- antitone_dissipate hy - - sorry - simp only [subset_iInter_iff, Dissipate] - exact fun i hi z hz ↦ biInter_subset_of_mem <| le_trans hz hi - · apply iInter_mono - intro z y hy - simp only [mem_iInter, mem_dissipate] at * - exact fun h ↦ hy h z <| le_refl z - @[simp] theorem biInter_dissipate [Preorder α] {s : α → Set β} {x : α} : ⋂ y ≤ x, s y = ⋂ y ≤ x, ⋂ z ≤ y, s z := by - apply Set.Subset.antisymm + apply Subset.antisymm · simp only [subset_iInter_iff, Dissipate] exact fun i hi z hz ↦ biInter_subset_of_mem <| le_trans hz hi - · apply iInter_mono - intro z y hy - simp only [mem_iInter, mem_dissipate] at * + · apply iInter_mono fun z y hy ↦ ?_ + simp only [mem_iInter] at * exact fun h ↦ hy h z <| le_refl z +theorem iInter_dissipate [Preorder α] : ⋂ x, s x = ⋂ x, Dissipate s x := by + apply Subset.antisymm <;> simp [subset_def, mem_iInter, exists_imp, mem_dissipate] + · exact fun z h x' y hy ↦ h y + · exact fun z h x' ↦ h x' x' (le_refl x') -theorem biInter_dissipate' [Preorder α] (x : α) : ⋃ y ≤ x, Accumulate s y = ⋃ y ≤ x, s y := by - apply Subset.antisymm - · exact iUnion₂_subset fun y hy => monotone_accumulate hy - · exact iUnion₂_mono fun y _ => subset_accumulate +@[simp] +lemma dissipate_bot [PartialOrder α] [OrderBot α] (s : α → Set β) : Dissipate s ⊥ = s ⊥ := by + simp [Set.dissipate_def] -theorem iUnion_accumulate [Preorder α] : ⋃ x, Accumulate s x = ⋃ x, s x := by - apply Subset.antisymm - · simp only [subset_def, mem_iUnion, exists_imp, mem_accumulate] - intro z x x' ⟨_, hz⟩ - exact ⟨x', hz⟩ - · exact iUnion_mono fun i => subset_accumulate +open Nat @[simp] -lemma accumulate_bot [PartialOrder α] [OrderBot α] (s : α → Set β) : Accumulate s ⊥ = s ⊥ := by - simp [Set.accumulate_def] +theorem dissipate_succ (s : ℕ → Set α) (n : ℕ) : + Dissipate s (n + 1) = Dissipate s n ∩ s (n + 1) := by + ext x + refine ⟨fun hx ↦ ?_, fun hx ↦ ?_⟩ + · simp only [mem_inter_iff, mem_iInter, Dissipate] at * + exact ⟨fun i hi ↦ hx i <| le_trans hi <| + le_add_right n 1, hx (n + 1) <| le_refl (n + 1)⟩ + · simp only [Dissipate, mem_inter_iff, mem_iInter] at * + intro i hi + by_cases h : i ≤ n + · exact hx.1 i h + · simp only [not_le] at h + exact le_antisymm hi h ▸ hx.2 @[simp] -lemma accumulate_zero_nat (s : ℕ → Set β) : Accumulate s 0 = s 0 := by - simp [accumulate_def] - -open Function in -theorem disjoint_accumulate [Preorder α] (hs : Pairwise (Disjoint on s)) {i j : α} (hij : i < j) : - Disjoint (Accumulate s i) (s j) := by - apply disjoint_left.2 (fun x hx ↦ ?_) - simp only [Accumulate, mem_iUnion, exists_prop] at hx - rcases hx with ⟨k, hk, hx⟩ - exact disjoint_left.1 (hs (hk.trans_lt hij).ne) hx +lemma dissipate_zero (s : ℕ → Set β) : Dissipate s 0 = s 0 := by + simp [dissipate_def] + +lemma subset_of_directed {C : ℕ → Set α} (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C) + (n : ℕ) : ∃ m, ⋂ i ≤ n, C i ⊇ C m := by + induction n with + | zero => use 0; simp + | succ n hn => + obtain ⟨m, hm⟩ := hn + simp_rw [← dissipate_def, dissipate_succ] + obtain ⟨k, hk⟩ := hd m (n+1) + simp at hk + use k + simp only [subset_inter_iff] + exact ⟨le_trans hk.1 hm, hk.2⟩ + +lemma empty_of_directed {C : ℕ → Set α} (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C) : + (∃ n, C n = ∅) ↔ (∃ n, Dissipate C n = ∅) := by + refine ⟨fun ⟨n, hn⟩ ↦ ⟨n, ?_⟩, ?_⟩ + · by_cases hn' : n = 0 + · rw [hn'] + exact Eq.trans (dissipate_zero C) (hn' ▸ hn) + · obtain ⟨k, hk⟩ := exists_eq_succ_of_ne_zero hn' + rw [hk, dissipate_succ, ← succ_eq_add_one, ← hk, hn, Set.inter_empty] + · rw [← not_imp_not] + push_neg + intro h n + obtain ⟨m, hm⟩ := subset_of_directed hd n + exact Set.Nonempty.mono hm (h m) end Set diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 95ccca80427e27..f75075a09431cd 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -33,20 +33,14 @@ def IsCompactSystem' (p : Set α → Prop) : Prop := ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ (n : ℕ), (⋂ i ≤ n, C i).Nonempty) → (⋂ i, C i).Nonempty theorem IsCompactSystem_iff_IsCompactSystem' (p : Set α → Prop) : - IsCompactSystem p ↔ IsCompactSystem' p := by - refine ⟨fun h C hC hn ↦ ?_, fun h C hC ↦ ?_⟩ - · have h2 := h C hC - rw [← not_imp_not] at h2 - push_neg at h2 - simp_rw [Set.nonempty_iff_ne_empty] at * + IsCompactSystem p ↔ ( ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ (n : ℕ), + (⋂ i ≤ n, C i).Nonempty) → (⋂ i, C i).Nonempty) := by + refine ⟨fun h C hC hn ↦ ?_, fun h C hC ↦ ?_⟩ <;> have h2 := not_imp_not.mpr <| h C hC + · push_neg at h2 exact h2 hn - · have h2 := h C hC - rw [← not_imp_not] at h2 - push_neg at h2 + · push_neg at h2 exact h2 -example (i n : ℕ) : i < n+1 ↔ i ≤ n := by exact Nat.lt_add_one_iff - lemma l1 (s : Finset ℕ) (hs : s.Nonempty) : s ⊆ Finset.range (s.max' hs + 1) := by intro i hi rw [Finset.mem_range, Nat.lt_add_one_iff] @@ -249,9 +243,9 @@ lemma l5 (p : α → Prop) (s : α) : p s ↔ (s ∈ ⋃ (i : α) (_ : p i), {i} simp only [mem_singleton_iff] at h exact h ▸ hi -lemma l6 (p q : α → Prop) (s : α) : (p s ∧ q s) ↔ (s ∈ ⋃ (i : α) (_ : p i) (_ : q i), {i}) := by - rw [Set.mem_iUnion₂] - simp_rw [mem_iUnion] +@[simp] +lemma l6 {p q : α → Prop} {s : α} : (p s ∧ q s) ↔ (s ∈ ⋃ (i : α) (_ : p i) (_ : q i), {i}) := by + simp_rw [Set.mem_iUnion₂, mem_iUnion] refine ⟨fun h ↦ ?_, fun h ↦ ?_ ⟩ · use s, h.1, h.2 simp only [mem_singleton_iff] @@ -259,9 +253,6 @@ lemma l6 (p q : α → Prop) (s : α) : (p s ∧ q s) ↔ (s ∈ ⋃ (i : α) (_ simp only [mem_singleton_iff] at h2 exact h2 ▸ ⟨hi, h1⟩ -lemma l7 (p : α → Prop) (s : α) : (s ∈ ⋃ (i : α) (_ : p i), {i}) ↔ (⋃ (i : α) (_ : p i), {i}) s:= by - rfl - variable {α : Type*} [TopologicalSpace α] example (x y : Set α) (hx : IsClosed x) (hy : IsClosed y) : IsClosed (x ∩ y) := by @@ -272,13 +263,11 @@ theorem IsCompact.isCompactSystem {α : Type*} [Inhabited α] [TopologicalSpace IsCompactSystem (⋃ (s : Set α) (_ : IsCompact s) (_ : IsClosed s), {s}) := by have h : IsPiSystem' (⋃ (s : Set α) (_ : IsCompact s) (_ : IsClosed s), {s}) := by intro x hx y hy - rw [← (l6 IsCompact IsClosed)] at * + rw [← l6] at * exact ⟨IsCompact.inter_left hy.1 hx.2, IsClosed.inter hx.2 hy.2 ⟩ rw [IsCompactSystem.iff_mono' h] intro C hC h1 hn - have h1' (i : ℕ) : IsCompact (C i) ∧ IsClosed (C i):= by - rw [(l6 IsCompact IsClosed (C i))] - exact h1 i + have h1' (i : ℕ) : IsCompact (C i) ∧ IsClosed (C i):= l6.mpr <| h1 i exact IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed C hC hn (fun i ↦ (h1' i).1) (fun i ↦ (h1' i).2) From df4c80df569cf45b442ec61fbe3ebd356f897946 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sun, 16 Feb 2025 20:26:03 +0100 Subject: [PATCH 009/129] small update --- .../Topology/Compactness/CompactSystem.lean | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index f75075a09431cd..435dc91ad92358 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -131,7 +131,7 @@ theorem iInter_decumulate (s : ℕ → Set α) : ⋂ x, ⋂ y ≤ x, s y = ⋂ y def IsPiSystem' (C : Set (Set α)) := ∀ s ∈ C, ∀ t ∈ C, s ∩ t ∈ C -lemma prime (C : Set (Set α)) (hC : ∅ ∈ C) : (IsPiSystem C) ↔ (IsPiSystem' C) := by +lemma prime (C : Set (Set α)) (hC : ∅ ∈ C) : (IsPiSystem C) ↔ (∀ s ∈ C, ∀ t ∈ C, s ∩ t ∈ C) := by refine ⟨fun h s hs t ht ↦ ?_, fun h s hs t ht _ ↦ h s hs t ht⟩ by_cases h' : (s ∩ t).Nonempty · exact h s hs t ht h' @@ -208,9 +208,6 @@ theorem IsCompactSystem.iff_mono [Inhabited α] (hpi : IsPiSystem' p) : (IsCompa rcases h5 with ⟨n, hn⟩ use n -example (P Q : Prop) : (P → Q) ↔ (¬ Q → ¬ P) := by exact Iff.symm not_imp_not - - theorem IsCompactSystem.iff_mono' [Inhabited α] (hpi : IsPiSystem' p) : (IsCompactSystem p) ↔ ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → (∀ (n : ℕ), (C n).Nonempty) → @@ -245,21 +242,12 @@ lemma l5 (p : α → Prop) (s : α) : p s ↔ (s ∈ ⋃ (i : α) (_ : p i), {i} @[simp] lemma l6 {p q : α → Prop} {s : α} : (p s ∧ q s) ↔ (s ∈ ⋃ (i : α) (_ : p i) (_ : q i), {i}) := by - simp_rw [Set.mem_iUnion₂, mem_iUnion] - refine ⟨fun h ↦ ?_, fun h ↦ ?_ ⟩ - · use s, h.1, h.2 - simp only [mem_singleton_iff] - · obtain ⟨i, hi, h1, h2⟩ := h - simp only [mem_singleton_iff] at h2 - exact h2 ▸ ⟨hi, h1⟩ + simp_rw [Set.mem_iUnion₂, mem_iUnion, mem_singleton_iff] + refine ⟨fun h ↦ ⟨s, h.1, h.2, rfl⟩, fun ⟨i, hi, h1, h2⟩ ↦ h2 ▸ ⟨hi, h1⟩⟩ variable {α : Type*} [TopologicalSpace α] -example (x y : Set α) (hx : IsClosed x) (hy : IsClosed y) : IsClosed (x ∩ y) := by - exact IsClosed.inter hx hy - - -theorem IsCompact.isCompactSystem {α : Type*} [Inhabited α] [TopologicalSpace α] : +theorem IsClosedCompact.isCompactSystem {α : Type*} [Inhabited α] [TopologicalSpace α] : IsCompactSystem (⋃ (s : Set α) (_ : IsCompact s) (_ : IsClosed s), {s}) := by have h : IsPiSystem' (⋃ (s : Set α) (_ : IsCompact s) (_ : IsClosed s), {s}) := by intro x hx y hy @@ -271,8 +259,6 @@ theorem IsCompact.isCompactSystem {α : Type*} [Inhabited α] [TopologicalSpace exact IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed C hC hn (fun i ↦ (h1' i).1) (fun i ↦ (h1' i).2) - - end Compact /-- From a16f7aeeb1acd24a691dc1cfbf5b7a32455db9f5 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sun, 16 Feb 2025 23:41:44 +0100 Subject: [PATCH 010/129] cleaning --- Mathlib/Data/Set/Dissipate.lean | 30 ++- .../Topology/Compactness/CompactSystem.lean | 203 +++--------------- 2 files changed, 58 insertions(+), 175 deletions(-) diff --git a/Mathlib/Data/Set/Dissipate.lean b/Mathlib/Data/Set/Dissipate.lean index b340afa2d8c8b1..a1503199c3660d 100644 --- a/Mathlib/Data/Set/Dissipate.lean +++ b/Mathlib/Data/Set/Dissipate.lean @@ -19,6 +19,7 @@ namespace Set def Dissipate [LE α] (s : α → Set β) (x : α) : Set β := ⋂ y ≤ x, s y +@[simp] theorem dissipate_def [LE α] {x : α} : Dissipate s x = ⋂ y ≤ x, s y := rfl @@ -52,7 +53,7 @@ theorem biInter_dissipate [Preorder α] {s : α → Set β} {x : α} : exact fun h ↦ hy h z <| le_refl z theorem iInter_dissipate [Preorder α] : ⋂ x, s x = ⋂ x, Dissipate s x := by - apply Subset.antisymm <;> simp [subset_def, mem_iInter, exists_imp, mem_dissipate] + apply Subset.antisymm <;> simp_rw [subset_def, mem_iInter, mem_dissipate] · exact fun z h x' y hy ↦ h y · exact fun z h x' ↦ h x' x' (le_refl x') @@ -81,8 +82,8 @@ theorem dissipate_succ (s : ℕ → Set α) (n : ℕ) : lemma dissipate_zero (s : ℕ → Set β) : Dissipate s 0 = s 0 := by simp [dissipate_def] -lemma subset_of_directed {C : ℕ → Set α} (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C) - (n : ℕ) : ∃ m, ⋂ i ≤ n, C i ⊇ C m := by +lemma subset_of_directed {s : ℕ → Set α} (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) s) + (n : ℕ) : ∃ m, ⋂ i ≤ n, s i ⊇ s m := by induction n with | zero => use 0; simp | succ n hn => @@ -94,12 +95,12 @@ lemma subset_of_directed {C : ℕ → Set α} (hd : Directed (fun (x1 x2 : Set simp only [subset_inter_iff] exact ⟨le_trans hk.1 hm, hk.2⟩ -lemma empty_of_directed {C : ℕ → Set α} (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C) : - (∃ n, C n = ∅) ↔ (∃ n, Dissipate C n = ∅) := by +lemma empty_of_directed {s : ℕ → Set α} (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) s) : + (∃ n, s n = ∅) ↔ (∃ n, Dissipate s n = ∅) := by refine ⟨fun ⟨n, hn⟩ ↦ ⟨n, ?_⟩, ?_⟩ · by_cases hn' : n = 0 · rw [hn'] - exact Eq.trans (dissipate_zero C) (hn' ▸ hn) + exact Eq.trans (dissipate_zero s) (hn' ▸ hn) · obtain ⟨k, hk⟩ := exists_eq_succ_of_ne_zero hn' rw [hk, dissipate_succ, ← succ_eq_add_one, ← hk, hn, Set.inter_empty] · rw [← not_imp_not] @@ -108,4 +109,21 @@ lemma empty_of_directed {C : ℕ → Set α} (hd : Directed (fun (x1 x2 : Set α obtain ⟨m, hm⟩ := subset_of_directed hd n exact Set.Nonempty.mono hm (h m) +lemma dissipate_directed {s : ℕ → Set α} : + Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) fun n ↦ Dissipate s n := by + refine directed_of_isDirected_le ?_ + intro i j hij + exact dissipate_subset_dissipate hij + +lemma dissipate_of_piSystem {s : ℕ → Set α} {p : Set α → Prop} + (hp : ∀ (s t : Set α), p s → p t → p (s ∩ t)) (h : ∀ n, p (s n)) (n : ℕ) : + p (Dissipate s n) := by + induction n with + | zero => + simp only [dissipate_def, le_zero_eq, iInter_iInter_eq_left] + exact h 0 + | succ n hn => + rw [dissipate_succ] + exact hp (Dissipate s n) (s (n+1)) hn (h (n+1)) + end Set diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 435dc91ad92358..bc0d4f3e968b98 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -3,6 +3,7 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ +import Mathlib.Data.Set.Dissipate import Mathlib.Topology.Compactness.Compact import Mathlib.MeasureTheory.PiSystem @@ -29,11 +30,8 @@ lemma IsCompactSystem.iInter_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C ⋂ i ≤ hp.max_of_empty hC hC_empty, C i = ∅ := (hp C hC hC_empty).choose_spec -def IsCompactSystem' (p : Set α → Prop) : Prop := - ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ (n : ℕ), (⋂ i ≤ n, C i).Nonempty) → (⋂ i, C i).Nonempty - -theorem IsCompactSystem_iff_IsCompactSystem' (p : Set α → Prop) : - IsCompactSystem p ↔ ( ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ (n : ℕ), +theorem IsCompactSystem_iff_of_nempty (p : Set α → Prop) : + IsCompactSystem p ↔ (∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ (n : ℕ), (⋂ i ≤ n, C i).Nonempty) → (⋂ i, C i).Nonempty) := by refine ⟨fun h C hC hn ↦ ?_, fun h C hC ↦ ?_⟩ <;> have h2 := not_imp_not.mpr <| h C hC · push_neg at h2 @@ -41,96 +39,6 @@ theorem IsCompactSystem_iff_IsCompactSystem' (p : Set α → Prop) : · push_neg at h2 exact h2 -lemma l1 (s : Finset ℕ) (hs : s.Nonempty) : s ⊆ Finset.range (s.max' hs + 1) := by - intro i hi - rw [Finset.mem_range, Nat.lt_add_one_iff] - exact s.le_max' i hi - -example (s : Finset ℕ) (hs : s.Nonempty) (i : ℕ) (hi : i ∈ s) : i ≤ s.max' hs := by - exact Finset.le_max' s i hi - -example (i n : ℕ) : i ∈ Finset.range (n + 1) ↔ i ≤ n := by exact Finset.mem_range_succ_iff - -example (n : ℕ) : { i // i < n+1} = {i // i ≤ n} := by - simp_rw [Nat.lt_add_one_iff] - -example (i n : ℕ) : i < n+1 ↔ i ≤ n := by exact Nat.lt_add_one_iff - -example (C : ℕ → Set α) (n : ℕ) : ⋂ i < n+1, C i = ⋂ i ≤ n, C i := - by simp_rw [Nat.lt_add_one_iff] - -example (n : ℕ) : (Finset.range (n + 1)).Nonempty := by exact Finset.nonempty_range_succ - -@[simp] -lemma iInter_empty_iff [Inhabited α] {C : ℕ → Set α} : (∃ n : ℕ, ⋂ i ≤ n, C i = ∅) ↔ - (∃ (s : Finset ℕ), ⋂ i ∈ s, C i = ∅) := by - refine ⟨fun ⟨n, hn⟩ ↦ ?_, fun ⟨s, hs⟩ ↦ ?_⟩ - · use (Finset.range (n + 1)) - simp_rw [Finset.mem_range_succ_iff] - exact hn - · have h2 : s.Nonempty := by - rw [s.nonempty_iff_ne_empty] - intro h - rw [h] at hs - simp only [Finset.not_mem_empty, iInter_of_empty, iInter_univ, Set.univ_eq_empty_iff, - not_isEmpty_of_nonempty] at hs - use (s.max' h2) - have h : ⋂ i, ⋂ (_ : i ≤ s.max' h2), C i ⊆ ⋂ i ∈ s, C i := by - simp_rw [← Finset.mem_range_succ_iff] - exact biInter_mono (l1 s h2) (fun _ _ ⦃a_1⦄ a ↦ a) - exact subset_empty_iff.mp <| le_trans h hs.le - - - - -theorem IsCompactSystem.iff_le [Inhabited α] : (IsCompactSystem p) ↔ - (∀ C : ℕ → Set α, (∀ i, p (C i)) → ⋂ i, C i = ∅ → ∃ (s : Finset ℕ), ⋂ i ∈ s, C i = ∅) := by - refine ⟨fun h C hp he ↦ ?_, fun h C hp he ↦ ?_ ⟩ - · apply iInter_empty_iff.mp <| h C hp he - · apply iInter_empty_iff.mpr <| h C hp he - - - - -theorem biInter_decumulate (s : ℕ → Set α) (n : ℕ): - ⋂ x ≤ n, ⋂ y ≤ x, s y = ⋂ y ≤ n, s y := by - apply Set.Subset.antisymm - · apply iInter_mono - intro z x hx - simp at hx - simp only [mem_iInter] - exact fun h ↦ hx h z <| Nat.le_refl z - · simp only [subset_iInter_iff] - intro i hi x hx - refine biInter_subset_of_mem ?_ - simp only [le_eq] - exact le_trans hx hi - -theorem decumulate_succ (s : ℕ → Set α) (n : ℕ) : - ⋂ i ≤ n + 1, s i = (⋂ i ≤ n, s i) ∩ s (n + 1) := by - ext x - refine ⟨fun hx ↦ ?_, fun hx ↦ ?_⟩ - · simp only [mem_inter_iff, mem_iInter] at * - exact ⟨fun i hi ↦ hx i <| le_trans hi <| le_add_right n 1, hx (n + 1) <| Nat.le_refl (n + 1)⟩ - · simp only [mem_inter_iff, mem_iInter] at * - intro i hi - by_cases h : i ≤ n - · exact hx.1 i h - · simp only [not_le] at h - exact Nat.le_antisymm hi h ▸ hx.2 - -theorem iInter_decumulate (s : ℕ → Set α) : ⋂ x, ⋂ y ≤ x, s y = ⋂ y, s y := by - apply Set.Subset.antisymm - · apply iInter_mono - intro z x hx - simp at hx - apply hx z <| Nat.le_refl z - · simp only [subset_iInter_iff] - intro i x hx - exact iInter_subset_of_subset x fun ⦃a⦄ a ↦ a - -def IsPiSystem' (C : Set (Set α)) := ∀ s ∈ C, ∀ t ∈ C, s ∩ t ∈ C - lemma prime (C : Set (Set α)) (hC : ∅ ∈ C) : (IsPiSystem C) ↔ (∀ s ∈ C, ∀ t ∈ C, s ∩ t ∈ C) := by refine ⟨fun h s hs t ht ↦ ?_, fun h s hs t ht _ ↦ h s hs t ht⟩ by_cases h' : (s ∩ t).Nonempty @@ -138,19 +46,6 @@ lemma prime (C : Set (Set α)) (hC : ∅ ∈ C) : (IsPiSystem C) ↔ (∀ s ∈ · push_neg at h' exact h' ▸ hC -example (C D : ℕ → Set α) (n : ℕ) (hCD : C = D) : ⋂ i ≤ n, C i = ⋂ i ≤ n, D i := by - exact iInter₂_congr fun i j ↦ congrFun hCD i - -lemma l2 (C : Set (Set α)) (hC : IsPiSystem' C) (s : ℕ → Set α) (hs : ∀ n, s n ∈ C) (n : ℕ) : - ⋂ i ≤ n, s i ∈ C := by - induction n with - | zero => - simp only [le_zero_eq, iInter_iInter_eq_left] - exact hs 0 - | succ n hn => - rw [decumulate_succ s n] - exact hC (⋂ i, ⋂ (_ : i ≤ n), s i) hn (s (n + 1)) (hs (n + 1)) - lemma l10 (C : ℕ → Set α) (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C) : (∃ n, C n = ∅) ↔ (∃ n, ⋂ i ≤ n, C i = ∅) := by refine ⟨fun h ↦ ?_, ?_⟩ @@ -161,13 +56,14 @@ lemma l10 (C : ℕ → Set α) (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2 simp only [le_zero_eq, iInter_iInter_eq_left] exact hn' ▸ hn · obtain ⟨k, hk⟩ := exists_eq_succ_of_ne_zero hn' - rw [hk, decumulate_succ, ← succ_eq_add_one, ← hk, hn, Set.inter_empty] + simp_rw [hk, succ_eq_add_one, ← dissipate_def, dissipate_succ, + ← succ_eq_add_one, ← hk, hn, Set.inter_empty] · have h3 (n : ℕ) : ∃ m, ⋂ i ≤ n, C i ⊇ C m := by induction n with | zero => use 0; simp | succ n hn => obtain ⟨m, hm⟩ := hn - rw [decumulate_succ] + simp_rw [← dissipate_def, dissipate_succ] obtain ⟨k, hk⟩ := hd m (n+1) simp at hk use k @@ -181,48 +77,24 @@ lemma l10 (C : ℕ → Set α) (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2 obtain ⟨m, hm⟩ := h3 n exact Set.Nonempty.mono hm (h m) -theorem IsCompactSystem.iff_mono [Inhabited α] (hpi : IsPiSystem' p) : (IsCompactSystem p) ↔ +theorem IsCompactSystem.iff_mono [Inhabited α] (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : + (IsCompactSystem p) ↔ (∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → ⋂ i, C i = ∅ → ∃ (n : ℕ), C n = ∅) := by refine ⟨fun h ↦ fun C hdi hi ↦ ?_, fun h C h1 h2 ↦ ?_⟩ · rw [l10 C hdi] exact h C hi - · let D := fun n ↦ ⋂ i ≤ n, C i - have h' := h C - have h8 (n : ℕ) : ⋂ i ≤ n, D i = ⋂ i ≤ n, C i := biInter_decumulate C n - have h1' : ⋂ i, D i = ⋂ i, C i := by exact biInter_le_eq_iInter - have h9 : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) D := by - refine directed_of_isDirected_le ?_ - intro i j hij - simp [D] - intro k hk - refine biInter_subset_of_mem ?_ - exact le_trans hk hij - have h3 (i : ℕ) : p (D i) := by - simp [D, hpi] - obtain h4 := l2 {s : Set α | p s} hpi C - obtain h5 := h4 h1 i - exact h5 - obtain h5 := h D h9 h3 (h1' ▸ h2) - obtain h6 := h D h9 - rcases h5 with ⟨n, hn⟩ - use n + · rw [← biInter_le_eq_iInter] at h2 + exact h (Dissipate C) dissipate_directed (dissipate_of_piSystem hpi h1) h2 -theorem IsCompactSystem.iff_mono' [Inhabited α] (hpi : IsPiSystem' p) : (IsCompactSystem p) ↔ - ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → - (∀ (n : ℕ), (C n).Nonempty) → - (⋂ i, C i).Nonempty := by +theorem IsCompactSystem.iff_mono' [Inhabited α] (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : + (IsCompactSystem p) ↔ + ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → + (∀ (n : ℕ), (C n).Nonempty) → (⋂ i, C i).Nonempty := by rw [IsCompactSystem.iff_mono hpi] - refine ⟨fun h1 C h3 h4 ↦ ?_, fun h1 C h3 ↦ ?_⟩ - · rw [← not_imp_not] - push_neg - exact h1 C h3 h4 - · intro s - rw [← not_imp_not] - push_neg - exact h1 C h3 s - - + refine ⟨fun h1 C h3 h4 ↦ ?_, fun h1 C h3 s ↦ ?_⟩ <;> rw [← not_imp_not] <;> push_neg + · exact h1 C h3 h4 + · exact h1 C h3 s end definition @@ -230,34 +102,27 @@ section Compact variable {α : Type*} -@[simp] -lemma l5 (p : α → Prop) (s : α) : p s ↔ (s ∈ ⋃ (i : α) (_ : p i), {i}) := by - rw [Set.mem_iUnion₂] - refine ⟨fun h ↦ ?_, fun h ↦ ?_ ⟩ - · use s, h - simp only [mem_singleton_iff] - · obtain ⟨i, hi, h⟩ := h - simp only [mem_singleton_iff] at h - exact h ▸ hi - -@[simp] -lemma l6 {p q : α → Prop} {s : α} : (p s ∧ q s) ↔ (s ∈ ⋃ (i : α) (_ : p i) (_ : q i), {i}) := by - simp_rw [Set.mem_iUnion₂, mem_iUnion, mem_singleton_iff] - refine ⟨fun h ↦ ⟨s, h.1, h.2, rfl⟩, fun ⟨i, hi, h1, h2⟩ ↦ h2 ▸ ⟨hi, h1⟩⟩ - variable {α : Type*} [TopologicalSpace α] +example (s t : Set α) (hs : IsClosed s) (ht : IsClosed t) : IsClosed (s ∩ t) := by + exact IsClosed.inter hs ht + +example : IsCompact (∅ : Set α) := by exact isCompact_empty + theorem IsClosedCompact.isCompactSystem {α : Type*} [Inhabited α] [TopologicalSpace α] : - IsCompactSystem (⋃ (s : Set α) (_ : IsCompact s) (_ : IsClosed s), {s}) := by - have h : IsPiSystem' (⋃ (s : Set α) (_ : IsCompact s) (_ : IsClosed s), {s}) := by - intro x hx y hy - rw [← l6] at * + IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by + have h : IsPiSystem ({ s : Set α | IsCompact s ∧ IsClosed s}) := by + intro x hx y hy _ exact ⟨IsCompact.inter_left hy.1 hx.2, IsClosed.inter hx.2 hy.2 ⟩ - rw [IsCompactSystem.iff_mono' h] - intro C hC h1 hn - have h1' (i : ℕ) : IsCompact (C i) ∧ IsClosed (C i):= l6.mpr <| h1 i - exact IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed C hC hn - (fun i ↦ (h1' i).1) (fun i ↦ (h1' i).2) + have h1 : ∅ ∈ {s : Set α| IsCompact s ∧ IsClosed s} := by + exact ⟨isCompact_empty, isClosed_empty⟩ + have h2 : ∀ (s t : Set α), IsCompact s ∧ IsClosed s → + IsCompact t ∧ IsClosed t → IsCompact (s ∩ t) ∧ IsClosed (s ∩ t) := + fun s t h1 h2 ↦ ⟨IsCompact.inter_right h1.1 h2.2, IsClosed.inter h1.2 h2.2⟩ + rw [prime _ h1] at h + rw [IsCompactSystem.iff_mono' h2] + exact fun s hs h1 h2 ↦ IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed s hs h2 + (fun i ↦ (h1 i).1) (fun i ↦ (h1 i).2) end Compact From 77734cb0ffa728200c0a644e021128586e2cd9c5 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Mon, 17 Feb 2025 00:05:57 +0100 Subject: [PATCH 011/129] cleaning2 --- Mathlib/Data/Set/Dissipate.lean | 27 +++++++++++++++ .../Topology/Compactness/CompactSystem.lean | 33 +------------------ 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/Mathlib/Data/Set/Dissipate.lean b/Mathlib/Data/Set/Dissipate.lean index a1503199c3660d..3713fa64e94e15 100644 --- a/Mathlib/Data/Set/Dissipate.lean +++ b/Mathlib/Data/Set/Dissipate.lean @@ -115,6 +115,33 @@ lemma dissipate_directed {s : ℕ → Set α} : intro i j hij exact dissipate_subset_dissipate hij +lemma mem_subset_dissipate_of_directed (C : ℕ → Set α) + (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C) (n : ℕ) : ∃ m, Dissipate C n ⊇ C m := by + induction n with + | zero => use 0; simp + | succ n hn => + obtain ⟨m, hm⟩ := hn + obtain ⟨k, hk⟩ := hd m (n+1) + simp_rw [dissipate_succ] + simp at hk + exact ⟨k, Set.subset_inter_iff.mpr <| ⟨le_trans hk.1 hm, hk.2⟩⟩ + +lemma dissipate_exists_empty_iff_of_directed (C : ℕ → Set α) + (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C) : + (∃ n, C n = ∅) ↔ (∃ n, Dissipate C n = ∅) := by + refine ⟨fun ⟨n, hn⟩ ↦ ⟨n, ?_⟩ , ?_⟩ + · by_cases hn' : n = 0 + · rw [hn', dissipate_zero] + exact hn' ▸ hn + · obtain ⟨k, hk⟩ := exists_eq_succ_of_ne_zero hn' + simp_rw [hk, succ_eq_add_one, dissipate_succ, + ← succ_eq_add_one, ← hk, hn, Set.inter_empty] + · rw [← not_imp_not] + push_neg + intro h n + obtain ⟨m, hm⟩ := mem_subset_dissipate_of_directed C hd n + exact Set.Nonempty.mono hm (h m) + lemma dissipate_of_piSystem {s : ℕ → Set α} {p : Set α → Prop} (hp : ∀ (s t : Set α), p s → p t → p (s ∩ t)) (h : ∀ n, p (s n)) (n : ℕ) : p (Dissipate s n) := by diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index bc0d4f3e968b98..eb1ce7f8188391 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -46,43 +46,12 @@ lemma prime (C : Set (Set α)) (hC : ∅ ∈ C) : (IsPiSystem C) ↔ (∀ s ∈ · push_neg at h' exact h' ▸ hC -lemma l10 (C : ℕ → Set α) (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C) : - (∃ n, C n = ∅) ↔ (∃ n, ⋂ i ≤ n, C i = ∅) := by - refine ⟨fun h ↦ ?_, ?_⟩ - · obtain ⟨n, hn⟩ := h - use n - by_cases hn' : n = 0 - · rw [hn'] - simp only [le_zero_eq, iInter_iInter_eq_left] - exact hn' ▸ hn - · obtain ⟨k, hk⟩ := exists_eq_succ_of_ne_zero hn' - simp_rw [hk, succ_eq_add_one, ← dissipate_def, dissipate_succ, - ← succ_eq_add_one, ← hk, hn, Set.inter_empty] - · have h3 (n : ℕ) : ∃ m, ⋂ i ≤ n, C i ⊇ C m := by - induction n with - | zero => use 0; simp - | succ n hn => - obtain ⟨m, hm⟩ := hn - simp_rw [← dissipate_def, dissipate_succ] - obtain ⟨k, hk⟩ := hd m (n+1) - simp at hk - use k - simp only [Set.subset_inter_iff] - exact ⟨le_trans hk.1 hm, hk.2⟩ - rw [← not_imp_not] - push_neg - intro h n - obtain h2 := hd n (n + 1) - simp at h2 - obtain ⟨m, hm⟩ := h3 n - exact Set.Nonempty.mono hm (h m) - theorem IsCompactSystem.iff_mono [Inhabited α] (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : (IsCompactSystem p) ↔ (∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → ⋂ i, C i = ∅ → ∃ (n : ℕ), C n = ∅) := by refine ⟨fun h ↦ fun C hdi hi ↦ ?_, fun h C h1 h2 ↦ ?_⟩ - · rw [l10 C hdi] + · rw [dissipate_exists_empty_iff_of_directed C hdi] exact h C hi · rw [← biInter_le_eq_iInter] at h2 exact h (Dissipate C) dissipate_directed (dissipate_of_piSystem hpi h1) h2 From 1bec0f7f5375543b66119002e2168bb9a74b89a4 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Mon, 17 Feb 2025 00:06:11 +0100 Subject: [PATCH 012/129] cleaning3 --- Mathlib/Data/Set/Dissipate.lean | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Mathlib/Data/Set/Dissipate.lean b/Mathlib/Data/Set/Dissipate.lean index 3713fa64e94e15..af81770e7fdf27 100644 --- a/Mathlib/Data/Set/Dissipate.lean +++ b/Mathlib/Data/Set/Dissipate.lean @@ -110,10 +110,8 @@ lemma empty_of_directed {s : ℕ → Set α} (hd : Directed (fun (x1 x2 : Set α exact Set.Nonempty.mono hm (h m) lemma dissipate_directed {s : ℕ → Set α} : - Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) fun n ↦ Dissipate s n := by - refine directed_of_isDirected_le ?_ - intro i j hij - exact dissipate_subset_dissipate hij + Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) fun n ↦ Dissipate s n := + directed_of_isDirected_le <| fun _ _ hij ↦ dissipate_subset_dissipate hij lemma mem_subset_dissipate_of_directed (C : ℕ → Set α) (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C) (n : ℕ) : ∃ m, Dissipate C n ⊇ C m := by From 225f41f036147cffb9fd2a3adce1f5c7b26bf0b7 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Mon, 17 Feb 2025 08:55:01 +0100 Subject: [PATCH 013/129] added mono from diss --- Mathlib/Data/Set/Dissipate.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mathlib/Data/Set/Dissipate.lean b/Mathlib/Data/Set/Dissipate.lean index af81770e7fdf27..fc3a270c68ac77 100644 --- a/Mathlib/Data/Set/Dissipate.lean +++ b/Mathlib/Data/Set/Dissipate.lean @@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Peter Pfaffelhuber -/ import Mathlib.Data.Set.Lattice +import Mathlib.Order.Directed /-! # Dissipate @@ -111,7 +112,7 @@ lemma empty_of_directed {s : ℕ → Set α} (hd : Directed (fun (x1 x2 : Set α lemma dissipate_directed {s : ℕ → Set α} : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) fun n ↦ Dissipate s n := - directed_of_isDirected_le <| fun _ _ hij ↦ dissipate_subset_dissipate hij + antitone_dissipate.directed_ge lemma mem_subset_dissipate_of_directed (C : ℕ → Set α) (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C) (n : ℕ) : ∃ m, Dissipate C n ⊇ C m := by From f734c6019c10f0974b36a0c752bf2d81f19e579e Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 21 Feb 2025 09:21:09 +0100 Subject: [PATCH 014/129] diss --- Mathlib/Data/Set/Dissipate.lean | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Mathlib/Data/Set/Dissipate.lean b/Mathlib/Data/Set/Dissipate.lean index fc3a270c68ac77..403c6a14de6fd2 100644 --- a/Mathlib/Data/Set/Dissipate.lean +++ b/Mathlib/Data/Set/Dissipate.lean @@ -21,8 +21,7 @@ def Dissipate [LE α] (s : α → Set β) (x : α) : Set β := ⋂ y ≤ x, s y @[simp] -theorem dissipate_def [LE α] {x : α} : Dissipate s x = ⋂ y ≤ x, s y := - rfl +theorem dissipate_def [LE α] {x : α} : Dissipate s x = ⋂ y ≤ x, s y := rfl @[simp] theorem mem_dissipate [LE α] {x : α} {z : β} : z ∈ Dissipate s x ↔ ∀ y ≤ x, z ∈ s y := by @@ -32,7 +31,7 @@ theorem dissipate_subset [Preorder α] {x y : α} (hy : y ≤ x): Dissipate s x biInter_subset_of_mem hy theorem dissipate_subset_iInter [Preorder α] (x : α) : ⋂ i, s i ⊆ Dissipate s x := by - simp [Dissipate] + simp only [Dissipate, subset_iInter_iff] exact fun x h ↦ iInter_subset_of_subset x fun ⦃a⦄ a ↦ a theorem antitone_dissipate [Preorder α] : Antitone (Dissipate s) := @@ -111,7 +110,7 @@ lemma empty_of_directed {s : ℕ → Set α} (hd : Directed (fun (x1 x2 : Set α exact Set.Nonempty.mono hm (h m) lemma dissipate_directed {s : ℕ → Set α} : - Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) fun n ↦ Dissipate s n := + Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) (Dissipate s) := antitone_dissipate.directed_ge lemma mem_subset_dissipate_of_directed (C : ℕ → Set α) @@ -141,6 +140,8 @@ lemma dissipate_exists_empty_iff_of_directed (C : ℕ → Set α) obtain ⟨m, hm⟩ := mem_subset_dissipate_of_directed C hd n exact Set.Nonempty.mono hm (h m) +/-- For a ∩-stable attribute `p` on `Set α` and a sequence of sets `s` with this attribute, +`p ⋂ i ≤ n, s n` holds. -/ lemma dissipate_of_piSystem {s : ℕ → Set α} {p : Set α → Prop} (hp : ∀ (s t : Set α), p s → p t → p (s ∩ t)) (h : ∀ n, p (s n)) (n : ℕ) : p (Dissipate s n) := by From 7b0a410456a4a56e56597cc4ccc220e5ba7f767b Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 21 Feb 2025 11:01:50 +0100 Subject: [PATCH 015/129] final? --- Mathlib/MeasureTheory/PiSystem.lean | 8 + .../Topology/Compactness/CompactSystem.lean | 324 +++--------------- 2 files changed, 51 insertions(+), 281 deletions(-) diff --git a/Mathlib/MeasureTheory/PiSystem.lean b/Mathlib/MeasureTheory/PiSystem.lean index 92cc30b6405765..9857d76bf11e31 100644 --- a/Mathlib/MeasureTheory/PiSystem.lean +++ b/Mathlib/MeasureTheory/PiSystem.lean @@ -97,6 +97,14 @@ theorem IsPiSystem.insert_univ {S : Set (Set α)} (h_pi : IsPiSystem S) : · simp [hs, ht] · exact Set.mem_insert_of_mem _ (h_pi s hs t ht hst) +lemma IsPiSystem.iff_of_empty_mem (S : Set (Set α)) (hS : ∅ ∈ S) : + (IsPiSystem S) ↔ (∀ s ∈ S, ∀ t ∈ S, s ∩ t ∈ S) := by + refine ⟨fun h s hs t ht ↦ ?_, fun h s hs t ht _ ↦ h s hs t ht⟩ + by_cases h' : (s ∩ t).Nonempty + · exact h s hs t ht h' + · push_neg at h' + exact h' ▸ hS + theorem IsPiSystem.comap {α β} {S : Set (Set β)} (h_pi : IsPiSystem S) (f : α → β) : IsPiSystem { s : Set α | ∃ t ∈ S, f ⁻¹' t = s } := by rintro _ ⟨s, hs_mem, rfl⟩ _ ⟨t, ht_mem, rfl⟩ hst diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index eb1ce7f8188391..bae79df4393bf8 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -4,9 +4,27 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ import Mathlib.Data.Set.Dissipate -import Mathlib.Topology.Compactness.Compact +import Mathlib.Topology.Separation.Hausdorff import Mathlib.MeasureTheory.PiSystem +/-! +# Compact systems. + +This files defines compact systems of sets. + +## Main definitions + +* `IsCompactSystem`: A set of sets is a compact system if, whenever a countable subfamily has empty + intersection, then finitely many of them already have empty intersection. + +## Main results + +* `IsClosedCompact.isCompactSystem`: The set of closed and compact sets is a compact system. +* `IsClosedCompact.isCompactSystem_of_T2Space`: In a `T2Space α`, the set of compact sets + is a compact system. + +-/ + open Set Finset Nat section definition @@ -16,7 +34,7 @@ variable {α : Type*} {p : Set α → Prop} {C : ℕ → Set α} /-- A set of sets is a compact system if, whenever a countable subfamily has empty intersection, then finitely many of them already have empty intersection. -/ def IsCompactSystem (p : Set α → Prop) : Prop := - ∀ C : ℕ → Set α, (∀ i, p (C i)) → ⋂ i, C i = ∅ → ∃ (n : ℕ), ⋂ i ≤ n, C i = ∅ + ∀ C : ℕ → Set α, (∀ i, p (C i)) → ⋂ i, C i = ∅ → ∃ (n : ℕ), Dissipate C n = ∅ /-- In a compact system, given a countable family with empty intersection, we choose a finite subfamily with empty intersection-/ @@ -27,26 +45,19 @@ def IsCompactSystem.max_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) lemma IsCompactSystem.iInter_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) (hC_empty : ⋂ i, C i = ∅) : - ⋂ i ≤ hp.max_of_empty hC hC_empty, C i = ∅ := + Dissipate C (hp.max_of_empty hC hC_empty) = ∅ := (hp C hC hC_empty).choose_spec -theorem IsCompactSystem_iff_of_nempty (p : Set α → Prop) : +theorem IsCompactSystem.iff_of_nempty (p : Set α → Prop) : IsCompactSystem p ↔ (∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ (n : ℕ), - (⋂ i ≤ n, C i).Nonempty) → (⋂ i, C i).Nonempty) := by + (Dissipate C n).Nonempty) → (⋂ i, C i).Nonempty) := by refine ⟨fun h C hC hn ↦ ?_, fun h C hC ↦ ?_⟩ <;> have h2 := not_imp_not.mpr <| h C hC · push_neg at h2 exact h2 hn · push_neg at h2 exact h2 -lemma prime (C : Set (Set α)) (hC : ∅ ∈ C) : (IsPiSystem C) ↔ (∀ s ∈ C, ∀ t ∈ C, s ∩ t ∈ C) := by - refine ⟨fun h s hs t ht ↦ ?_, fun h s hs t ht _ ↦ h s hs t ht⟩ - by_cases h' : (s ∩ t).Nonempty - · exact h s hs t ht h' - · push_neg at h' - exact h' ▸ hC - -theorem IsCompactSystem.iff_mono [Inhabited α] (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : +theorem IsCompactSystem.iff_directed (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : (IsCompactSystem p) ↔ (∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → ⋂ i, C i = ∅ → ∃ (n : ℕ), C n = ∅) := by @@ -56,29 +67,21 @@ theorem IsCompactSystem.iff_mono [Inhabited α] (hpi : ∀ (s t : Set α), p s · rw [← biInter_le_eq_iInter] at h2 exact h (Dissipate C) dissipate_directed (dissipate_of_piSystem hpi h1) h2 -theorem IsCompactSystem.iff_mono' [Inhabited α] (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : +theorem IsCompactSystem.iff_directed' (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : (IsCompactSystem p) ↔ ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → (∀ (n : ℕ), (C n).Nonempty) → (⋂ i, C i).Nonempty := by - rw [IsCompactSystem.iff_mono hpi] + rw [IsCompactSystem.iff_directed hpi] refine ⟨fun h1 C h3 h4 ↦ ?_, fun h1 C h3 s ↦ ?_⟩ <;> rw [← not_imp_not] <;> push_neg · exact h1 C h3 h4 · exact h1 C h3 s end definition -section Compact - -variable {α : Type*} - -variable {α : Type*} [TopologicalSpace α] - -example (s t : Set α) (hs : IsClosed s) (ht : IsClosed t) : IsClosed (s ∩ t) := by - exact IsClosed.inter hs ht +section ClosedCompact -example : IsCompact (∅ : Set α) := by exact isCompact_empty - -theorem IsClosedCompact.isCompactSystem {α : Type*} [Inhabited α] [TopologicalSpace α] : +/-- The set of compact and closed sets is a compact system. -/ +theorem IsClosedCompact.isCompactSystem {α : Type*} [TopologicalSpace α] : IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by have h : IsPiSystem ({ s : Set α | IsCompact s ∧ IsClosed s}) := by intro x hx y hy _ @@ -88,263 +91,22 @@ theorem IsClosedCompact.isCompactSystem {α : Type*} [Inhabited α] [Topological have h2 : ∀ (s t : Set α), IsCompact s ∧ IsClosed s → IsCompact t ∧ IsClosed t → IsCompact (s ∩ t) ∧ IsClosed (s ∩ t) := fun s t h1 h2 ↦ ⟨IsCompact.inter_right h1.1 h2.2, IsClosed.inter h1.2 h2.2⟩ - rw [prime _ h1] at h - rw [IsCompactSystem.iff_mono' h2] + rw [IsPiSystem.iff_of_empty_mem _ h1] at h + rw [IsCompactSystem.iff_directed' h2] exact fun s hs h1 h2 ↦ IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed s hs h2 (fun i ↦ (h1 i).1) (fun i ↦ (h1 i).2) -end Compact - -/-- -section ClosedCompactCylinders - -/-! We prove that the `closedCompactCylinders` are a compact system. -/ - -variable {ι : Type*} {α : ι → Type*} [∀ i, TopologicalSpace (α i)] {s : ℕ → Set (Π i, α i)} - -local notation "Js" => closedCompactCylinders.finset -local notation "As" => closedCompactCylinders.set - -section AllProj - -/-- All indices in `ι` that are constrained by the condition `∀ n, s n ∈ closedCompactCylinders α`. -That is, the union of all indices in the bases of the cylinders. -/ -def allProj (hs : ∀ n, s n ∈ closedCompactCylinders α) : Set ι := ⋃ n, Js (hs n) - -theorem subset_allProj (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : - ↑(Js (hs n)) ⊆ allProj hs := - subset_iUnion (fun i ↦ (Js (hs i) : Set ι)) n - -theorem exists_nat_proj (hs : ∀ n, s n ∈ closedCompactCylinders α) (i : ι) (hi : i ∈ allProj hs) : - ∃ n, i ∈ Js (hs n) := by - simpa only [allProj, mem_iUnion, Finset.mem_coe] using hi - -open Classical in -/-- The smallest `n` such that `i ∈ Js (hs n)`. That is, the first `n` such that `i` belongs to the -finset defining the cylinder for `s n`. -/ -noncomputable def indexProj (hs : ∀ n, s n ∈ closedCompactCylinders α) (i : allProj hs) : ℕ := - Nat.find (exists_nat_proj hs i i.2) - -open Classical in -theorem mem_indexProj (hs : ∀ n, s n ∈ closedCompactCylinders α) (i : allProj hs) : - (i : ι) ∈ Js (hs (indexProj hs i)) := - Nat.find_spec (exists_nat_proj hs i i.2) - -open Classical in -theorem indexProj_le (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) (i : Js (hs n)) : - indexProj hs ⟨i, subset_allProj hs n i.2⟩ ≤ n := - Nat.find_le i.2 +theorem IsCompact.isCompactSystem {α : Type*} [TopologicalSpace α] + (h : ∀ {s : Set α}, IsCompact s → IsClosed s) : + IsCompactSystem (fun s : Set α ↦ IsCompact s) := by + have h : (fun s : Set α ↦ IsCompact s) = (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by + ext s + refine ⟨fun h' ↦ ⟨h', h h'⟩, fun h' ↦ h'.1⟩ + exact h ▸ IsClosedCompact.isCompactSystem -lemma surjective_proj_allProj [∀ i, Nonempty (α i)] (hs : ∀ n, s n ∈ closedCompactCylinders α) : - Function.Surjective (fun (f : (Π i, α i)) (i : allProj hs) ↦ f (i : ι)) := by - intro y - let x := (inferInstance : Nonempty (Π i, α i)).some - classical - refine ⟨fun i ↦ if hi : i ∈ allProj hs then y ⟨i, hi⟩ else x i, ?_⟩ - ext i - simp only [Subtype.coe_prop, dite_true] +/-- In a `T2Space` The set of compact sets is a compact system. -/ +theorem IsCompact.isCompactSystem_of_T2Space {α : Type*} [TopologicalSpace α] [T2Space α] : + IsCompactSystem (fun s : Set α ↦ IsCompact s) := + IsCompact.isCompactSystem fun {_} a ↦ isClosed a -end AllProj - -section projCylinder - -/-- Given a countable family of closed cylinders, consider one of them as depending only on -the countably many coordinates that appear in all of them. -/ -def projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : - Set (∀ i : allProj hs, α i) := - (fun (f : ∀ i : allProj hs, α i) (i : Js (hs n)) ↦ f ⟨i, subset_allProj hs _ i.2⟩) ⁻¹' (As (hs n)) - -lemma mem_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) - (x : ∀ i : allProj hs, α i) : - x ∈ projCylinder hs n ↔ (fun (i : Js (hs n)) ↦ x ⟨i, subset_allProj hs _ i.2⟩) ∈ As (hs n) := by - simp only [projCylinder, mem_preimage] - -theorem preimage_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : - (fun (f : ∀ i, α i) (i : allProj hs) ↦ f i) ⁻¹' (projCylinder hs n) = s n := by - conv_rhs => rw [closedCompactCylinders.eq_cylinder (hs n)] - rfl - -lemma nonempty_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) - (n : ℕ) (hs_nonempty : (s n).Nonempty) : - (projCylinder hs n).Nonempty := by - rw [← preimage_projCylinder hs n] at hs_nonempty - exact nonempty_of_nonempty_preimage hs_nonempty - -lemma nonempty_projCylinder_iff [∀ i, Nonempty (α i)] - (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : - (projCylinder hs n).Nonempty ↔ (s n).Nonempty := by - refine ⟨fun h ↦ ?_, nonempty_projCylinder hs n⟩ - obtain ⟨x, hx⟩ := h - rw [mem_projCylinder] at hx - rw [closedCompactCylinders.eq_cylinder (hs n), MeasureTheory.cylinder] - refine Set.Nonempty.preimage ?_ ?_ - · exact ⟨_, hx⟩ - · intro y - let x := (inferInstance : Nonempty (∀ i, α i)).some - classical - refine ⟨fun i ↦ if hi : i ∈ Js (hs n) then y ⟨i, hi⟩ else x i, ?_⟩ - ext i - simp only [Finset.restrict_def, Finset.coe_mem, dite_true] - -theorem isClosed_projCylinder - (hs : ∀ n, s n ∈ closedCompactCylinders α) (hs_closed : ∀ n, IsClosed (As (hs n))) (n : ℕ) : - IsClosed (projCylinder hs n) := - (hs_closed n).preimage (by exact continuous_pi (fun i ↦ continuous_apply _)) - -end projCylinder - -section piCylinderSet - -open Classical in -/-- Given countably many closed compact cylinders, the product set which, in each relevant -coordinate, is the projection of the first cylinder for which this coordinate is relevant. -/ -def piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : - Set (∀ i : allProj hs, α i) := - {x : ∀ i : allProj hs, α i | - ∀ i, x i ∈ (fun a : ∀ j : Js (hs (indexProj hs i)), α j ↦ a ⟨i, mem_indexProj hs i⟩) '' - (As (hs (indexProj hs i)))} - -lemma mem_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) - (x : ∀ i : allProj hs, α i) : - x ∈ piCylinderSet hs ↔ - ∀ i, x i ∈ (fun a : ∀ j : Js (hs (indexProj hs i)), α j ↦ a ⟨i, mem_indexProj hs i⟩) '' - (As (hs (indexProj hs i))) := by - simp only [piCylinderSet, mem_image, Subtype.forall, mem_setOf_eq] - -theorem isCompact_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : - IsCompact (piCylinderSet hs) := - isCompact_pi_infinite fun _ ↦ - (closedCompactCylinders.isCompact (hs _)).image (continuous_apply _) - -theorem piCylinderSet_eq_pi_univ (hs : ∀ n, s n ∈ closedCompactCylinders α) : - piCylinderSet hs = - pi univ fun i ↦ - (fun a : ∀ j : Js (hs (indexProj hs i)), α j ↦ a ⟨i, mem_indexProj hs i⟩) '' - (As (hs (indexProj hs i))) := by - ext; simp only [piCylinderSet, mem_univ_pi]; rfl - -theorem isClosed_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : - IsClosed (piCylinderSet hs) := by - rw [piCylinderSet_eq_pi_univ] - exact isClosed_set_pi fun i _ ↦ IsClosed.isClosed_image_restrict_singleton _ - (closedCompactCylinders.isCompact (hs _)) (closedCompactCylinders.isClosed (hs _)) - -theorem nonempty_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) - (hs_nonempty : ∀ i, (s i).Nonempty) : - (piCylinderSet hs).Nonempty := by - have hs_nonempty' i : (As (hs i)).Nonempty := by - specialize hs_nonempty i - rw [closedCompactCylinders.eq_cylinder (hs i)] at hs_nonempty - exact nonempty_of_nonempty_preimage hs_nonempty - let b i := (hs_nonempty' (indexProj hs i)).some - have hb_mem i : b i ∈ As (hs (indexProj hs i)) := (hs_nonempty' (indexProj hs i)).choose_spec - let a : ∀ i : allProj hs, α i := fun i ↦ b i ⟨i, mem_indexProj hs i⟩ - refine ⟨a, ?_⟩ - simp only [piCylinderSet, mem_image, SetCoe.forall, mem_setOf_eq] - exact fun j hj ↦ ⟨b ⟨j, hj⟩, hb_mem _, rfl⟩ - -end piCylinderSet - -theorem iInter_subset_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : - (⋂ n, projCylinder hs n) ⊆ piCylinderSet hs := by - intro x hx - rw [mem_iInter] at hx - rw [mem_piCylinderSet] - intro i - specialize hx (indexProj hs i) - rw [mem_projCylinder] at hx - exact ⟨fun i : Js (hs (indexProj hs i)) ↦ x ⟨i, subset_allProj hs _ i.2⟩, hx, rfl⟩ - -theorem nonempty_iInter_projCylinder_inter_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) - (hs_nonempty : ∀ i, (s i).Nonempty) - (h_nonempty : ∀ n, (⋂ i ≤ n, projCylinder hs i).Nonempty) (n : ℕ) : - ((⋂ i ≤ n, projCylinder hs i) ∩ piCylinderSet hs).Nonempty := by - obtain ⟨x, hx⟩ := nonempty_piCylinderSet hs hs_nonempty - obtain ⟨y, hy⟩ := h_nonempty n - let z := fun i : allProj hs ↦ if indexProj hs i ≤ n then y i else x i - refine ⟨z, mem_inter ?_ ?_⟩ - · simp only [mem_iInter, mem_projCylinder] - intro i hi - have : (fun j : Js (hs i) ↦ - ite (indexProj hs ⟨j, subset_allProj hs i j.2⟩ ≤ n) (y ⟨j, subset_allProj hs i j.2⟩) - (x ⟨j, subset_allProj hs i j.2⟩)) = - fun j : Js (hs i) ↦ y ⟨j, subset_allProj hs i j.2⟩ := by - ext j - rw [if_pos] - refine le_trans (le_of_eq ?_) ((indexProj_le hs i j).trans hi) - congr - rw [this] - have hyi : y ∈ projCylinder hs i := by - suffices ⋂ j ≤ n, projCylinder hs j ⊆ projCylinder hs i by exact this hy - exact biInter_subset_of_mem hi - rwa [mem_projCylinder] at hyi - · rw [mem_piCylinderSet] - intro i - by_cases hi_le : indexProj hs i ≤ n - · let m := indexProj hs i - have hy' : y ∈ projCylinder hs m := by - suffices ⋂ j ≤ n, projCylinder hs j ⊆ projCylinder hs m by exact this hy - exact biInter_subset_of_mem hi_le - rw [mem_projCylinder] at hy' - refine ⟨fun j ↦ y ⟨j, subset_allProj hs _ j.2⟩, hy', ?_⟩ - simp_rw [z, if_pos hi_le] - · rw [mem_piCylinderSet] at hx - specialize hx i - obtain ⟨x', hx'_mem, hx'_eq⟩ := hx - refine ⟨x', hx'_mem, ?_⟩ - simp_rw [z, if_neg hi_le] - exact hx'_eq - -theorem nonempty_iInter_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) - (hs_nonempty : ∀ i, (s i).Nonempty) - (h_nonempty : ∀ n, (⋂ i ≤ n, projCylinder hs i).Nonempty) : - (⋂ i, projCylinder hs i).Nonempty := by - suffices ((⋂ i, projCylinder hs i) ∩ piCylinderSet hs).Nonempty by - rwa [inter_eq_left.mpr (iInter_subset_piCylinderSet hs)] at this - have : (⋂ n, projCylinder hs n) = (⋂ n, ⋂ i ≤ n, projCylinder hs i) := by - ext x - simp only [mem_iInter] - exact ⟨fun h i j _ ↦ h j, fun h i ↦ h i i le_rfl⟩ - rw [this, iInter_inter] - have h_closed : ∀ n, IsClosed (⋂ i ≤ n, projCylinder hs i) := - fun n ↦ isClosed_biInter (fun i _ ↦ isClosed_projCylinder hs - (fun n ↦ (closedCompactCylinders.isClosed (hs n))) i) - refine IsCompact.nonempty_iInter_of_sequence_nonempty_isCompact_isClosed - (fun n ↦ (⋂ i ≤ n, projCylinder hs i) ∩ piCylinderSet hs) ?_ ?_ ?_ ?_ - · refine fun i ↦ inter_subset_inter ?_ subset_rfl - simp_rw [Set.biInter_le_succ] - exact inter_subset_left - · exact fun n ↦ nonempty_iInter_projCylinder_inter_piCylinderSet hs hs_nonempty h_nonempty n - · exact (isCompact_piCylinderSet hs).inter_left (h_closed _) - · exact fun n ↦ IsClosed.inter (h_closed n) (isClosed_piCylinderSet hs) - -lemma exists_finset_iInter_projCylinder_eq_empty [∀ i, Nonempty (α i)] - (hs : ∀ n, s n ∈ closedCompactCylinders α) (h : ⋂ n, projCylinder hs n = ∅) : - ∃ t : Finset ℕ, (⋂ i ∈ t, projCylinder hs i) = ∅ := by - by_contra! h_nonempty - refine absurd h (Set.Nonempty.ne_empty ?_) - refine nonempty_iInter_projCylinder hs (fun i ↦ ?_) (fun n ↦ ?_) - · specialize h_nonempty {i} - simp only [Finset.mem_singleton, iInter_iInter_eq_left, ne_eq] at h_nonempty - rwa [nonempty_projCylinder_iff] at h_nonempty - · specialize h_nonempty (Finset.range (n + 1)) - simp only [Finset.mem_range, ne_eq, Nat.lt_succ_iff] at h_nonempty - exact h_nonempty - -/-- The `closedCompactCylinders` are a compact system. -/ -theorem isCompactSystem_closedCompactCylinders : IsCompactSystem (closedCompactCylinders α) := by - intro s hs h - by_cases hα : ∀ i, Nonempty (α i) - swap; · exact ⟨∅, by simpa [not_nonempty_iff] using hα⟩ - have h' : ⋂ n, projCylinder hs n = ∅ := by - simp_rw [← preimage_projCylinder hs, ← preimage_iInter] at h - have h_surj : Function.Surjective (fun (f : (∀ i, α i)) (i : allProj hs) ↦ f (i : ι)) := - surjective_proj_allProj hs - rwa [← not_nonempty_iff_eq_empty, ← Function.Surjective.nonempty_preimage h_surj, - not_nonempty_iff_eq_empty] - obtain ⟨t, ht⟩ := exists_finset_iInter_projCylinder_eq_empty hs h' - refine ⟨t, ?_⟩ - simp_rw [← preimage_projCylinder hs, ← preimage_iInter₂, ht, preimage_empty] - -end ClosedCompactCylinders --/ +end ClosedCompact From a3bda975a45fbf5b63713d550b4abac042b031a7 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sat, 8 Mar 2025 22:17:12 +0100 Subject: [PATCH 016/129] merge master --- .../Topology/Compactness/CompactSystem.lean | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index bae79df4393bf8..0c6b64c689b12d 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -27,28 +27,32 @@ This files defines compact systems of sets. open Set Finset Nat -section definition - variable {α : Type*} {p : Set α → Prop} {C : ℕ → Set α} +section definition + /-- A set of sets is a compact system if, whenever a countable subfamily has empty intersection, then finitely many of them already have empty intersection. -/ def IsCompactSystem (p : Set α → Prop) : Prop := ∀ C : ℕ → Set α, (∀ i, p (C i)) → ⋂ i, C i = ∅ → ∃ (n : ℕ), Dissipate C n = ∅ +end definition + +namespace IsCompactSystem + /-- In a compact system, given a countable family with empty intersection, we choose a finite -subfamily with empty intersection-/ +subfamily with empty intersection. -/ noncomputable -def IsCompactSystem.max_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) +def max_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) (hC_empty : ⋂ i, C i = ∅) : ℕ := (hp C hC hC_empty).choose -lemma IsCompactSystem.iInter_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) +lemma iInter_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) (hC_empty : ⋂ i, C i = ∅) : Dissipate C (hp.max_of_empty hC hC_empty) = ∅ := (hp C hC hC_empty).choose_spec -theorem IsCompactSystem.iff_of_nempty (p : Set α → Prop) : +theorem iff_of_nempty (p : Set α → Prop) : IsCompactSystem p ↔ (∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ (n : ℕ), (Dissipate C n).Nonempty) → (⋂ i, C i).Nonempty) := by refine ⟨fun h C hC hn ↦ ?_, fun h C hC ↦ ?_⟩ <;> have h2 := not_imp_not.mpr <| h C hC @@ -57,7 +61,7 @@ theorem IsCompactSystem.iff_of_nempty (p : Set α → Prop) : · push_neg at h2 exact h2 -theorem IsCompactSystem.iff_directed (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : +theorem iff_directed (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : (IsCompactSystem p) ↔ (∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → ⋂ i, C i = ∅ → ∃ (n : ℕ), C n = ∅) := by @@ -67,7 +71,7 @@ theorem IsCompactSystem.iff_directed (hpi : ∀ (s t : Set α), p s → p t → · rw [← biInter_le_eq_iInter] at h2 exact h (Dissipate C) dissipate_directed (dissipate_of_piSystem hpi h1) h2 -theorem IsCompactSystem.iff_directed' (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : +theorem iff_directed' (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : (IsCompactSystem p) ↔ ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → (∀ (n : ℕ), (C n).Nonempty) → (⋂ i, C i).Nonempty := by @@ -76,7 +80,7 @@ theorem IsCompactSystem.iff_directed' (hpi : ∀ (s t : Set α), p s → p t → · exact h1 C h3 h4 · exact h1 C h3 s -end definition +end IsCompactSystem section ClosedCompact From 6f2c2137c32da1e29457917a4653a77474aef665 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Tue, 11 Mar 2025 22:29:15 +0100 Subject: [PATCH 017/129] added or univ --- .../Topology/Compactness/CompactSystem.lean | 84 ++++++++++++++----- 1 file changed, 62 insertions(+), 22 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 0c6b64c689b12d..122bcf8e565282 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -21,8 +21,7 @@ This files defines compact systems of sets. * `IsClosedCompact.isCompactSystem`: The set of closed and compact sets is a compact system. * `IsClosedCompact.isCompactSystem_of_T2Space`: In a `T2Space α`, the set of compact sets - is a compact system. - + is a compact system in a `T2Space`. -/ open Set Finset Nat @@ -80,37 +79,78 @@ theorem iff_directed' (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : · exact h1 C h3 h4 · exact h1 C h3 s -end IsCompactSystem +/-- Any subset of a compact system is a compact system. -/ +theorem of_supset {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : + IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs + section ClosedCompact -/-- The set of compact and closed sets is a compact system. -/ -theorem IsClosedCompact.isCompactSystem {α : Type*} [TopologicalSpace α] : - IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by - have h : IsPiSystem ({ s : Set α | IsCompact s ∧ IsClosed s}) := by - intro x hx y hy _ - exact ⟨IsCompact.inter_left hy.1 hx.2, IsClosed.inter hx.2 hy.2 ⟩ - have h1 : ∅ ∈ {s : Set α| IsCompact s ∧ IsClosed s} := by - exact ⟨isCompact_empty, isClosed_empty⟩ - have h2 : ∀ (s t : Set α), IsCompact s ∧ IsClosed s → - IsCompact t ∧ IsClosed t → IsCompact (s ∩ t) ∧ IsClosed (s ∩ t) := - fun s t h1 h2 ↦ ⟨IsCompact.inter_right h1.1 h2.2, IsClosed.inter h1.2 h2.2⟩ - rw [IsPiSystem.iff_of_empty_mem _ h1] at h +/-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ +theorem of_isClosedCompactOrUniv {α : Type*} [TopologicalSpace α] : + IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by + let p := fun (s : Set α) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ) + have h2 : ∀ (s t : Set α), p s → p t → p (s ∩ t) := by + intro s t hs ht + by_cases hs' : s = univ + · rw [hs', univ_inter] + exact ht + · by_cases ht' : t = univ + · rw [ht', inter_comm, univ_inter] + exact hs + · exact Or.inl <| ⟨IsCompact.inter_right (Or.resolve_right hs hs').1 + (Or.resolve_right ht ht').2, IsClosed.inter (Or.resolve_right hs hs').2 + (Or.resolve_right ht ht').2⟩ rw [IsCompactSystem.iff_directed' h2] - exact fun s hs h1 h2 ↦ IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed s hs h2 - (fun i ↦ (h1 i).1) (fun i ↦ (h1 i).2) + intro s hs h1 h2 + let s' := fun (i : { j : ℕ | s j ≠ univ}) ↦ s i + have hs' : Directed (fun x1 x2 ↦ x1 ⊇ x2) s' := by + intro a b + obtain ⟨z, hz1, hz2⟩ := hs a.val b.val + have hz : s z ≠ univ := fun h ↦ a.prop <| eq_univ_of_subset hz1 h + use ⟨z, hz⟩ + have htcl : ∀ (i : { j : ℕ | s j ≠ univ}), IsClosed (s i) := + fun i ↦ (Or.resolve_right (h1 i.val) i.prop).2 + have htco : ∀ (i : { j : ℕ | s j ≠ univ}), IsCompact (s i) := + fun i ↦ (Or.resolve_right (h1 i.val) i.prop).1 + haveI f : Nonempty α := by + apply nonempty_of_exists _ + · exact fun x ↦ x ∈ s 0 + · exact h2 0 + by_cases h : Nonempty ↑{j | s j ≠ Set.univ} + · have g : (⋂ i, s' i).Nonempty → (⋂ i, s i).Nonempty := by + rw [Set.nonempty_iInter, Set.nonempty_iInter] + rintro ⟨x, hx⟩ + use x + intro i + by_cases g : s i ≠ univ + · exact hx ⟨i, g⟩ + · simp only [ne_eq, not_not, s'] at g + rw [g] + simp only [Set.mem_univ] + apply g <| IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed s' hs' + (fun j ↦ h2 j) htco htcl + · simp only [ne_eq, coe_setOf, nonempty_subtype, not_exists, not_not, s'] at h + simp only [nonempty_iInter, s', h] + simp only [Set.mem_univ, implies_true, exists_const, s'] -theorem IsCompact.isCompactSystem {α : Type*} [TopologicalSpace α] +/-- The set of compact and closed sets is a compact system. -/ +theorem of_isClosedCompact {α : Type*} [TopologicalSpace α] : + IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := + IsCompactSystem.of_supset of_isClosedCompactOrUniv (fun _ hs ↦ Or.inl hs) + +theorem of_isCompact {α : Type*} [TopologicalSpace α] (h : ∀ {s : Set α}, IsCompact s → IsClosed s) : IsCompactSystem (fun s : Set α ↦ IsCompact s) := by have h : (fun s : Set α ↦ IsCompact s) = (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by ext s refine ⟨fun h' ↦ ⟨h', h h'⟩, fun h' ↦ h'.1⟩ - exact h ▸ IsClosedCompact.isCompactSystem + exact h ▸ of_isClosedCompact /-- In a `T2Space` The set of compact sets is a compact system. -/ -theorem IsCompact.isCompactSystem_of_T2Space {α : Type*} [TopologicalSpace α] [T2Space α] : - IsCompactSystem (fun s : Set α ↦ IsCompact s) := - IsCompact.isCompactSystem fun {_} a ↦ isClosed a +theorem _of_isCompact_of_T2Space {α : Type*} [TopologicalSpace α] [T2Space α] : + IsCompactSystem (fun s : Set α ↦ IsCompact s) := of_isCompact (fun hs ↦ hs.isClosed) end ClosedCompact + +end IsCompactSystem From 8190e49822ce8c6f0a740481876e22c56a89c5e4 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Wed, 19 Mar 2025 22:57:19 +0100 Subject: [PATCH 018/129] in line with pfaffelh_compactSystem2 --- Mathlib/Topology/Compactness/CompactSystem.lean | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 122bcf8e565282..cefdde851d2789 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -86,8 +86,10 @@ theorem of_supset {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ section ClosedCompact +variable (α : Type*) [TopologicalSpace α] + /-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ -theorem of_isClosedCompactOrUniv {α : Type*} [TopologicalSpace α] : +theorem isClosedCompactOrUnivs : IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by let p := fun (s : Set α) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ) have h2 : ∀ (s t : Set α), p s → p t → p (s ∩ t) := by @@ -135,21 +137,20 @@ theorem of_isClosedCompactOrUniv {α : Type*} [TopologicalSpace α] : simp only [Set.mem_univ, implies_true, exists_const, s'] /-- The set of compact and closed sets is a compact system. -/ -theorem of_isClosedCompact {α : Type*} [TopologicalSpace α] : +theorem isClosedCompacts : IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := - IsCompactSystem.of_supset of_isClosedCompactOrUniv (fun _ hs ↦ Or.inl hs) + IsCompactSystem.of_supset (isClosedCompactOrUnivs α) (fun _ hs ↦ Or.inl hs) -theorem of_isCompact {α : Type*} [TopologicalSpace α] - (h : ∀ {s : Set α}, IsCompact s → IsClosed s) : +theorem isCompacts (h : ∀ {s : Set α}, IsCompact s → IsClosed s) : IsCompactSystem (fun s : Set α ↦ IsCompact s) := by have h : (fun s : Set α ↦ IsCompact s) = (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by ext s refine ⟨fun h' ↦ ⟨h', h h'⟩, fun h' ↦ h'.1⟩ - exact h ▸ of_isClosedCompact + exact h ▸ (isClosedCompacts α) /-- In a `T2Space` The set of compact sets is a compact system. -/ -theorem _of_isCompact_of_T2Space {α : Type*} [TopologicalSpace α] [T2Space α] : - IsCompactSystem (fun s : Set α ↦ IsCompact s) := of_isCompact (fun hs ↦ hs.isClosed) +theorem _of_isCompact_of_T2Space [T2Space α] : + IsCompactSystem (fun s : Set α ↦ IsCompact s) := (isCompacts α) (fun hs ↦ hs.isClosed) end ClosedCompact From 3205d8115078ac65564a7894f73db589760fee54 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Wed, 30 Apr 2025 22:44:11 +0200 Subject: [PATCH 019/129] added iff --- .../Topology/Compactness/CompactSystem.lean | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index cefdde851d2789..eb069a20e22b28 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -39,6 +39,36 @@ end definition namespace IsCompactSystem +lemma iff (p : Set α → Prop) : IsCompactSystem p ↔ + ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ n, ⋂ k < n, C k ≠ ∅) → ⋂ i, C i ≠ ∅ := by + refine ⟨fun h C hi ↦ ?_, fun h C hi ↦ ?_⟩ + · rw [← not_imp_not] + push_neg + intro h' + specialize h C hi h' + obtain ⟨n, hn⟩ := h + use n + 1 + rw [Dissipate] at hn + conv => + lhs + enter [1] + intro j + rw [Nat.lt_add_one_iff] + exact hn + · rw [← not_imp_not] + push_neg + simp_rw [nonempty_iff_ne_empty] + intro h' + apply h C hi + intro n hn + apply h' n + rw [← subset_empty_iff] at hn ⊢ + apply le_trans _ hn + rw [Dissipate] + intro x + rw [mem_iInter₂, mem_iInter₂] + exact fun h i hi ↦ h i hi.le + /-- In a compact system, given a countable family with empty intersection, we choose a finite subfamily with empty intersection. -/ noncomputable From 844cb213c2f63218042526f9844d9d5146922077 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Wed, 30 Apr 2025 23:41:16 +0200 Subject: [PATCH 020/129] n --- Mathlib/Data/Set/Dissipate.lean | 4 ++ .../Topology/Compactness/CompactSystem.lean | 51 ++++++++----------- 2 files changed, 24 insertions(+), 31 deletions(-) diff --git a/Mathlib/Data/Set/Dissipate.lean b/Mathlib/Data/Set/Dissipate.lean index 403c6a14de6fd2..a618d5bd00d977 100644 --- a/Mathlib/Data/Set/Dissipate.lean +++ b/Mathlib/Data/Set/Dissipate.lean @@ -23,6 +23,10 @@ def Dissipate [LE α] (s : α → Set β) (x : α) : Set β := @[simp] theorem dissipate_def [LE α] {x : α} : Dissipate s x = ⋂ y ≤ x, s y := rfl +theorem dissipate_eq {s : ℕ → Set β} {n : ℕ} : Dissipate s n = ⋂ k < n + 1, s k := by + simp_rw [Nat.lt_add_one_iff] + rfl + @[simp] theorem mem_dissipate [LE α] {x : α} {z : β} : z ∈ Dissipate s x ↔ ∀ y ≤ x, z ∈ s y := by simp_rw [dissipate_def, mem_iInter₂] diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index eb069a20e22b28..5ab095b4cd49d4 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -1,5 +1,5 @@ /- -Copyright (c) 2023 Rémy Degenne. All rights reserved. +Copyright (c) 2025 Peter Pfaffelhuber. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ @@ -39,36 +39,6 @@ end definition namespace IsCompactSystem -lemma iff (p : Set α → Prop) : IsCompactSystem p ↔ - ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ n, ⋂ k < n, C k ≠ ∅) → ⋂ i, C i ≠ ∅ := by - refine ⟨fun h C hi ↦ ?_, fun h C hi ↦ ?_⟩ - · rw [← not_imp_not] - push_neg - intro h' - specialize h C hi h' - obtain ⟨n, hn⟩ := h - use n + 1 - rw [Dissipate] at hn - conv => - lhs - enter [1] - intro j - rw [Nat.lt_add_one_iff] - exact hn - · rw [← not_imp_not] - push_neg - simp_rw [nonempty_iff_ne_empty] - intro h' - apply h C hi - intro n hn - apply h' n - rw [← subset_empty_iff] at hn ⊢ - apply le_trans _ hn - rw [Dissipate] - intro x - rw [mem_iInter₂, mem_iInter₂] - exact fun h i hi ↦ h i hi.le - /-- In a compact system, given a countable family with empty intersection, we choose a finite subfamily with empty intersection. -/ noncomputable @@ -90,6 +60,25 @@ theorem iff_of_nempty (p : Set α → Prop) : · push_neg at h2 exact h2 +/-- In this equivalent formulation for a compact system, +note that we use `⋂ k < n, C k` rather than `⋂ k ≤ n, C k`. -/ +lemma iff_of_not_empty (p : Set α → Prop) : IsCompactSystem p ↔ + ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ n, ⋂ k < n, C k ≠ ∅) → ⋂ i, C i ≠ ∅ := by + simp_rw [← Set.nonempty_iff_ne_empty, iff_of_nempty] + refine ⟨fun h C hi h'↦ ?_, fun h C hi h' ↦ ?_⟩ + · apply h C hi + exact fun n ↦ dissipate_eq ▸ (h' (n + 1)) + · apply h C hi + intro n + simp_rw [Set.nonempty_iff_ne_empty] at h' ⊢ + intro g + apply h' n + simp_rw [← subset_empty_iff, Dissipate] at g ⊢ + apply le_trans _ g + intro x + rw [mem_iInter₂, mem_iInter₂] + exact fun h i hi ↦ h i hi.le + theorem iff_directed (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : (IsCompactSystem p) ↔ (∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → From a67e4eb0c04b6a4e1193355fefb07fc3e0280573 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 2 May 2025 08:14:21 +0200 Subject: [PATCH 021/129] update Mathlib --- Mathlib.lean | 2 ++ Mathlib/Topology/Compactness/CompactSystem.lean | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index 13a9a9ff188c03..13130296909e6a 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -3519,6 +3519,7 @@ import Mathlib.Data.Set.Constructions import Mathlib.Data.Set.Countable import Mathlib.Data.Set.Defs import Mathlib.Data.Set.Disjoint +import Mathlib.Data.Set.Dissipate import Mathlib.Data.Set.Enumerate import Mathlib.Data.Set.Equitable import Mathlib.Data.Set.Finite.Basic @@ -6374,6 +6375,7 @@ import Mathlib.Topology.Compactness.Bases import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.Compactness.CompactlyCoherentSpace import Mathlib.Topology.Compactness.CompactlyGeneratedSpace +import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.DeltaGeneratedSpace import Mathlib.Topology.Compactness.Exterior import Mathlib.Topology.Compactness.HilbertCubeEmbedding diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 5ab095b4cd49d4..9722c003f2e701 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -102,7 +102,6 @@ theorem iff_directed' (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : theorem of_supset {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs - section ClosedCompact variable (α : Type*) [TopologicalSpace α] From 9f26984e8fb455aa07cbdb094a0f5cd797558f9e Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 2 May 2025 09:29:05 +0200 Subject: [PATCH 022/129] linters dissipate --- Mathlib/Data/Set/Dissipate.lean | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/Mathlib/Data/Set/Dissipate.lean b/Mathlib/Data/Set/Dissipate.lean index a618d5bd00d977..da1a03f4593fc5 100644 --- a/Mathlib/Data/Set/Dissipate.lean +++ b/Mathlib/Data/Set/Dissipate.lean @@ -27,9 +27,8 @@ theorem dissipate_eq {s : ℕ → Set β} {n : ℕ} : Dissipate s n = ⋂ k < n simp_rw [Nat.lt_add_one_iff] rfl -@[simp] theorem mem_dissipate [LE α] {x : α} {z : β} : z ∈ Dissipate s x ↔ ∀ y ≤ x, z ∈ s y := by - simp_rw [dissipate_def, mem_iInter₂] + simp only [dissipate_def, mem_iInter] theorem dissipate_subset [Preorder α] {x y : α} (hy : y ≤ x): Dissipate s x ⊆ s y := biInter_subset_of_mem hy @@ -46,7 +45,6 @@ theorem dissipate_subset_dissipate [Preorder α] {x y} (h : y ≤ x) : Dissipate s x ⊆ Dissipate s y := antitone_dissipate h -@[simp] theorem biInter_dissipate [Preorder α] {s : α → Set β} {x : α} : ⋂ y ≤ x, s y = ⋂ y ≤ x, ⋂ z ≤ y, s z := by apply Subset.antisymm @@ -61,15 +59,14 @@ theorem iInter_dissipate [Preorder α] : ⋂ x, s x = ⋂ x, Dissipate s x := by · exact fun z h x' y hy ↦ h y · exact fun z h x' ↦ h x' x' (le_refl x') -@[simp] lemma dissipate_bot [PartialOrder α] [OrderBot α] (s : α → Set β) : Dissipate s ⊥ = s ⊥ := by - simp [Set.dissipate_def] + simp only [dissipate_def, le_bot_iff, iInter_iInter_eq_left] open Nat @[simp] theorem dissipate_succ (s : ℕ → Set α) (n : ℕ) : - Dissipate s (n + 1) = Dissipate s n ∩ s (n + 1) := by + ⋂ y, ⋂ (_ : y ≤ n + 1), s y = Dissipate s n ∩ s (n + 1) := by ext x refine ⟨fun hx ↦ ?_, fun hx ↦ ?_⟩ · simp only [mem_inter_iff, mem_iInter, Dissipate] at * @@ -82,7 +79,6 @@ theorem dissipate_succ (s : ℕ → Set α) (n : ℕ) : · simp only [not_le] at h exact le_antisymm hi h ▸ hx.2 -@[simp] lemma dissipate_zero (s : ℕ → Set β) : Dissipate s 0 = s 0 := by simp [dissipate_def] @@ -92,7 +88,7 @@ lemma subset_of_directed {s : ℕ → Set α} (hd : Directed (fun (x1 x2 : Set | zero => use 0; simp | succ n hn => obtain ⟨m, hm⟩ := hn - simp_rw [← dissipate_def, dissipate_succ] + simp_rw [dissipate_succ] obtain ⟨k, hk⟩ := hd m (n+1) simp at hk use k @@ -106,7 +102,7 @@ lemma empty_of_directed {s : ℕ → Set α} (hd : Directed (fun (x1 x2 : Set α · rw [hn'] exact Eq.trans (dissipate_zero s) (hn' ▸ hn) · obtain ⟨k, hk⟩ := exists_eq_succ_of_ne_zero hn' - rw [hk, dissipate_succ, ← succ_eq_add_one, ← hk, hn, Set.inter_empty] + rw [hk, dissipate_def, dissipate_succ, ← succ_eq_add_one, ← hk, hn, Set.inter_empty] · rw [← not_imp_not] push_neg intro h n @@ -124,7 +120,7 @@ lemma mem_subset_dissipate_of_directed (C : ℕ → Set α) | succ n hn => obtain ⟨m, hm⟩ := hn obtain ⟨k, hk⟩ := hd m (n+1) - simp_rw [dissipate_succ] + simp_rw [dissipate_def, dissipate_succ] simp at hk exact ⟨k, Set.subset_inter_iff.mpr <| ⟨le_trans hk.1 hm, hk.2⟩⟩ @@ -136,7 +132,7 @@ lemma dissipate_exists_empty_iff_of_directed (C : ℕ → Set α) · rw [hn', dissipate_zero] exact hn' ▸ hn · obtain ⟨k, hk⟩ := exists_eq_succ_of_ne_zero hn' - simp_rw [hk, succ_eq_add_one, dissipate_succ, + simp_rw [hk, succ_eq_add_one, dissipate_def, dissipate_succ, ← succ_eq_add_one, ← hk, hn, Set.inter_empty] · rw [← not_imp_not] push_neg @@ -154,7 +150,7 @@ lemma dissipate_of_piSystem {s : ℕ → Set α} {p : Set α → Prop} simp only [dissipate_def, le_zero_eq, iInter_iInter_eq_left] exact h 0 | succ n hn => - rw [dissipate_succ] + rw [dissipate_def, dissipate_succ] exact hp (Dissipate s n) (s (n+1)) hn (h (n+1)) end Set From bfaa04a897f66f8cd8017c899ebd54d64fef101b Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 2 May 2025 09:40:06 +0200 Subject: [PATCH 023/129] run mk_all --- Mathlib.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index 13130296909e6a..e997aea106842a 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6374,8 +6374,8 @@ import Mathlib.Topology.Compactification.StoneCech import Mathlib.Topology.Compactness.Bases import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.Compactness.CompactlyCoherentSpace -import Mathlib.Topology.Compactness.CompactlyGeneratedSpace import Mathlib.Topology.Compactness.CompactSystem +import Mathlib.Topology.Compactness.CompactlyGeneratedSpace import Mathlib.Topology.Compactness.DeltaGeneratedSpace import Mathlib.Topology.Compactness.Exterior import Mathlib.Topology.Compactness.HilbertCubeEmbedding From aae20eed2f9f7aa291706f13eda0c559d87b03d7 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 2 May 2025 09:49:32 +0200 Subject: [PATCH 024/129] min imports --- Mathlib/Topology/Compactness/CompactSystem.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 9722c003f2e701..7f458db4e0d27b 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -5,7 +5,6 @@ Authors: Rémy Degenne, Peter Pfaffelhuber -/ import Mathlib.Data.Set.Dissipate import Mathlib.Topology.Separation.Hausdorff -import Mathlib.MeasureTheory.PiSystem /-! # Compact systems. @@ -173,3 +172,5 @@ theorem _of_isCompact_of_T2Space [T2Space α] : end ClosedCompact end IsCompactSystem + +#min_imports From 5c9368bb5fe3339c4dae7635df6906be99a21760 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 2 May 2025 11:29:14 +0200 Subject: [PATCH 025/129] deleted hash --- Mathlib/Topology/Compactness/CompactSystem.lean | 2 -- 1 file changed, 2 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 7f458db4e0d27b..0ba8611fb79352 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -172,5 +172,3 @@ theorem _of_isCompact_of_T2Space [T2Space α] : end ClosedCompact end IsCompactSystem - -#min_imports From e3f6cd035f794b4ca5c3e5ffcfec648c51ec784a Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Thu, 22 May 2025 14:25:41 +0200 Subject: [PATCH 026/129] cs0 --- Mathlib/Data/Set/Accumulate.lean | 6 +- Mathlib/Data/Set/Dissipate.lean | 85 +++--- .../Topology/Compactness/CompactSystem.lean | 271 +++++++++++++++--- 3 files changed, 280 insertions(+), 82 deletions(-) diff --git a/Mathlib/Data/Set/Accumulate.lean b/Mathlib/Data/Set/Accumulate.lean index 64d874f0e99e64..731684192a4470 100644 --- a/Mathlib/Data/Set/Accumulate.lean +++ b/Mathlib/Data/Set/Accumulate.lean @@ -8,7 +8,11 @@ import Mathlib.Data.Set.Lattice /-! # Accumulate -The function `Accumulate` takes a set `s` and returns `⋃ y ≤ x, s y`. +The function `Accumulate` takes `s : α → Set β` with `LE α` and returns `⋃ y ≤ x, s y`. + +In large parts, this file is parallel to `Mathlib.Data.Set.Dissipate`, where +`Dissipate s := ⋂ y ≤ x, s y` is defined. + -/ diff --git a/Mathlib/Data/Set/Dissipate.lean b/Mathlib/Data/Set/Dissipate.lean index da1a03f4593fc5..d54b6af373c2be 100644 --- a/Mathlib/Data/Set/Dissipate.lean +++ b/Mathlib/Data/Set/Dissipate.lean @@ -5,13 +5,20 @@ Authors: Peter Pfaffelhuber -/ import Mathlib.Data.Set.Lattice import Mathlib.Order.Directed +import Mathlib.MeasureTheory.PiSystem /-! # Dissipate -The function `Dissipate` takes a set `s` and returns `⋂ y ≤ x, s y`. +The function `Dissipate` takes `s : α → Set β` with `LE α` and returns `⋂ y ≤ x, s y`. + +In large parts, this file is parallel to `Mathlib.Data.Set.Accumulate`, where +`Accumulate s := ⋃ y ≤ x, s y` is defined. + -/ +open Nat + variable {α β : Type*} {s : α → Set β} namespace Set @@ -30,7 +37,7 @@ theorem dissipate_eq {s : ℕ → Set β} {n : ℕ} : Dissipate s n = ⋂ k < n theorem mem_dissipate [LE α] {x : α} {z : β} : z ∈ Dissipate s x ↔ ∀ y ≤ x, z ∈ s y := by simp only [dissipate_def, mem_iInter] -theorem dissipate_subset [Preorder α] {x y : α} (hy : y ≤ x): Dissipate s x ⊆ s y := +theorem dissipate_subset [Preorder α] {x y : α} (hy : y ≤ x) : Dissipate s x ⊆ s y := biInter_subset_of_mem hy theorem dissipate_subset_iInter [Preorder α] (x : α) : ⋂ i, s i ⊆ Dissipate s x := by @@ -45,20 +52,23 @@ theorem dissipate_subset_dissipate [Preorder α] {x y} (h : y ≤ x) : Dissipate s x ⊆ Dissipate s y := antitone_dissipate h +@[simp] theorem biInter_dissipate [Preorder α] {s : α → Set β} {x : α} : - ⋂ y ≤ x, s y = ⋂ y ≤ x, ⋂ z ≤ y, s z := by + ⋂ y ≤ x, Dissipate s y = Dissipate s x := by apply Subset.antisymm - · simp only [subset_iInter_iff, Dissipate] - exact fun i hi z hz ↦ biInter_subset_of_mem <| le_trans hz hi · apply iInter_mono fun z y hy ↦ ?_ - simp only [mem_iInter] at * + simp only [dissipate_def, mem_iInter] at * exact fun h ↦ hy h z <| le_refl z + · simp only [subset_iInter_iff, Dissipate] + exact fun i hi z hz ↦ biInter_subset_of_mem <| le_trans hz hi -theorem iInter_dissipate [Preorder α] : ⋂ x, s x = ⋂ x, Dissipate s x := by +@[simp] +theorem iInter_dissipate [Preorder α] : ⋂ x, Dissipate s x = ⋂ x, s x := by apply Subset.antisymm <;> simp_rw [subset_def, mem_iInter, mem_dissipate] - · exact fun z h x' y hy ↦ h y · exact fun z h x' ↦ h x' x' (le_refl x') + · exact fun z h x' y hy ↦ h y +@[simp] lemma dissipate_bot [PartialOrder α] [OrderBot α] (s : α → Set β) : Dissipate s ⊥ = s ⊥ := by simp only [dissipate_def, le_bot_iff, iInter_iInter_eq_left] @@ -66,7 +76,7 @@ open Nat @[simp] theorem dissipate_succ (s : ℕ → Set α) (n : ℕ) : - ⋂ y, ⋂ (_ : y ≤ n + 1), s y = Dissipate s n ∩ s (n + 1) := by + Dissipate s (n + 1) = Dissipate s n ∩ s (n + 1) := by ext x refine ⟨fun hx ↦ ?_, fun hx ↦ ?_⟩ · simp only [mem_inter_iff, mem_iInter, Dissipate] at * @@ -79,11 +89,12 @@ theorem dissipate_succ (s : ℕ → Set α) (n : ℕ) : · simp only [not_le] at h exact le_antisymm hi h ▸ hx.2 +@[simp] lemma dissipate_zero (s : ℕ → Set β) : Dissipate s 0 = s 0 := by simp [dissipate_def] -lemma subset_of_directed {s : ℕ → Set α} (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) s) - (n : ℕ) : ∃ m, ⋂ i ≤ n, s i ⊇ s m := by +lemma exists_subset_dissipate_of_directed {s : ℕ → Set α} + (hd : Directed (fun (x1 x2 : Set α) => x2 ⊆ x1) s) (n : ℕ) : ∃ m, s m ⊆ Dissipate s n := by induction n with | zero => use 0; simp | succ n hn => @@ -95,62 +106,52 @@ lemma subset_of_directed {s : ℕ → Set α} (hd : Directed (fun (x1 x2 : Set simp only [subset_inter_iff] exact ⟨le_trans hk.1 hm, hk.2⟩ -lemma empty_of_directed {s : ℕ → Set α} (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) s) : - (∃ n, s n = ∅) ↔ (∃ n, Dissipate s n = ∅) := by - refine ⟨fun ⟨n, hn⟩ ↦ ⟨n, ?_⟩, ?_⟩ - · by_cases hn' : n = 0 - · rw [hn'] - exact Eq.trans (dissipate_zero s) (hn' ▸ hn) - · obtain ⟨k, hk⟩ := exists_eq_succ_of_ne_zero hn' - rw [hk, dissipate_def, dissipate_succ, ← succ_eq_add_one, ← hk, hn, Set.inter_empty] +lemma exists_dissipate_eq_empty_iff {s : ℕ → Set α} + (hd : Directed (fun (x1 x2 : Set α) => x2 ⊆ x1) s) : + (∃ n, Dissipate s n = ∅) ↔ (∃ n, s n = ∅) := by + refine ⟨?_, fun ⟨n, hn⟩ ↦ ⟨n, ?_⟩⟩ · rw [← not_imp_not] push_neg intro h n - obtain ⟨m, hm⟩ := subset_of_directed hd n + obtain ⟨m, hm⟩ := exists_subset_dissipate_of_directed hd n exact Set.Nonempty.mono hm (h m) + · by_cases hn' : n = 0 + · rw [hn'] + exact Eq.trans (dissipate_zero s) (hn' ▸ hn) + · obtain ⟨k, hk⟩ := exists_eq_add_one_of_ne_zero hn' + rw [hk, dissipate_succ, ← hk, hn, Set.inter_empty] -lemma dissipate_directed {s : ℕ → Set α} : - Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) (Dissipate s) := +lemma directed_dissipate {s : ℕ → Set α} : + Directed (fun (x1 x2 : Set α) => x2 ⊆ x1) (Dissipate s) := antitone_dissipate.directed_ge -lemma mem_subset_dissipate_of_directed (C : ℕ → Set α) - (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C) (n : ℕ) : ∃ m, Dissipate C n ⊇ C m := by - induction n with - | zero => use 0; simp - | succ n hn => - obtain ⟨m, hm⟩ := hn - obtain ⟨k, hk⟩ := hd m (n+1) - simp_rw [dissipate_def, dissipate_succ] - simp at hk - exact ⟨k, Set.subset_inter_iff.mpr <| ⟨le_trans hk.1 hm, hk.2⟩⟩ - -lemma dissipate_exists_empty_iff_of_directed (C : ℕ → Set α) - (hd : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C) : - (∃ n, C n = ∅) ↔ (∃ n, Dissipate C n = ∅) := by +lemma exists_dissipate_eq_empty_iff_of_directed (C : ℕ → Set α) + (hd : Directed (fun (x1 x2 : Set α) => x2 ⊆ x1) C) : + (∃ n, C n = ∅) ↔ (∃ n, Dissipate C n = ∅) := by refine ⟨fun ⟨n, hn⟩ ↦ ⟨n, ?_⟩ , ?_⟩ · by_cases hn' : n = 0 · rw [hn', dissipate_zero] exact hn' ▸ hn · obtain ⟨k, hk⟩ := exists_eq_succ_of_ne_zero hn' - simp_rw [hk, succ_eq_add_one, dissipate_def, dissipate_succ, + simp_rw [hk, succ_eq_add_one, dissipate_succ, ← succ_eq_add_one, ← hk, hn, Set.inter_empty] · rw [← not_imp_not] push_neg intro h n - obtain ⟨m, hm⟩ := mem_subset_dissipate_of_directed C hd n + obtain ⟨m, hm⟩ := exists_subset_dissipate_of_directed hd n exact Set.Nonempty.mono hm (h m) /-- For a ∩-stable attribute `p` on `Set α` and a sequence of sets `s` with this attribute, -`p ⋂ i ≤ n, s n` holds. -/ +`p (Dissipate s n)` holds. -/ lemma dissipate_of_piSystem {s : ℕ → Set α} {p : Set α → Prop} - (hp : ∀ (s t : Set α), p s → p t → p (s ∩ t)) (h : ∀ n, p (s n)) (n : ℕ) : + (hp : IsPiSystem p) (h : ∀ n, p (s n)) (n : ℕ) (h' : (Dissipate s n).Nonempty) : p (Dissipate s n) := by induction n with | zero => simp only [dissipate_def, le_zero_eq, iInter_iInter_eq_left] exact h 0 | succ n hn => - rw [dissipate_def, dissipate_succ] - exact hp (Dissipate s n) (s (n+1)) hn (h (n+1)) + rw [dissipate_succ] at * + apply hp (Dissipate s n) (hn (Nonempty.left h')) (s (n+1)) (h (n+1)) h' end Set diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 0ba8611fb79352..2fec7c63cf984f 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -38,19 +38,21 @@ end definition namespace IsCompactSystem -/-- In a compact system, given a countable family with empty intersection, we choose a finite -subfamily with empty intersection. -/ +open Classical in +/-- In a compact system, given a countable family with `⋂ i, C i = ∅`, we choose the smallest `n` +with `⋂ (i ≤ n), C i = ∅`. -/ noncomputable -def max_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) +def finite_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) (hC_empty : ⋂ i, C i = ∅) : ℕ := - (hp C hC hC_empty).choose + Nat.find (hp C hC hC_empty) -lemma iInter_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) +open Classical in +lemma dissipate_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) (hC_empty : ⋂ i, C i = ∅) : - Dissipate C (hp.max_of_empty hC hC_empty) = ∅ := - (hp C hC hC_empty).choose_spec + Dissipate C (hp.finite_of_empty hC hC_empty) = ∅ := by + apply Nat.find_spec (hp C hC hC_empty) -theorem iff_of_nempty (p : Set α → Prop) : +theorem iff_nonempty_iInter (p : Set α → Prop) : IsCompactSystem p ↔ (∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ (n : ℕ), (Dissipate C n).Nonempty) → (⋂ i, C i).Nonempty) := by refine ⟨fun h C hC hn ↦ ?_, fun h C hC ↦ ?_⟩ <;> have h2 := not_imp_not.mpr <| h C hC @@ -61,9 +63,9 @@ theorem iff_of_nempty (p : Set α → Prop) : /-- In this equivalent formulation for a compact system, note that we use `⋂ k < n, C k` rather than `⋂ k ≤ n, C k`. -/ -lemma iff_of_not_empty (p : Set α → Prop) : IsCompactSystem p ↔ - ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ n, ⋂ k < n, C k ≠ ∅) → ⋂ i, C i ≠ ∅ := by - simp_rw [← Set.nonempty_iff_ne_empty, iff_of_nempty] +lemma iff_nonempty_iInter_of_lt (p : Set α → Prop) : IsCompactSystem p ↔ + ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ n, (⋂ k < n, C k).Nonempty) → (⋂ i, C i).Nonempty := by + simp_rw [iff_nonempty_iInter] refine ⟨fun h C hi h'↦ ?_, fun h C hi h' ↦ ?_⟩ · apply h C hi exact fun n ↦ dissipate_eq ▸ (h' (n + 1)) @@ -78,18 +80,177 @@ lemma iff_of_not_empty (p : Set α → Prop) : IsCompactSystem p ↔ rw [mem_iInter₂, mem_iInter₂] exact fun h i hi ↦ h i hi.le -theorem iff_directed (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : - (IsCompactSystem p) ↔ - (∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → - ⋂ i, C i = ∅ → ∃ (n : ℕ), C n = ∅) := by +/-- Any subset of a compact system is a compact system. -/ +theorem mono {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : + IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs + +/-- A set system is a compact system iff adding `∅` gives a compact system. -/ +lemma iff_isCompactSystem_of_or_empty : IsCompactSystem p ↔ + IsCompactSystem (fun s ↦ (p s ∨ (s = ∅))) := by + refine ⟨fun h s h' hd ↦ ?_, fun h ↦ mono h (fun s ↦ fun a ↦ Or.symm (Or.inr a))⟩ + by_cases g : ∃ n, s n = ∅ + · use g.choose + rw [← subset_empty_iff] at hd ⊢ + exact le_trans (dissipate_subset (by rfl)) g.choose_spec.le + · push_neg at g + have hj (i : _) : p (s i) := by + rcases h' i with a | b + · exact a + · exfalso + revert g i + simp_rw [← Set.not_nonempty_iff_eq_empty] + simp_rw [imp_false, not_not] + exact fun h i ↦ h i + exact h s hj hd + +lemma of_IsEmpty (h : IsEmpty α) (p : Set α → Prop) : IsCompactSystem p := + fun s _ _ ↦ ⟨0, Set.eq_empty_of_isEmpty (Dissipate s 0)⟩ + +/-- A set system is a compact system iff adding `univ` gives a compact system. -/ +lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ + IsCompactSystem (fun s ↦ (p s ∨ (s = univ))) := by + refine ⟨fun h ↦ ?_, fun h ↦ mono h (fun s ↦ fun a ↦ Or.symm (Or.inr a))⟩ + wlog ht : Nonempty α + · rw [not_nonempty_iff] at ht + apply of_IsEmpty ht + · rw [iff_nonempty_iInter] at h ⊢ + intro s h' hd + classical + by_cases h₀ : ∀ n, ¬p (s n) + · have h₁ : ∀ n, s n = univ := by + intro n + simp only [h₀, false_or] at h' + exact h' n + simp_rw [h₁, iInter_univ, Set.univ_nonempty] + · push_neg at h₀ + let n := Nat.find h₀ + let s' := fun i ↦ if p (s i) then s i else s n + have h₁ : ∀ i, p (s' i) := by + intro i + by_cases h₁ : p (s i) + · have h₂ : s' i = s i := if_pos h₁ + exact h₂ ▸ h₁ + · have h₂ : s' i = s n := if_neg h₁ + exact h₂ ▸ (Nat.find_spec h₀) + have h₃ : ∀ i, (p (s i) → s' i = s i) := fun i h ↦ if_pos h + have h₄ : ∀ i, (¬p (s i) → s' i = s n) := fun i h ↦ if_neg h + have h₂ : ⋂ i, s i = ⋂ i, s' i := by + ext x + simp only [mem_iInter] + refine ⟨fun h i ↦ ?_, fun h i ↦ ?_⟩ + · by_cases h₅ : p (s i) + · exact (h₃ i h₅) ▸ h i + · exact (h₄ i h₅) ▸ h n + · have h₄ : s i = s' i ∨ s i = univ := by + rcases h' i with a | b + · exact Or.inl <| Eq.symm (if_pos a) + · exact Or.inr b + rcases h₄ with a | b + · exact a ▸ h i + · simp [b] + apply h₂ ▸ h s' h₁ + by_contra! a + obtain ⟨j, hj⟩ := a + have h₂ : ∀ (v : ℕ) (hv : n ≤ v), Dissipate s v = Dissipate s' v:= by + intro v hv + ext x + refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ <;> simp only [dissipate_def, mem_iInter] at h ⊢ <;> + intro i hi + · by_cases h₅ : p (s i) + · exact (h₃ i h₅) ▸ h i hi + · exact (h₄ i h₅) ▸ h n hv + · by_cases h₅ : p (s i) + · exact (h₃ i h₅) ▸ h i hi + · have h₆ : s i = univ := by + specialize h' i + simp only [h₅, false_or] at h' + exact h' + simp only [h₆, Set.mem_univ] + have h₇ : Dissipate s' (max j n) = ∅ := by + rw [← subset_empty_iff] at hj ⊢ + exact le_trans (antitone_dissipate (Nat.le_max_left j n)) hj + specialize h₂ (max j n) (Nat.le_max_right j n) + specialize hd (max j n) + rw [h₂, Set.nonempty_iff_ne_empty, h₇] at hd + exact hd rfl + +example (a b : Set α) (ha : a = ∅ ) : a ∩ b = ∅ := by + subst ha + simp_all only [Set.empty_inter] + +example (P Q : Prop) (hP : ¬P) (hPQ : P ∨ Q) : Q := by + simp_all only [false_or] + + +theorem isPiSystem.iff_isPiSystem_or_empty : IsPiSystem p ↔ IsPiSystem (fun s ↦ p s ∨ s = ∅) := by + refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ + · intro a ha b hb hab + rcases ha with ha₁ | ha₂ + · rcases hb with hb₁ | hb₂ + · left + exact hpi a ha₁ b hb₁ hab + · right + exact hb₂ ▸ (Set.inter_empty a) + · simp only [ha₂, Set.empty_inter] + right + rfl + · intro a ha b hb hab + simp [IsPiSystem] at h + specialize h a + by_cases ha : a = ∅ + · sorry + · + specialize h a (Or.inl ha) b (Or.inl hb) hab + by_cases ha : a = ∅ + · sorry + · + apply h a ha b hb hab + sorry + +theorem iff_directed (hpi : IsPiSystem p) : + IsCompactSystem p ↔ + ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → + ⋂ i, C i = ∅ → ∃ (n : ℕ), C n = ∅ := by + rw [iff_isCompactSystem_of_or_empty] refine ⟨fun h ↦ fun C hdi hi ↦ ?_, fun h C h1 h2 ↦ ?_⟩ - · rw [dissipate_exists_empty_iff_of_directed C hdi] - exact h C hi - · rw [← biInter_le_eq_iInter] at h2 - exact h (Dissipate C) dissipate_directed (dissipate_of_piSystem hpi h1) h2 + · rw [exists_dissipate_eq_empty_iff_of_directed C hdi] + apply h C + exact fun i ↦ Or.inl (hi i) + · have hpi' : IsPiSystem (fun s ↦ p s ∨ s = ∅) := by + intro a ha b hb hab + rcases ha with ha₁ | ha₂ + · rcases hb with hb₁ | hb₂ + · left + exact hpi a ha₁ b hb₁ hab + · right + exact hb₂ ▸ (Set.inter_empty a) + · simp only [ha₂, Set.empty_inter] + right + rfl + rw [← biInter_le_eq_iInter] at h2 + obtain h' := h (Dissipate C) directed_dissipate + have h₀ : (∀ (n : ℕ), p (Dissipate C n) ∨ Dissipate C n = ∅) → ⋂ n, Dissipate C n = ∅ → + ∃ n, Dissipate C n = ∅ := by + intro h₀ h₁ + by_cases f : ∀ n, p (Dissipate C n) + · apply h' f h₁ + · push_neg at f + obtain ⟨n, hn⟩ := f + use n + specialize h₀ n + simp_all only [false_or] + obtain h'' := dissipate_of_piSystem hpi' h1 + have h₁ : ∀ (n : ℕ), p (Dissipate C n) ∨ Dissipate C n = ∅ := by + intro n + by_cases g : (Dissipate C n).Nonempty + · exact h'' n g + · right + exact Set.not_nonempty_iff_eq_empty.mp g + apply h₀ h₁ h2 + -theorem iff_directed' (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : - (IsCompactSystem p) ↔ +theorem iff_directed' (hpi : IsPiSystem p) : + IsCompactSystem p ↔ ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → (∀ (n : ℕ), (C n).Nonempty) → (⋂ i, C i).Nonempty := by rw [IsCompactSystem.iff_directed hpi] @@ -97,16 +258,52 @@ theorem iff_directed' (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : · exact h1 C h3 h4 · exact h1 C h3 s -/-- Any subset of a compact system is a compact system. -/ -theorem of_supset {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : - IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs - -section ClosedCompact +section IsCompactIsClosed variable (α : Type*) [TopologicalSpace α] +/-- The set of compact and closed sets is a compact system. -/ +theorem of_isCompact_isClosed : + IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by + let p := fun (s : Set α) ↦ IsCompact s ∧ IsClosed s + have h2 : IsPiSystem p := by + intro s hs t ht _ + refine ⟨IsCompact.inter_left ht.1 hs.2, IsClosed.inter hs.2 ht.2⟩ + rw [IsCompactSystem.iff_directed' h2] + intro s hs h1 h2 + let s' := fun (i : { j : ℕ | s j ≠ univ}) ↦ s i + have hs' : Directed (fun x1 x2 ↦ x1 ⊇ x2) s' := by + intro a b + obtain ⟨z, hz1, hz2⟩ := hs a.val b.val + have hz : s z ≠ univ := fun h ↦ a.prop <| eq_univ_of_subset hz1 h + use ⟨z, hz⟩ + have htcl : ∀ (i : { j : ℕ | s j ≠ univ}), IsClosed (s i) := + fun i ↦ (Or.resolve_right (h1 i.val) i.prop).2 + have htco : ∀ (i : { j : ℕ | s j ≠ univ}), IsCompact (s i) := + fun i ↦ (Or.resolve_right (h1 i.val) i.prop).1 + haveI f : Nonempty α := by + apply nonempty_of_exists _ + · exact fun x ↦ x ∈ s 0 + · exact h2 0 + by_cases h : Nonempty ↑{j | s j ≠ Set.univ} + · have g : (⋂ i, s' i).Nonempty → (⋂ i, s i).Nonempty := by + rw [Set.nonempty_iInter, Set.nonempty_iInter] + rintro ⟨x, hx⟩ + use x + intro i + by_cases g : s i ≠ univ + · exact hx ⟨i, g⟩ + · simp only [ne_eq, not_not, s'] at g + rw [g] + simp only [Set.mem_univ] + apply g <| IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed s' hs' + (fun j ↦ h2 j) htco htcl + · simp only [ne_eq, coe_setOf, nonempty_subtype, not_exists, not_not, s'] at h + simp [s', h] + + /-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ -theorem isClosedCompactOrUnivs : +theorem of_isCompact_isClosed_or_univ : IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by let p := fun (s : Set α) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ) have h2 : ∀ (s t : Set α), p s → p t → p (s ∩ t) := by @@ -150,25 +347,21 @@ theorem isClosedCompactOrUnivs : apply g <| IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed s' hs' (fun j ↦ h2 j) htco htcl · simp only [ne_eq, coe_setOf, nonempty_subtype, not_exists, not_not, s'] at h - simp only [nonempty_iInter, s', h] - simp only [Set.mem_univ, implies_true, exists_const, s'] + simp [s', h] /-- The set of compact and closed sets is a compact system. -/ -theorem isClosedCompacts : +theorem of_isCompact_isClosed : IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := - IsCompactSystem.of_supset (isClosedCompactOrUnivs α) (fun _ hs ↦ Or.inl hs) + IsCompactSystem.mono (of_isCompact_isClosed_or_univ α) (fun _ hs ↦ Or.inl hs) -theorem isCompacts (h : ∀ {s : Set α}, IsCompact s → IsClosed s) : +/-- In a `T2Space` the set of compact sets is a compact system. -/ +theorem of_isCompact [T2Space α] : IsCompactSystem (fun s : Set α ↦ IsCompact s) := by have h : (fun s : Set α ↦ IsCompact s) = (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by ext s - refine ⟨fun h' ↦ ⟨h', h h'⟩, fun h' ↦ h'.1⟩ - exact h ▸ (isClosedCompacts α) - -/-- In a `T2Space` The set of compact sets is a compact system. -/ -theorem _of_isCompact_of_T2Space [T2Space α] : - IsCompactSystem (fun s : Set α ↦ IsCompact s) := (isCompacts α) (fun hs ↦ hs.isClosed) + refine ⟨fun h' ↦ ⟨h', h'.isClosed⟩, fun h ↦ h.1⟩ + exact h ▸ (of_isCompact_isClosed α) -end ClosedCompact +end IsCompactIsClosed end IsCompactSystem From 3eecb42e1e7e7eae648e5f6ebba2fd310270351f Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 23 May 2025 23:50:20 +0200 Subject: [PATCH 027/129] fininsh? --- .../Topology/Compactness/CompactSystem.lean | 131 +++--------------- 1 file changed, 22 insertions(+), 109 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 2fec7c63cf984f..17c4fc989626ce 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -18,6 +18,8 @@ This files defines compact systems of sets. ## Main results +* `IsCompactSystemiff_isCompactSystem_of_or_univ`: A set system is a compact +system iff inserting `univ` gives a compact system. * `IsClosedCompact.isCompactSystem`: The set of closed and compact sets is a compact system. * `IsClosedCompact.isCompactSystem_of_T2Space`: In a `T2Space α`, the set of compact sets is a compact system in a `T2Space`. @@ -108,7 +110,7 @@ lemma of_IsEmpty (h : IsEmpty α) (p : Set α → Prop) : IsCompactSystem p := /-- A set system is a compact system iff adding `univ` gives a compact system. -/ lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ - IsCompactSystem (fun s ↦ (p s ∨ (s = univ))) := by + IsCompactSystem (fun s ↦ (p s ∨ s = univ)) := by refine ⟨fun h ↦ ?_, fun h ↦ mono h (fun s ↦ fun a ↦ Or.symm (Or.inr a))⟩ wlog ht : Nonempty α · rw [not_nonempty_iff] at ht @@ -117,42 +119,34 @@ lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ intro s h' hd classical by_cases h₀ : ∀ n, ¬p (s n) - · have h₁ : ∀ n, s n = univ := by - intro n - simp only [h₀, false_or] at h' - exact h' n - simp_rw [h₁, iInter_univ, Set.univ_nonempty] + · simp only [h₀, false_or] at h' + simp_rw [h', iInter_univ, Set.univ_nonempty] · push_neg at h₀ let n := Nat.find h₀ let s' := fun i ↦ if p (s i) then s i else s n have h₁ : ∀ i, p (s' i) := by intro i by_cases h₁ : p (s i) - · have h₂ : s' i = s i := if_pos h₁ - exact h₂ ▸ h₁ - · have h₂ : s' i = s n := if_neg h₁ - exact h₂ ▸ (Nat.find_spec h₀) + · simp only [h₁, ↓reduceIte, s'] + · simp only [h₁, ↓reduceIte, Nat.find_spec h₀, s', n] have h₃ : ∀ i, (p (s i) → s' i = s i) := fun i h ↦ if_pos h have h₄ : ∀ i, (¬p (s i) → s' i = s n) := fun i h ↦ if_neg h have h₂ : ⋂ i, s i = ⋂ i, s' i := by + simp only [s'] at * ext x simp only [mem_iInter] refine ⟨fun h i ↦ ?_, fun h i ↦ ?_⟩ - · by_cases h₅ : p (s i) - · exact (h₃ i h₅) ▸ h i - · exact (h₄ i h₅) ▸ h n - · have h₄ : s i = s' i ∨ s i = univ := by - rcases h' i with a | b - · exact Or.inl <| Eq.symm (if_pos a) - · exact Or.inr b - rcases h₄ with a | b - · exact a ▸ h i - · simp [b] + · by_cases h' : p (s i) <;> simp only [h', ↓reduceIte, h, s', n] + · specialize h' i + specialize h i + rcases h' with a | b + · simp only [a, ↓reduceIte, s', n] at h + exact h + · simp only [b, Set.mem_univ] apply h₂ ▸ h s' h₁ by_contra! a obtain ⟨j, hj⟩ := a - have h₂ : ∀ (v : ℕ) (hv : n ≤ v), Dissipate s v = Dissipate s' v:= by - intro v hv + have h₂ (v : ℕ) (hv : n ≤ v) : Dissipate s v = Dissipate s' v:= by ext x refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ <;> simp only [dissipate_def, mem_iInter] at h ⊢ <;> intro i hi @@ -174,39 +168,6 @@ lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ rw [h₂, Set.nonempty_iff_ne_empty, h₇] at hd exact hd rfl -example (a b : Set α) (ha : a = ∅ ) : a ∩ b = ∅ := by - subst ha - simp_all only [Set.empty_inter] - -example (P Q : Prop) (hP : ¬P) (hPQ : P ∨ Q) : Q := by - simp_all only [false_or] - - -theorem isPiSystem.iff_isPiSystem_or_empty : IsPiSystem p ↔ IsPiSystem (fun s ↦ p s ∨ s = ∅) := by - refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ - · intro a ha b hb hab - rcases ha with ha₁ | ha₂ - · rcases hb with hb₁ | hb₂ - · left - exact hpi a ha₁ b hb₁ hab - · right - exact hb₂ ▸ (Set.inter_empty a) - · simp only [ha₂, Set.empty_inter] - right - rfl - · intro a ha b hb hab - simp [IsPiSystem] at h - specialize h a - by_cases ha : a = ∅ - · sorry - · - specialize h a (Or.inl ha) b (Or.inl hb) hab - by_cases ha : a = ∅ - · sorry - · - apply h a ha b hb hab - sorry - theorem iff_directed (hpi : IsPiSystem p) : IsCompactSystem p ↔ ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → @@ -248,7 +209,6 @@ theorem iff_directed (hpi : IsPiSystem p) : exact Set.not_nonempty_iff_eq_empty.mp g apply h₀ h₁ h2 - theorem iff_directed' (hpi : IsPiSystem p) : IsCompactSystem p ↔ ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → @@ -260,7 +220,7 @@ theorem iff_directed' (hpi : IsPiSystem p) : section IsCompactIsClosed -variable (α : Type*) [TopologicalSpace α] +variable {α : Type*} [TopologicalSpace α] /-- The set of compact and closed sets is a compact system. -/ theorem of_isCompact_isClosed : @@ -278,9 +238,9 @@ theorem of_isCompact_isClosed : have hz : s z ≠ univ := fun h ↦ a.prop <| eq_univ_of_subset hz1 h use ⟨z, hz⟩ have htcl : ∀ (i : { j : ℕ | s j ≠ univ}), IsClosed (s i) := - fun i ↦ (Or.resolve_right (h1 i.val) i.prop).2 + fun i ↦ (h1 i).2 have htco : ∀ (i : { j : ℕ | s j ≠ univ}), IsCompact (s i) := - fun i ↦ (Or.resolve_right (h1 i.val) i.prop).1 + fun i ↦ (h1 i).1 haveI f : Nonempty α := by apply nonempty_of_exists _ · exact fun x ↦ x ∈ s 0 @@ -301,58 +261,11 @@ theorem of_isCompact_isClosed : · simp only [ne_eq, coe_setOf, nonempty_subtype, not_exists, not_not, s'] at h simp [s', h] - /-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ theorem of_isCompact_isClosed_or_univ : IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by - let p := fun (s : Set α) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ) - have h2 : ∀ (s t : Set α), p s → p t → p (s ∩ t) := by - intro s t hs ht - by_cases hs' : s = univ - · rw [hs', univ_inter] - exact ht - · by_cases ht' : t = univ - · rw [ht', inter_comm, univ_inter] - exact hs - · exact Or.inl <| ⟨IsCompact.inter_right (Or.resolve_right hs hs').1 - (Or.resolve_right ht ht').2, IsClosed.inter (Or.resolve_right hs hs').2 - (Or.resolve_right ht ht').2⟩ - rw [IsCompactSystem.iff_directed' h2] - intro s hs h1 h2 - let s' := fun (i : { j : ℕ | s j ≠ univ}) ↦ s i - have hs' : Directed (fun x1 x2 ↦ x1 ⊇ x2) s' := by - intro a b - obtain ⟨z, hz1, hz2⟩ := hs a.val b.val - have hz : s z ≠ univ := fun h ↦ a.prop <| eq_univ_of_subset hz1 h - use ⟨z, hz⟩ - have htcl : ∀ (i : { j : ℕ | s j ≠ univ}), IsClosed (s i) := - fun i ↦ (Or.resolve_right (h1 i.val) i.prop).2 - have htco : ∀ (i : { j : ℕ | s j ≠ univ}), IsCompact (s i) := - fun i ↦ (Or.resolve_right (h1 i.val) i.prop).1 - haveI f : Nonempty α := by - apply nonempty_of_exists _ - · exact fun x ↦ x ∈ s 0 - · exact h2 0 - by_cases h : Nonempty ↑{j | s j ≠ Set.univ} - · have g : (⋂ i, s' i).Nonempty → (⋂ i, s i).Nonempty := by - rw [Set.nonempty_iInter, Set.nonempty_iInter] - rintro ⟨x, hx⟩ - use x - intro i - by_cases g : s i ≠ univ - · exact hx ⟨i, g⟩ - · simp only [ne_eq, not_not, s'] at g - rw [g] - simp only [Set.mem_univ] - apply g <| IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed s' hs' - (fun j ↦ h2 j) htco htcl - · simp only [ne_eq, coe_setOf, nonempty_subtype, not_exists, not_not, s'] at h - simp [s', h] - -/-- The set of compact and closed sets is a compact system. -/ -theorem of_isCompact_isClosed : - IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := - IsCompactSystem.mono (of_isCompact_isClosed_or_univ α) (fun _ hs ↦ Or.inl hs) + rw [← iff_isCompactSystem_of_or_univ] + exact of_isCompact_isClosed /-- In a `T2Space` the set of compact sets is a compact system. -/ theorem of_isCompact [T2Space α] : @@ -360,7 +273,7 @@ theorem of_isCompact [T2Space α] : have h : (fun s : Set α ↦ IsCompact s) = (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by ext s refine ⟨fun h' ↦ ⟨h', h'.isClosed⟩, fun h ↦ h.1⟩ - exact h ▸ (of_isCompact_isClosed α) + exact h ▸ (of_isCompact_isClosed) end IsCompactIsClosed From 3bdc9cfafa7ddd44128072de63c06fb14dc162ad Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 30 May 2025 11:34:53 +0200 Subject: [PATCH 028/129] repair dissipate --- Mathlib/Data/Set/Dissipate.lean | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Mathlib/Data/Set/Dissipate.lean b/Mathlib/Data/Set/Dissipate.lean index d54b6af373c2be..c4c92267e75a92 100644 --- a/Mathlib/Data/Set/Dissipate.lean +++ b/Mathlib/Data/Set/Dissipate.lean @@ -54,7 +54,7 @@ theorem dissipate_subset_dissipate [Preorder α] {x y} (h : y ≤ x) : @[simp] theorem biInter_dissipate [Preorder α] {s : α → Set β} {x : α} : - ⋂ y ≤ x, Dissipate s y = Dissipate s x := by + ⋂ y, ⋂ (_ : y ≤ x), ⋂ y_1, ⋂ (_ : y_1 ≤ y), s y_1 = ⋂ y, ⋂ (_ : y ≤ x), s y := by apply Subset.antisymm · apply iInter_mono fun z y hy ↦ ?_ simp only [dissipate_def, mem_iInter] at * @@ -63,12 +63,11 @@ theorem biInter_dissipate [Preorder α] {s : α → Set β} {x : α} : exact fun i hi z hz ↦ biInter_subset_of_mem <| le_trans hz hi @[simp] -theorem iInter_dissipate [Preorder α] : ⋂ x, Dissipate s x = ⋂ x, s x := by - apply Subset.antisymm <;> simp_rw [subset_def, mem_iInter, mem_dissipate] +theorem iInter_dissipate [Preorder α] : ⋂ x, ⋂ y, ⋂ (_ : y ≤ x), s y = ⋂ x, s x := by + apply Subset.antisymm <;> simp_rw [subset_def, mem_iInter] · exact fun z h x' ↦ h x' x' (le_refl x') · exact fun z h x' y hy ↦ h y -@[simp] lemma dissipate_bot [PartialOrder α] [OrderBot α] (s : α → Set β) : Dissipate s ⊥ = s ⊥ := by simp only [dissipate_def, le_bot_iff, iInter_iInter_eq_left] @@ -76,7 +75,8 @@ open Nat @[simp] theorem dissipate_succ (s : ℕ → Set α) (n : ℕ) : - Dissipate s (n + 1) = Dissipate s n ∩ s (n + 1) := by + ⋂ y, ⋂ (_ : y ≤ n + 1), s y = (⋂ y, ⋂ (_ : y ≤ n), s y) ∩ s (n + 1) + := by ext x refine ⟨fun hx ↦ ?_, fun hx ↦ ?_⟩ · simp only [mem_inter_iff, mem_iInter, Dissipate] at * @@ -89,7 +89,6 @@ theorem dissipate_succ (s : ℕ → Set α) (n : ℕ) : · simp only [not_le] at h exact le_antisymm hi h ▸ hx.2 -@[simp] lemma dissipate_zero (s : ℕ → Set β) : Dissipate s 0 = s 0 := by simp [dissipate_def] @@ -99,7 +98,7 @@ lemma exists_subset_dissipate_of_directed {s : ℕ → Set α} | zero => use 0; simp | succ n hn => obtain ⟨m, hm⟩ := hn - simp_rw [dissipate_succ] + simp_rw [dissipate_def, dissipate_succ] obtain ⟨k, hk⟩ := hd m (n+1) simp at hk use k @@ -119,7 +118,7 @@ lemma exists_dissipate_eq_empty_iff {s : ℕ → Set α} · rw [hn'] exact Eq.trans (dissipate_zero s) (hn' ▸ hn) · obtain ⟨k, hk⟩ := exists_eq_add_one_of_ne_zero hn' - rw [hk, dissipate_succ, ← hk, hn, Set.inter_empty] + rw [hk, dissipate_def, dissipate_succ, ← hk, hn, Set.inter_empty] lemma directed_dissipate {s : ℕ → Set α} : Directed (fun (x1 x2 : Set α) => x2 ⊆ x1) (Dissipate s) := @@ -133,7 +132,7 @@ lemma exists_dissipate_eq_empty_iff_of_directed (C : ℕ → Set α) · rw [hn', dissipate_zero] exact hn' ▸ hn · obtain ⟨k, hk⟩ := exists_eq_succ_of_ne_zero hn' - simp_rw [hk, succ_eq_add_one, dissipate_succ, + simp_rw [hk, succ_eq_add_one, dissipate_def, dissipate_succ, ← succ_eq_add_one, ← hk, hn, Set.inter_empty] · rw [← not_imp_not] push_neg @@ -151,7 +150,7 @@ lemma dissipate_of_piSystem {s : ℕ → Set α} {p : Set α → Prop} simp only [dissipate_def, le_zero_eq, iInter_iInter_eq_left] exact h 0 | succ n hn => - rw [dissipate_succ] at * + rw [dissipate_def, dissipate_succ] at * apply hp (Dissipate s n) (hn (Nonempty.left h')) (s (n+1)) (h (n+1)) h' end Set From b10b6ebccb4866b80e6e302c2b2f8ae86a014231 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:04:47 +0200 Subject: [PATCH 029/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 3 --- 1 file changed, 3 deletions(-) diff --git a/Mathlib.lean b/Mathlib.lean index e997aea106842a..11d2ac03fcc933 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -96,9 +96,6 @@ import Mathlib.Algebra.Category.CoalgCat.Basic import Mathlib.Algebra.Category.CoalgCat.ComonEquivalence import Mathlib.Algebra.Category.CoalgCat.Monoidal import Mathlib.Algebra.Category.CommAlgCat.Basic -import Mathlib.Algebra.Category.CommAlgCat.FiniteType -import Mathlib.Algebra.Category.CommAlgCat.Monoidal -import Mathlib.Algebra.Category.ContinuousCohomology.Basic import Mathlib.Algebra.Category.FGModuleCat.Basic import Mathlib.Algebra.Category.FGModuleCat.EssentiallySmall import Mathlib.Algebra.Category.FGModuleCat.Limits From 1d9788d13aaa2dd74a98d27c250b217818e8f4b9 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:04:59 +0200 Subject: [PATCH 030/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index 11d2ac03fcc933..c6f4ce566160a7 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -5700,6 +5700,7 @@ import Mathlib.RingTheory.Spectrum.Prime.Jacobson import Mathlib.RingTheory.Spectrum.Prime.LTSeries import Mathlib.RingTheory.Spectrum.Prime.Module import Mathlib.RingTheory.Spectrum.Prime.Noetherian +import Mathlib.RingTheory.Spectrum.Prime.LTSeries import Mathlib.RingTheory.Spectrum.Prime.Polynomial import Mathlib.RingTheory.Spectrum.Prime.RingHom import Mathlib.RingTheory.Spectrum.Prime.TensorProduct From 39bc1a854323da7a6082d2eb6e57c5d834467552 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:05:07 +0200 Subject: [PATCH 031/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index c6f4ce566160a7..7e848625852735 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -5887,6 +5887,7 @@ import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Tactic.CategoryTheory.IsoReassoc import Mathlib.Tactic.CategoryTheory.Monoidal.Basic import Mathlib.Tactic.CategoryTheory.Monoidal.Datatypes +import Mathlib.Tactic.CategoryTheory.IsoReassoc import Mathlib.Tactic.CategoryTheory.Monoidal.Normalize import Mathlib.Tactic.CategoryTheory.Monoidal.PureCoherence import Mathlib.Tactic.CategoryTheory.MonoidalComp From 2f0b105d3b5e72a04ad2570232554de0a86b81ac Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:05:19 +0200 Subject: [PATCH 032/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Mathlib.lean b/Mathlib.lean index 7e848625852735..6e3dd1e23ce192 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6201,7 +6201,11 @@ import Mathlib.Topology.Algebra.IsUniformGroup.Defs import Mathlib.Topology.Algebra.IsUniformGroup.Order import Mathlib.Topology.Algebra.LinearTopology import Mathlib.Topology.Algebra.Localization +<<<<<<< HEAD import Mathlib.Topology.Algebra.MetricSpace.Lipschitz +======= +import Mathlib.Topology.Algebra.IsUniformGroup.Order +>>>>>>> 6afe6111526 (Update Mathlib.lean) import Mathlib.Topology.Algebra.Module.Alternating.Basic import Mathlib.Topology.Algebra.Module.Alternating.Topology import Mathlib.Topology.Algebra.Module.Basic From 42d3432cbb5fcaa3a638d619ed7ed07209dc0197 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:05:29 +0200 Subject: [PATCH 033/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Mathlib.lean b/Mathlib.lean index 6e3dd1e23ce192..3659f132b64ebd 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6375,6 +6375,8 @@ import Mathlib.Topology.Compactification.OnePoint.Sphere import Mathlib.Topology.Compactification.OnePointEquiv import Mathlib.Topology.Compactification.StoneCech import Mathlib.Topology.Compactness.Bases +import Mathlib.Topology.Compactification.OnePoint.Basic +import Mathlib.Topology.Compactification.OnePoint.ProjectiveLine import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.Compactness.CompactlyCoherentSpace import Mathlib.Topology.Compactness.CompactSystem From c354f1564143e92fb92acf4b1c3cbae1089c0e28 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:05:40 +0200 Subject: [PATCH 034/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index 3659f132b64ebd..19be461d15696f 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6382,6 +6382,7 @@ import Mathlib.Topology.Compactness.CompactlyCoherentSpace import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.CompactlyGeneratedSpace import Mathlib.Topology.Compactness.DeltaGeneratedSpace +import Mathlib.Topology.Compactness.CompactlyCoherentSpace import Mathlib.Topology.Compactness.Exterior import Mathlib.Topology.Compactness.HilbertCubeEmbedding import Mathlib.Topology.Compactness.Lindelof From b44e94173ff10d279776942e8cfb6e05b05d791b Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:08:31 +0200 Subject: [PATCH 035/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index 19be461d15696f..92a024fc788127 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -1813,7 +1813,8 @@ import Mathlib.Analysis.NormedSpace.Multilinear.Curry import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn import Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic -import Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear +import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn +import Mathlib.Analysis.NormedSpace.Multilinear.Basic import Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness import Mathlib.Analysis.NormedSpace.OperatorNorm.Mul import Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm From 0e6820fe61efd863a2bd66c9ed426cd54ab37cc0 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:09:05 +0200 Subject: [PATCH 036/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index 92a024fc788127..af0b1d9b9e3397 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -2600,7 +2600,8 @@ import Mathlib.CategoryTheory.Shift.InducedShiftSequence import Mathlib.CategoryTheory.Shift.Linear import Mathlib.CategoryTheory.Shift.Localization import Mathlib.CategoryTheory.Shift.Opposite -import Mathlib.CategoryTheory.Shift.Pullback +import Mathlib.CategoryTheory.Shift.Linear +import Mathlib.CategoryTheory.Shift.Induced import Mathlib.CategoryTheory.Shift.Quotient import Mathlib.CategoryTheory.Shift.ShiftSequence import Mathlib.CategoryTheory.Shift.ShiftedHom From 628fbe1cec6e903031c23526891dee84824e16d9 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:09:16 +0200 Subject: [PATCH 037/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index af0b1d9b9e3397..523c1afd412c84 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -3283,7 +3283,8 @@ import Mathlib.Data.Matrix.RowCol import Mathlib.Data.Matrix.Vec import Mathlib.Data.Matroid.Basic import Mathlib.Data.Matroid.Circuit -import Mathlib.Data.Matroid.Closure +import Mathlib.Data.Matrix.Vec +import Mathlib.Data.Matrix.Reflection import Mathlib.Data.Matroid.Constructions import Mathlib.Data.Matroid.Dual import Mathlib.Data.Matroid.IndepAxioms From a0d2c6d35aecf47f9973400876c7135db12e653c Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:09:24 +0200 Subject: [PATCH 038/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index 523c1afd412c84..190b3a528e6faa 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -4026,7 +4026,8 @@ import Mathlib.LinearAlgebra.Alternating.DomCoprod import Mathlib.LinearAlgebra.Alternating.Uncurry.Fin import Mathlib.LinearAlgebra.AnnihilatingPolynomial import Mathlib.LinearAlgebra.Basis.Basic -import Mathlib.LinearAlgebra.Basis.Bilinear +import Mathlib.LinearAlgebra.Alternating.Uncurry.Fin +import Mathlib.LinearAlgebra.Alternating.Curry import Mathlib.LinearAlgebra.Basis.Cardinality import Mathlib.LinearAlgebra.Basis.Defs import Mathlib.LinearAlgebra.Basis.Exact From 60e963c50da2861694ef82a6036de5a3834922fd Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:09:31 +0200 Subject: [PATCH 039/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index 190b3a528e6faa..e9911da0d49bea 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -4253,7 +4253,8 @@ import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Relations import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Semisimple import Mathlib.LinearAlgebra.RootSystem.Hom import Mathlib.LinearAlgebra.RootSystem.Irreducible -import Mathlib.LinearAlgebra.RootSystem.IsValuedIn +import Mathlib.LinearAlgebra.RootSystem.GeckConstruction +import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas import Mathlib.LinearAlgebra.RootSystem.OfBilinear import Mathlib.LinearAlgebra.RootSystem.Reduced import Mathlib.LinearAlgebra.RootSystem.RootPairingCat From d20245df913488df0a21947d0a1367ea1ac52014 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:09:59 +0200 Subject: [PATCH 040/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 1 - 1 file changed, 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index e9911da0d49bea..8e00762cb5e912 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -5707,7 +5707,6 @@ import Mathlib.RingTheory.Spectrum.Prime.Module import Mathlib.RingTheory.Spectrum.Prime.Noetherian import Mathlib.RingTheory.Spectrum.Prime.LTSeries import Mathlib.RingTheory.Spectrum.Prime.Polynomial -import Mathlib.RingTheory.Spectrum.Prime.RingHom import Mathlib.RingTheory.Spectrum.Prime.TensorProduct import Mathlib.RingTheory.Spectrum.Prime.Topology import Mathlib.RingTheory.Support From 45493901e846801728a76b88aa6d08cceb44a88a Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:10:09 +0200 Subject: [PATCH 041/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index 8e00762cb5e912..d68b9b6ad2da56 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -5892,6 +5892,7 @@ import Mathlib.Tactic.CategoryTheory.IsoReassoc import Mathlib.Tactic.CategoryTheory.Monoidal.Basic import Mathlib.Tactic.CategoryTheory.Monoidal.Datatypes import Mathlib.Tactic.CategoryTheory.IsoReassoc +import Mathlib.Tactic.CategoryTheory.Coherence.PureCoherence import Mathlib.Tactic.CategoryTheory.Monoidal.Normalize import Mathlib.Tactic.CategoryTheory.Monoidal.PureCoherence import Mathlib.Tactic.CategoryTheory.MonoidalComp From 5ba03213cd9ce223b9038a0355bb065fa4e41136 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:10:51 +0200 Subject: [PATCH 042/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 2 -- 1 file changed, 2 deletions(-) diff --git a/Mathlib.lean b/Mathlib.lean index d68b9b6ad2da56..c738b3c2fff329 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6389,8 +6389,6 @@ import Mathlib.Topology.Compactness.CompactlyGeneratedSpace import Mathlib.Topology.Compactness.DeltaGeneratedSpace import Mathlib.Topology.Compactness.CompactlyCoherentSpace import Mathlib.Topology.Compactness.Exterior -import Mathlib.Topology.Compactness.HilbertCubeEmbedding -import Mathlib.Topology.Compactness.Lindelof import Mathlib.Topology.Compactness.LocallyCompact import Mathlib.Topology.Compactness.LocallyFinite import Mathlib.Topology.Compactness.NhdsKer From cfc4447bf5690b04ac2571943e73513c848acaea Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:11:04 +0200 Subject: [PATCH 043/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index c738b3c2fff329..5031a3c2831b81 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6388,6 +6388,7 @@ import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.CompactlyGeneratedSpace import Mathlib.Topology.Compactness.DeltaGeneratedSpace import Mathlib.Topology.Compactness.CompactlyCoherentSpace +import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.Compactness.Exterior import Mathlib.Topology.Compactness.LocallyCompact import Mathlib.Topology.Compactness.LocallyFinite From c31f541ee616f5b34d1c4d28d3563467aa667b41 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:11:56 +0200 Subject: [PATCH 044/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Mathlib.lean b/Mathlib.lean index 5031a3c2831b81..995350a0e59ed4 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -4028,8 +4028,7 @@ import Mathlib.LinearAlgebra.AnnihilatingPolynomial import Mathlib.LinearAlgebra.Basis.Basic import Mathlib.LinearAlgebra.Alternating.Uncurry.Fin import Mathlib.LinearAlgebra.Alternating.Curry -import Mathlib.LinearAlgebra.Basis.Cardinality -import Mathlib.LinearAlgebra.Basis.Defs +import Mathlib.LinearAlgebra.Basis.Bilinear import Mathlib.LinearAlgebra.Basis.Exact import Mathlib.LinearAlgebra.Basis.Fin import Mathlib.LinearAlgebra.Basis.Flag From 92c172658165c3d227d990149156cad7debf2348 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:12:09 +0200 Subject: [PATCH 045/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index 995350a0e59ed4..308f04b3088be2 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6387,6 +6387,7 @@ import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.CompactlyGeneratedSpace import Mathlib.Topology.Compactness.DeltaGeneratedSpace import Mathlib.Topology.Compactness.CompactlyCoherentSpace +import Mathlib.Topology.Compactness.DeltaGeneratedSpace import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.Compactness.Exterior import Mathlib.Topology.Compactness.LocallyCompact From 828537302069e9a8ebbe33efec6e2af5567ba1ea Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Sat, 7 Jun 2025 23:36:46 +0200 Subject: [PATCH 046/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index 308f04b3088be2..c6efdd477a8c80 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -1814,6 +1814,7 @@ import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn import Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn +import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn import Mathlib.Analysis.NormedSpace.Multilinear.Basic import Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness import Mathlib.Analysis.NormedSpace.OperatorNorm.Mul From dc7c48fe4574044515e573eea7015de05ed6a35f Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Sat, 7 Jun 2025 23:37:09 +0200 Subject: [PATCH 047/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Mathlib.lean b/Mathlib.lean index c6efdd477a8c80..f1ef697c94549b 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -1816,8 +1816,7 @@ import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn import Mathlib.Analysis.NormedSpace.Multilinear.Basic -import Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness -import Mathlib.Analysis.NormedSpace.OperatorNorm.Mul +import Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear import Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace import Mathlib.Analysis.NormedSpace.OperatorNorm.Prod From b65221923fce98a1109b1ff211303a17a63acbcc Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sat, 7 Jun 2025 23:39:39 +0200 Subject: [PATCH 048/129] fix two typos --- Mathlib/Topology/Compactness/CompactSystem.lean | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 17c4fc989626ce..dd520e7a1026e4 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -9,7 +9,7 @@ import Mathlib.Topology.Separation.Hausdorff /-! # Compact systems. -This files defines compact systems of sets. +This file defines compact systems of sets. ## Main definitions @@ -162,7 +162,7 @@ lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ simp only [h₆, Set.mem_univ] have h₇ : Dissipate s' (max j n) = ∅ := by rw [← subset_empty_iff] at hj ⊢ - exact le_trans (antitone_dissipate (Nat.le_max_left j n)) hj + exact le_trans (dissipate_antitone (Nat.le_max_left j n)) hj specialize h₂ (max j n) (Nat.le_max_right j n) specialize hd (max j n) rw [h₂, Set.nonempty_iff_ne_empty, h₇] at hd @@ -242,7 +242,7 @@ theorem of_isCompact_isClosed : have htco : ∀ (i : { j : ℕ | s j ≠ univ}), IsCompact (s i) := fun i ↦ (h1 i).1 haveI f : Nonempty α := by - apply nonempty_of_exists _ + apply Exists.nonempty _ · exact fun x ↦ x ∈ s 0 · exact h2 0 by_cases h : Nonempty ↑{j | s j ≠ Set.univ} From e94c7438b924032290e9402a4356758fa6d5347f Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sun, 8 Jun 2025 19:51:50 +0200 Subject: [PATCH 049/129] mk_all --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index f1ef697c94549b..f3957c8b38860a 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6382,6 +6382,7 @@ import Mathlib.Topology.Compactness.Bases import Mathlib.Topology.Compactification.OnePoint.Basic import Mathlib.Topology.Compactification.OnePoint.ProjectiveLine import Mathlib.Topology.Compactness.Compact +import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.CompactlyCoherentSpace import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.CompactlyGeneratedSpace From 63241dc016d664b29691e4457baebb57defee4ac Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Tue, 19 Aug 2025 23:12:43 +0200 Subject: [PATCH 050/129] no issues --- Mathlib.lean | 4 ---- Mathlib/Data/Set/Dissipate.lean | 8 ++++---- Mathlib/Topology/Compactness/CompactSystem.lean | 12 ++++++------ 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Mathlib.lean b/Mathlib.lean index f3957c8b38860a..6b256fd33f29ae 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -4252,7 +4252,6 @@ import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Relations import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Semisimple import Mathlib.LinearAlgebra.RootSystem.Hom import Mathlib.LinearAlgebra.RootSystem.Irreducible -import Mathlib.LinearAlgebra.RootSystem.GeckConstruction import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas import Mathlib.LinearAlgebra.RootSystem.OfBilinear import Mathlib.LinearAlgebra.RootSystem.Reduced @@ -6205,11 +6204,8 @@ import Mathlib.Topology.Algebra.IsUniformGroup.Defs import Mathlib.Topology.Algebra.IsUniformGroup.Order import Mathlib.Topology.Algebra.LinearTopology import Mathlib.Topology.Algebra.Localization -<<<<<<< HEAD import Mathlib.Topology.Algebra.MetricSpace.Lipschitz -======= import Mathlib.Topology.Algebra.IsUniformGroup.Order ->>>>>>> 6afe6111526 (Update Mathlib.lean) import Mathlib.Topology.Algebra.Module.Alternating.Basic import Mathlib.Topology.Algebra.Module.Alternating.Topology import Mathlib.Topology.Algebra.Module.Basic diff --git a/Mathlib/Data/Set/Dissipate.lean b/Mathlib/Data/Set/Dissipate.lean index c4c92267e75a92..023601ffe39d32 100644 --- a/Mathlib/Data/Set/Dissipate.lean +++ b/Mathlib/Data/Set/Dissipate.lean @@ -57,9 +57,9 @@ theorem biInter_dissipate [Preorder α] {s : α → Set β} {x : α} : ⋂ y, ⋂ (_ : y ≤ x), ⋂ y_1, ⋂ (_ : y_1 ≤ y), s y_1 = ⋂ y, ⋂ (_ : y ≤ x), s y := by apply Subset.antisymm · apply iInter_mono fun z y hy ↦ ?_ - simp only [dissipate_def, mem_iInter] at * + simp only [mem_iInter] at * exact fun h ↦ hy h z <| le_refl z - · simp only [subset_iInter_iff, Dissipate] + · simp only [subset_iInter_iff] exact fun i hi z hz ↦ biInter_subset_of_mem <| le_trans hz hi @[simp] @@ -79,10 +79,10 @@ theorem dissipate_succ (s : ℕ → Set α) (n : ℕ) : := by ext x refine ⟨fun hx ↦ ?_, fun hx ↦ ?_⟩ - · simp only [mem_inter_iff, mem_iInter, Dissipate] at * + · simp only [mem_inter_iff, mem_iInter] at * exact ⟨fun i hi ↦ hx i <| le_trans hi <| le_add_right n 1, hx (n + 1) <| le_refl (n + 1)⟩ - · simp only [Dissipate, mem_inter_iff, mem_iInter] at * + · simp only [mem_inter_iff, mem_iInter] at * intro i hi by_cases h : i ≤ n · exact hx.1 i h diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index dd520e7a1026e4..4922e1d5b1737e 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -136,11 +136,11 @@ lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ ext x simp only [mem_iInter] refine ⟨fun h i ↦ ?_, fun h i ↦ ?_⟩ - · by_cases h' : p (s i) <;> simp only [h', ↓reduceIte, h, s', n] + · by_cases h' : p (s i) <;> simp only [h', ↓reduceIte, h, n] · specialize h' i specialize h i rcases h' with a | b - · simp only [a, ↓reduceIte, s', n] at h + · simp only [a, ↓reduceIte] at h exact h · simp only [b, Set.mem_univ] apply h₂ ▸ h s' h₁ @@ -162,7 +162,7 @@ lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ simp only [h₆, Set.mem_univ] have h₇ : Dissipate s' (max j n) = ∅ := by rw [← subset_empty_iff] at hj ⊢ - exact le_trans (dissipate_antitone (Nat.le_max_left j n)) hj + exact le_trans (antitone_dissipate (Nat.le_max_left j n)) hj specialize h₂ (max j n) (Nat.le_max_right j n) specialize hd (max j n) rw [h₂, Set.nonempty_iff_ne_empty, h₇] at hd @@ -253,13 +253,13 @@ theorem of_isCompact_isClosed : intro i by_cases g : s i ≠ univ · exact hx ⟨i, g⟩ - · simp only [ne_eq, not_not, s'] at g + · simp only [ne_eq, not_not] at g rw [g] simp only [Set.mem_univ] apply g <| IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed s' hs' (fun j ↦ h2 j) htco htcl - · simp only [ne_eq, coe_setOf, nonempty_subtype, not_exists, not_not, s'] at h - simp [s', h] + · simp only [ne_eq, coe_setOf, nonempty_subtype, not_exists, not_not] at h + simp [h] /-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ theorem of_isCompact_isClosed_or_univ : From 2a13c3798db7358ae4c03068730b6a5903b0ba09 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Tue, 19 Aug 2025 23:53:30 +0200 Subject: [PATCH 051/129] review dissipate --- Mathlib/Data/Set/Dissipate.lean | 86 ++++++++++--------- .../Topology/Compactness/CompactSystem.lean | 28 +++--- 2 files changed, 58 insertions(+), 56 deletions(-) diff --git a/Mathlib/Data/Set/Dissipate.lean b/Mathlib/Data/Set/Dissipate.lean index 023601ffe39d32..f264cb76514671 100644 --- a/Mathlib/Data/Set/Dissipate.lean +++ b/Mathlib/Data/Set/Dissipate.lean @@ -10,7 +10,7 @@ import Mathlib.MeasureTheory.PiSystem /-! # Dissipate -The function `Dissipate` takes `s : α → Set β` with `LE α` and returns `⋂ y ≤ x, s y`. +The function `dissipate` takes `s : α → Set β` with `LE α` and returns `⋂ y ≤ x, s y`. In large parts, this file is parallel to `Mathlib.Data.Set.Accumulate`, where `Accumulate s := ⋃ y ≤ x, s y` is defined. @@ -23,37 +23,37 @@ variable {α β : Type*} {s : α → Set β} namespace Set -/-- `Dissipate s` is the intersection of `s y` for `y ≤ x`. -/ -def Dissipate [LE α] (s : α → Set β) (x : α) : Set β := +/-- `dissipate s` is the intersection of `s y` for `y ≤ x`. -/ +def dissipate [LE α] (s : α → Set β) (x : α) : Set β := ⋂ y ≤ x, s y @[simp] -theorem dissipate_def [LE α] {x : α} : Dissipate s x = ⋂ y ≤ x, s y := rfl +theorem dissipate_def [LE α] {x : α} : dissipate s x = ⋂ y ≤ x, s y := rfl -theorem dissipate_eq {s : ℕ → Set β} {n : ℕ} : Dissipate s n = ⋂ k < n + 1, s k := by +theorem dissipate_eq {s : ℕ → Set β} {n : ℕ} : dissipate s n = ⋂ k < n + 1, s k := by simp_rw [Nat.lt_add_one_iff] rfl -theorem mem_dissipate [LE α] {x : α} {z : β} : z ∈ Dissipate s x ↔ ∀ y ≤ x, z ∈ s y := by +theorem mem_dissipate [LE α] {x : α} {z : β} : z ∈ dissipate s x ↔ ∀ y ≤ x, z ∈ s y := by simp only [dissipate_def, mem_iInter] -theorem dissipate_subset [Preorder α] {x y : α} (hy : y ≤ x) : Dissipate s x ⊆ s y := +theorem dissipate_subset [Preorder α] {x y : α} (hy : y ≤ x) : dissipate s x ⊆ s y := biInter_subset_of_mem hy -theorem dissipate_subset_iInter [Preorder α] (x : α) : ⋂ i, s i ⊆ Dissipate s x := by - simp only [Dissipate, subset_iInter_iff] +theorem iInter_subset_dissipate [Preorder α] (x : α) : ⋂ i, s i ⊆ dissipate s x := by + simp only [dissipate, subset_iInter_iff] exact fun x h ↦ iInter_subset_of_subset x fun ⦃a⦄ a ↦ a -theorem antitone_dissipate [Preorder α] : Antitone (Dissipate s) := +theorem antitone_dissipate [Preorder α] : Antitone (dissipate s) := fun _ _ hab ↦ biInter_subset_biInter_left fun _ hz => le_trans hz hab @[gcongr] theorem dissipate_subset_dissipate [Preorder α] {x y} (h : y ≤ x) : - Dissipate s x ⊆ Dissipate s y := + dissipate s x ⊆ dissipate s y := antitone_dissipate h @[simp] -theorem biInter_dissipate [Preorder α] {s : α → Set β} {x : α} : +theorem dissipate_dissipate [Preorder α] {s : α → Set β} {x : α} : ⋂ y, ⋂ (_ : y ≤ x), ⋂ y_1, ⋂ (_ : y_1 ≤ y), s y_1 = ⋂ y, ⋂ (_ : y ≤ x), s y := by apply Subset.antisymm · apply iInter_mono fun z y hy ↦ ?_ @@ -68,37 +68,39 @@ theorem iInter_dissipate [Preorder α] : ⋂ x, ⋂ y, ⋂ (_ : y ≤ x), s y = · exact fun z h x' ↦ h x' x' (le_refl x') · exact fun z h x' y hy ↦ h y -lemma dissipate_bot [PartialOrder α] [OrderBot α] (s : α → Set β) : Dissipate s ⊥ = s ⊥ := by +lemma dissipate_bot [PartialOrder α] [OrderBot α] (s : α → Set β) : dissipate s ⊥ = s ⊥ := by simp only [dissipate_def, le_bot_iff, iInter_iInter_eq_left] open Nat @[simp] theorem dissipate_succ (s : ℕ → Set α) (n : ℕ) : - ⋂ y, ⋂ (_ : y ≤ n + 1), s y = (⋂ y, ⋂ (_ : y ≤ n), s y) ∩ s (n + 1) + dissipate s (n + 1) = (dissipate s n) ∩ s (n + 1) := by ext x - refine ⟨fun hx ↦ ?_, fun hx ↦ ?_⟩ - · simp only [mem_inter_iff, mem_iInter] at * - exact ⟨fun i hi ↦ hx i <| le_trans hi <| - le_add_right n 1, hx (n + 1) <| le_refl (n + 1)⟩ - · simp only [mem_inter_iff, mem_iInter] at * - intro i hi - by_cases h : i ≤ n - · exact hx.1 i h - · simp only [not_le] at h - exact le_antisymm hi h ▸ hx.2 - -lemma dissipate_zero (s : ℕ → Set β) : Dissipate s 0 = s 0 := by + simp_all only [dissipate_def, mem_iInter, mem_inter_iff] + refine ⟨fun a ↦ ?_, fun a i c ↦ ?_⟩ + · simp_all only [le_refl, and_true] + intro i i_1 + apply a i <| le_trans i_1 (le_succ n) + · obtain ⟨left, right⟩ := a + · by_cases h : i ≤ n + · exact left i h + · have h : i = n + 1 := by + simp only [not_le] at h + exact le_antisymm c h + exact h.symm ▸ right + +lemma dissipate_zero (s : ℕ → Set β) : dissipate s 0 = s 0 := by simp [dissipate_def] lemma exists_subset_dissipate_of_directed {s : ℕ → Set α} - (hd : Directed (fun (x1 x2 : Set α) => x2 ⊆ x1) s) (n : ℕ) : ∃ m, s m ⊆ Dissipate s n := by + (hd : Directed (fun (x y : Set α) => y ⊆ x) s) (n : ℕ) : ∃ m, s m ⊆ dissipate s n := by induction n with | zero => use 0; simp | succ n hn => obtain ⟨m, hm⟩ := hn - simp_rw [dissipate_def, dissipate_succ] + simp_rw [dissipate_succ] obtain ⟨k, hk⟩ := hd m (n+1) simp at hk use k @@ -106,8 +108,8 @@ lemma exists_subset_dissipate_of_directed {s : ℕ → Set α} exact ⟨le_trans hk.1 hm, hk.2⟩ lemma exists_dissipate_eq_empty_iff {s : ℕ → Set α} - (hd : Directed (fun (x1 x2 : Set α) => x2 ⊆ x1) s) : - (∃ n, Dissipate s n = ∅) ↔ (∃ n, s n = ∅) := by + (hd : Directed (fun (x y : Set α) => y ⊆ x) s) : + (∃ n, dissipate s n = ∅) ↔ (∃ n, s n = ∅) := by refine ⟨?_, fun ⟨n, hn⟩ ↦ ⟨n, ?_⟩⟩ · rw [← not_imp_not] push_neg @@ -118,21 +120,21 @@ lemma exists_dissipate_eq_empty_iff {s : ℕ → Set α} · rw [hn'] exact Eq.trans (dissipate_zero s) (hn' ▸ hn) · obtain ⟨k, hk⟩ := exists_eq_add_one_of_ne_zero hn' - rw [hk, dissipate_def, dissipate_succ, ← hk, hn, Set.inter_empty] + rw [hk, dissipate_succ, ← hk, hn, Set.inter_empty] lemma directed_dissipate {s : ℕ → Set α} : - Directed (fun (x1 x2 : Set α) => x2 ⊆ x1) (Dissipate s) := + Directed (fun (x y : Set α) => y ⊆ x) (dissipate s) := antitone_dissipate.directed_ge lemma exists_dissipate_eq_empty_iff_of_directed (C : ℕ → Set α) - (hd : Directed (fun (x1 x2 : Set α) => x2 ⊆ x1) C) : - (∃ n, C n = ∅) ↔ (∃ n, Dissipate C n = ∅) := by + (hd : Directed (fun (x y : Set α) => y ⊆ x) C) : + (∃ n, C n = ∅) ↔ (∃ n, dissipate C n = ∅) := by refine ⟨fun ⟨n, hn⟩ ↦ ⟨n, ?_⟩ , ?_⟩ · by_cases hn' : n = 0 · rw [hn', dissipate_zero] exact hn' ▸ hn · obtain ⟨k, hk⟩ := exists_eq_succ_of_ne_zero hn' - simp_rw [hk, succ_eq_add_one, dissipate_def, dissipate_succ, + simp_rw [hk, succ_eq_add_one, dissipate_succ, ← succ_eq_add_one, ← hk, hn, Set.inter_empty] · rw [← not_imp_not] push_neg @@ -140,17 +142,17 @@ lemma exists_dissipate_eq_empty_iff_of_directed (C : ℕ → Set α) obtain ⟨m, hm⟩ := exists_subset_dissipate_of_directed hd n exact Set.Nonempty.mono hm (h m) -/-- For a ∩-stable attribute `p` on `Set α` and a sequence of sets `s` with this attribute, -`p (Dissipate s n)` holds. -/ -lemma dissipate_of_piSystem {s : ℕ → Set α} {p : Set α → Prop} - (hp : IsPiSystem p) (h : ∀ n, p (s n)) (n : ℕ) (h' : (Dissipate s n).Nonempty) : - p (Dissipate s n) := by +/-- For a ∩-stable set of sets `p` on `α` and a sequence of sets `s` with this attribute, +`p (dissipate s n)` holds. -/ +lemma IsPiSystem.dissipate_mem {s : ℕ → Set α} {p : Set (Set α)} + (hp : IsPiSystem p) (h : ∀ n, s n ∈ p) (n : ℕ) (h' : (dissipate s n).Nonempty) : + (dissipate s n) ∈ p := by induction n with | zero => simp only [dissipate_def, le_zero_eq, iInter_iInter_eq_left] exact h 0 | succ n hn => - rw [dissipate_def, dissipate_succ] at * - apply hp (Dissipate s n) (hn (Nonempty.left h')) (s (n+1)) (h (n+1)) h' + rw [dissipate_succ] at * + apply hp (dissipate s n) (hn (Nonempty.left h')) (s (n+1)) (h (n+1)) h' end Set diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 4922e1d5b1737e..fe61118228fa72 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -34,7 +34,7 @@ section definition /-- A set of sets is a compact system if, whenever a countable subfamily has empty intersection, then finitely many of them already have empty intersection. -/ def IsCompactSystem (p : Set α → Prop) : Prop := - ∀ C : ℕ → Set α, (∀ i, p (C i)) → ⋂ i, C i = ∅ → ∃ (n : ℕ), Dissipate C n = ∅ + ∀ C : ℕ → Set α, (∀ i, p (C i)) → ⋂ i, C i = ∅ → ∃ (n : ℕ), dissipate C n = ∅ end definition @@ -51,12 +51,12 @@ def finite_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) open Classical in lemma dissipate_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) (hC_empty : ⋂ i, C i = ∅) : - Dissipate C (hp.finite_of_empty hC hC_empty) = ∅ := by + dissipate C (hp.finite_of_empty hC hC_empty) = ∅ := by apply Nat.find_spec (hp C hC hC_empty) theorem iff_nonempty_iInter (p : Set α → Prop) : IsCompactSystem p ↔ (∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ (n : ℕ), - (Dissipate C n).Nonempty) → (⋂ i, C i).Nonempty) := by + (dissipate C n).Nonempty) → (⋂ i, C i).Nonempty) := by refine ⟨fun h C hC hn ↦ ?_, fun h C hC ↦ ?_⟩ <;> have h2 := not_imp_not.mpr <| h C hC · push_neg at h2 exact h2 hn @@ -76,7 +76,7 @@ lemma iff_nonempty_iInter_of_lt (p : Set α → Prop) : IsCompactSystem p ↔ simp_rw [Set.nonempty_iff_ne_empty] at h' ⊢ intro g apply h' n - simp_rw [← subset_empty_iff, Dissipate] at g ⊢ + simp_rw [← subset_empty_iff, dissipate] at g ⊢ apply le_trans _ g intro x rw [mem_iInter₂, mem_iInter₂] @@ -106,7 +106,7 @@ lemma iff_isCompactSystem_of_or_empty : IsCompactSystem p ↔ exact h s hj hd lemma of_IsEmpty (h : IsEmpty α) (p : Set α → Prop) : IsCompactSystem p := - fun s _ _ ↦ ⟨0, Set.eq_empty_of_isEmpty (Dissipate s 0)⟩ + fun s _ _ ↦ ⟨0, Set.eq_empty_of_isEmpty (dissipate s 0)⟩ /-- A set system is a compact system iff adding `univ` gives a compact system. -/ lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ @@ -146,7 +146,7 @@ lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ apply h₂ ▸ h s' h₁ by_contra! a obtain ⟨j, hj⟩ := a - have h₂ (v : ℕ) (hv : n ≤ v) : Dissipate s v = Dissipate s' v:= by + have h₂ (v : ℕ) (hv : n ≤ v) : dissipate s v = dissipate s' v:= by ext x refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ <;> simp only [dissipate_def, mem_iInter] at h ⊢ <;> intro i hi @@ -160,7 +160,7 @@ lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ simp only [h₅, false_or] at h' exact h' simp only [h₆, Set.mem_univ] - have h₇ : Dissipate s' (max j n) = ∅ := by + have h₇ : dissipate s' (max j n) = ∅ := by rw [← subset_empty_iff] at hj ⊢ exact le_trans (antitone_dissipate (Nat.le_max_left j n)) hj specialize h₂ (max j n) (Nat.le_max_right j n) @@ -189,21 +189,21 @@ theorem iff_directed (hpi : IsPiSystem p) : right rfl rw [← biInter_le_eq_iInter] at h2 - obtain h' := h (Dissipate C) directed_dissipate - have h₀ : (∀ (n : ℕ), p (Dissipate C n) ∨ Dissipate C n = ∅) → ⋂ n, Dissipate C n = ∅ → - ∃ n, Dissipate C n = ∅ := by + obtain h' := h (dissipate C) directed_dissipate + have h₀ : (∀ (n : ℕ), p (dissipate C n) ∨ dissipate C n = ∅) → ⋂ n, dissipate C n = ∅ → + ∃ n, dissipate C n = ∅ := by intro h₀ h₁ - by_cases f : ∀ n, p (Dissipate C n) + by_cases f : ∀ n, p (dissipate C n) · apply h' f h₁ · push_neg at f obtain ⟨n, hn⟩ := f use n specialize h₀ n simp_all only [false_or] - obtain h'' := dissipate_of_piSystem hpi' h1 - have h₁ : ∀ (n : ℕ), p (Dissipate C n) ∨ Dissipate C n = ∅ := by + obtain h'' := IsPiSystem.dissipate_mem hpi' h1 + have h₁ : ∀ (n : ℕ), p (dissipate C n) ∨ dissipate C n = ∅ := by intro n - by_cases g : (Dissipate C n).Nonempty + by_cases g : (dissipate C n).Nonempty · exact h'' n g · right exact Set.not_nonempty_iff_eq_empty.mp g From b301b7ab9bf1360fa60d067214f7332514af786b Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Wed, 20 Aug 2025 14:55:47 +0200 Subject: [PATCH 052/129] simp normal form at dissipate --- Mathlib/Data/Set/Dissipate.lean | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Mathlib/Data/Set/Dissipate.lean b/Mathlib/Data/Set/Dissipate.lean index f264cb76514671..26b987c3424f38 100644 --- a/Mathlib/Data/Set/Dissipate.lean +++ b/Mathlib/Data/Set/Dissipate.lean @@ -75,7 +75,7 @@ open Nat @[simp] theorem dissipate_succ (s : ℕ → Set α) (n : ℕ) : - dissipate s (n + 1) = (dissipate s n) ∩ s (n + 1) + ⋂ i, ⋂ (_ : i ≤ n + 1), s i = (dissipate s n) ∩ s (n + 1) := by ext x simp_all only [dissipate_def, mem_iInter, mem_inter_iff] @@ -100,7 +100,7 @@ lemma exists_subset_dissipate_of_directed {s : ℕ → Set α} | zero => use 0; simp | succ n hn => obtain ⟨m, hm⟩ := hn - simp_rw [dissipate_succ] + simp_rw [dissipate_def, dissipate_succ] obtain ⟨k, hk⟩ := hd m (n+1) simp at hk use k @@ -120,7 +120,7 @@ lemma exists_dissipate_eq_empty_iff {s : ℕ → Set α} · rw [hn'] exact Eq.trans (dissipate_zero s) (hn' ▸ hn) · obtain ⟨k, hk⟩ := exists_eq_add_one_of_ne_zero hn' - rw [hk, dissipate_succ, ← hk, hn, Set.inter_empty] + rw [hk, dissipate_def, dissipate_succ, ← hk, hn, Set.inter_empty] lemma directed_dissipate {s : ℕ → Set α} : Directed (fun (x y : Set α) => y ⊆ x) (dissipate s) := @@ -134,7 +134,7 @@ lemma exists_dissipate_eq_empty_iff_of_directed (C : ℕ → Set α) · rw [hn', dissipate_zero] exact hn' ▸ hn · obtain ⟨k, hk⟩ := exists_eq_succ_of_ne_zero hn' - simp_rw [hk, succ_eq_add_one, dissipate_succ, + simp_rw [hk, succ_eq_add_one, dissipate_def, dissipate_succ, ← succ_eq_add_one, ← hk, hn, Set.inter_empty] · rw [← not_imp_not] push_neg @@ -152,7 +152,7 @@ lemma IsPiSystem.dissipate_mem {s : ℕ → Set α} {p : Set (Set α)} simp only [dissipate_def, le_zero_eq, iInter_iInter_eq_left] exact h 0 | succ n hn => - rw [dissipate_succ] at * + rw [dissipate_def, dissipate_succ] at * apply hp (dissipate s n) (hn (Nonempty.left h')) (s (n+1)) (h (n+1)) h' end Set From f0ca23247ef86b4099ea389749f0d3b65e3d2070 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Wed, 20 Aug 2025 21:43:55 +0200 Subject: [PATCH 053/129] update mathlib --- Mathlib.lean | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/Mathlib.lean b/Mathlib.lean index 6b256fd33f29ae..5b4751deecfa23 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -96,6 +96,9 @@ import Mathlib.Algebra.Category.CoalgCat.Basic import Mathlib.Algebra.Category.CoalgCat.ComonEquivalence import Mathlib.Algebra.Category.CoalgCat.Monoidal import Mathlib.Algebra.Category.CommAlgCat.Basic +import Mathlib.Algebra.Category.CommAlgCat.FiniteType +import Mathlib.Algebra.Category.CommAlgCat.Monoidal +import Mathlib.Algebra.Category.ContinuousCohomology.Basic import Mathlib.Algebra.Category.FGModuleCat.Basic import Mathlib.Algebra.Category.FGModuleCat.EssentiallySmall import Mathlib.Algebra.Category.FGModuleCat.Limits @@ -1813,10 +1816,9 @@ import Mathlib.Analysis.NormedSpace.Multilinear.Curry import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn import Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic -import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn -import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn -import Mathlib.Analysis.NormedSpace.Multilinear.Basic import Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear +import Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness +import Mathlib.Analysis.NormedSpace.OperatorNorm.Mul import Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace import Mathlib.Analysis.NormedSpace.OperatorNorm.Prod @@ -2600,8 +2602,7 @@ import Mathlib.CategoryTheory.Shift.InducedShiftSequence import Mathlib.CategoryTheory.Shift.Linear import Mathlib.CategoryTheory.Shift.Localization import Mathlib.CategoryTheory.Shift.Opposite -import Mathlib.CategoryTheory.Shift.Linear -import Mathlib.CategoryTheory.Shift.Induced +import Mathlib.CategoryTheory.Shift.Pullback import Mathlib.CategoryTheory.Shift.Quotient import Mathlib.CategoryTheory.Shift.ShiftSequence import Mathlib.CategoryTheory.Shift.ShiftedHom @@ -3283,8 +3284,7 @@ import Mathlib.Data.Matrix.RowCol import Mathlib.Data.Matrix.Vec import Mathlib.Data.Matroid.Basic import Mathlib.Data.Matroid.Circuit -import Mathlib.Data.Matrix.Vec -import Mathlib.Data.Matrix.Reflection +import Mathlib.Data.Matroid.Closure import Mathlib.Data.Matroid.Constructions import Mathlib.Data.Matroid.Dual import Mathlib.Data.Matroid.IndepAxioms @@ -4026,9 +4026,9 @@ import Mathlib.LinearAlgebra.Alternating.DomCoprod import Mathlib.LinearAlgebra.Alternating.Uncurry.Fin import Mathlib.LinearAlgebra.AnnihilatingPolynomial import Mathlib.LinearAlgebra.Basis.Basic -import Mathlib.LinearAlgebra.Alternating.Uncurry.Fin -import Mathlib.LinearAlgebra.Alternating.Curry import Mathlib.LinearAlgebra.Basis.Bilinear +import Mathlib.LinearAlgebra.Basis.Cardinality +import Mathlib.LinearAlgebra.Basis.Defs import Mathlib.LinearAlgebra.Basis.Exact import Mathlib.LinearAlgebra.Basis.Fin import Mathlib.LinearAlgebra.Basis.Flag @@ -4252,7 +4252,7 @@ import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Relations import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Semisimple import Mathlib.LinearAlgebra.RootSystem.Hom import Mathlib.LinearAlgebra.RootSystem.Irreducible -import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas +import Mathlib.LinearAlgebra.RootSystem.IsValuedIn import Mathlib.LinearAlgebra.RootSystem.OfBilinear import Mathlib.LinearAlgebra.RootSystem.Reduced import Mathlib.LinearAlgebra.RootSystem.RootPairingCat @@ -5703,8 +5703,8 @@ import Mathlib.RingTheory.Spectrum.Prime.Jacobson import Mathlib.RingTheory.Spectrum.Prime.LTSeries import Mathlib.RingTheory.Spectrum.Prime.Module import Mathlib.RingTheory.Spectrum.Prime.Noetherian -import Mathlib.RingTheory.Spectrum.Prime.LTSeries import Mathlib.RingTheory.Spectrum.Prime.Polynomial +import Mathlib.RingTheory.Spectrum.Prime.RingHom import Mathlib.RingTheory.Spectrum.Prime.TensorProduct import Mathlib.RingTheory.Spectrum.Prime.Topology import Mathlib.RingTheory.Support @@ -5889,8 +5889,6 @@ import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Tactic.CategoryTheory.IsoReassoc import Mathlib.Tactic.CategoryTheory.Monoidal.Basic import Mathlib.Tactic.CategoryTheory.Monoidal.Datatypes -import Mathlib.Tactic.CategoryTheory.IsoReassoc -import Mathlib.Tactic.CategoryTheory.Coherence.PureCoherence import Mathlib.Tactic.CategoryTheory.Monoidal.Normalize import Mathlib.Tactic.CategoryTheory.Monoidal.PureCoherence import Mathlib.Tactic.CategoryTheory.MonoidalComp @@ -6205,7 +6203,6 @@ import Mathlib.Topology.Algebra.IsUniformGroup.Order import Mathlib.Topology.Algebra.LinearTopology import Mathlib.Topology.Algebra.Localization import Mathlib.Topology.Algebra.MetricSpace.Lipschitz -import Mathlib.Topology.Algebra.IsUniformGroup.Order import Mathlib.Topology.Algebra.Module.Alternating.Basic import Mathlib.Topology.Algebra.Module.Alternating.Topology import Mathlib.Topology.Algebra.Module.Basic @@ -6375,18 +6372,14 @@ import Mathlib.Topology.Compactification.OnePoint.Sphere import Mathlib.Topology.Compactification.OnePointEquiv import Mathlib.Topology.Compactification.StoneCech import Mathlib.Topology.Compactness.Bases -import Mathlib.Topology.Compactification.OnePoint.Basic -import Mathlib.Topology.Compactification.OnePoint.ProjectiveLine import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.CompactlyCoherentSpace -import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.CompactlyGeneratedSpace import Mathlib.Topology.Compactness.DeltaGeneratedSpace -import Mathlib.Topology.Compactness.CompactlyCoherentSpace -import Mathlib.Topology.Compactness.DeltaGeneratedSpace -import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.Compactness.Exterior +import Mathlib.Topology.Compactness.HilbertCubeEmbedding +import Mathlib.Topology.Compactness.Lindelof import Mathlib.Topology.Compactness.LocallyCompact import Mathlib.Topology.Compactness.LocallyFinite import Mathlib.Topology.Compactness.NhdsKer From e086dd34b75b3fa88553aafea04a0feb6aac79cd Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sun, 23 Feb 2025 21:02:38 +0100 Subject: [PATCH 054/129] started compact2 --- .../Constructions/Cylinders.lean | 23 +- .../Topology/Compactness/CompactSystem.lean | 324 +++++++++++++++++- 2 files changed, 343 insertions(+), 4 deletions(-) diff --git a/Mathlib/MeasureTheory/Constructions/Cylinders.lean b/Mathlib/MeasureTheory/Constructions/Cylinders.lean index 0c1e925a61b400..8e875f88c89697 100644 --- a/Mathlib/MeasureTheory/Constructions/Cylinders.lean +++ b/Mathlib/MeasureTheory/Constructions/Cylinders.lean @@ -3,8 +3,7 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber, Yaël Dillies, Kin Yau James Wong -/ -import Mathlib.MeasureTheory.MeasurableSpace.Constructions -import Mathlib.MeasureTheory.PiSystem +import Mathlib.MeasureTheory.SetSemiring import Mathlib.Topology.Constructions /-! @@ -349,6 +348,26 @@ theorem diff_mem_measurableCylinders (hs : s ∈ measurableCylinders α) rw [diff_eq_compl_inter] exact inter_mem_measurableCylinders (compl_mem_measurableCylinders ht) hs +/-- The measurable cylinders are a ring. -/ +theorem isSetRing_measurableCylinders : IsSetRing (measurableCylinders α) where + empty_mem := empty_mem_measurableCylinders α + union_mem := fun _ _ ↦ union_mem_measurableCylinders + diff_mem := fun _ _ ↦ diff_mem_measurableCylinders + +/-- The measurable cylinders are a semiring. -/ +theorem isSetSemiring_measurableCylinders : MeasureTheory.IsSetSemiring (measurableCylinders α) := + isSetRing_measurableCylinders.isSetSemiring + +theorem iUnion_le_mem_measurableCylinders {s : ℕ → Set (∀ i : ι, α i)} + (hs : ∀ n, s n ∈ measurableCylinders α) (n : ℕ) : + (⋃ i ≤ n, s i) ∈ measurableCylinders α := + isSetRing_measurableCylinders.iUnion_le_mem hs n + +theorem iInter_le_mem_measurableCylinders {s : ℕ → Set (∀ i : ι, α i)} + (hs : ∀ n, s n ∈ measurableCylinders α) (n : ℕ) : + (⋂ i ≤ n, s i) ∈ measurableCylinders α := + isSetRing_measurableCylinders.iInter_le_mem hs n + /-- The measurable cylinders generate the product σ-algebra. -/ theorem generateFrom_measurableCylinders : MeasurableSpace.generateFrom (measurableCylinders α) = MeasurableSpace.pi := by diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index fe61118228fa72..92eebdf644414d 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -5,6 +5,9 @@ Authors: Rémy Degenne, Peter Pfaffelhuber -/ import Mathlib.Data.Set.Dissipate import Mathlib.Topology.Separation.Hausdorff +import Mathlib.MeasureTheory.PiSystem +import Mathlib.MeasureTheory.Constructions.Cylinders +import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic /-! # Compact systems. @@ -25,7 +28,9 @@ system iff inserting `univ` gives a compact system. is a compact system in a `T2Space`. -/ -open Set Finset Nat +open Set Finset Nat MeasureTheory + +section definition variable {α : Type*} {p : Set α → Prop} {C : ℕ → Set α} @@ -277,4 +282,319 @@ theorem of_isCompact [T2Space α] : end IsCompactIsClosed -end IsCompactSystem +end ClosedCompact + +section ClosedCompactCylinders + + +variable {ι : Type*} {α : ι → Type*} + +variable [∀ i, TopologicalSpace (α i)] + +variable (α) + +/-- The set of all cylinders based on closed compact sets. Note that such a set is closed, but +not compact in general (for instance, the whole space is always a closed compact cylinder). -/ +def closedCompactCylinders : Set (Set (Π i, α i)) := + ⋃ (s) (S) (_ : IsClosed S) (_ : IsCompact S), {cylinder s S} + +theorem empty_mem_closedCompactCylinders : ∅ ∈ closedCompactCylinders α := by + simp_rw [closedCompactCylinders, mem_iUnion, mem_singleton_iff] + exact ⟨∅, ∅, isClosed_empty, isCompact_empty, (cylinder_empty _).symm⟩ + +variable {α} {t : Set (Π i, α i)} + +@[simp] +theorem mem_closedCompactCylinders (t : Set (Π i, α i)) : + t ∈ closedCompactCylinders α + ↔ ∃ (s S : _) (_ : IsClosed S) (_ : IsCompact S), t = cylinder s S := by + simp_rw [closedCompactCylinders, mem_iUnion, mem_singleton_iff] + +/-- Given a closed compact cylinder, choose a finset of variables such that it only depends on +these variables. -/ +noncomputable def closedCompactCylinders.finset (ht : t ∈ closedCompactCylinders α) : + Finset ι := + ((mem_closedCompactCylinders t).mp ht).choose + +/-- Given a closed compact cylinder, choose a set depending on finitely many variables of which it +is a lift. -/ +def closedCompactCylinders.set (ht : t ∈ closedCompactCylinders α) : + Set (∀ i : closedCompactCylinders.finset ht, α i) := + ((mem_closedCompactCylinders t).mp ht).choose_spec.choose + +theorem closedCompactCylinders.isClosed (ht : t ∈ closedCompactCylinders α) : + IsClosed (closedCompactCylinders.set ht) := + ((mem_closedCompactCylinders t).mp ht).choose_spec.choose_spec.choose + +theorem closedCompactCylinders.isCompact (ht : t ∈ closedCompactCylinders α) : + IsCompact (closedCompactCylinders.set ht) := + ((mem_closedCompactCylinders t).mp ht).choose_spec.choose_spec.choose_spec.choose + +theorem closedCompactCylinders.eq_cylinder (ht : t ∈ closedCompactCylinders α) : + t = cylinder (closedCompactCylinders.finset ht) (closedCompactCylinders.set ht) := + ((mem_closedCompactCylinders t).mp ht).choose_spec.choose_spec.choose_spec.choose_spec + +theorem cylinder_mem_closedCompactCylinders (s : Finset ι) (S : Set (∀ i : s, α i)) + (hS_closed : IsClosed S) (hS_compact : IsCompact S) : + cylinder s S ∈ closedCompactCylinders α := by + rw [mem_closedCompactCylinders] + exact ⟨s, S, hS_closed, hS_compact, rfl⟩ + +theorem mem_cylinder_of_mem_closedCompactCylinders [∀ i, MeasurableSpace (α i)] + [∀ i, SecondCountableTopology (α i)] [∀ i, OpensMeasurableSpace (α i)] + (ht : t ∈ closedCompactCylinders α) : + t ∈ measurableCylinders α := by + rw [mem_measurableCylinders] + refine ⟨closedCompactCylinders.finset ht, closedCompactCylinders.set ht, ?_, ?_⟩ + · exact (closedCompactCylinders.isClosed ht).measurableSet + · exact closedCompactCylinders.eq_cylinder ht + +/-! We prove that the `closedCompactCylinders` are a compact system. -/ + +variable {ι : Type*} {α : ι → Type*} [∀ i, TopologicalSpace (α i)] {s : ℕ → Set (Π i, α i)} + +local notation "Js" => closedCompactCylinders.finset +local notation "As" => closedCompactCylinders.set + +section AllProj + +/-- All indices in `ι` that are constrained by the condition `∀ n, s n ∈ closedCompactCylinders α`. +That is, the union of all indices in the bases of the cylinders. -/ +def allProj (hs : ∀ n, s n ∈ closedCompactCylinders α) : Set ι := ⋃ n, Js (hs n) + +theorem subset_allProj (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : + ↑(Js (hs n)) ⊆ allProj hs := + subset_iUnion (fun i ↦ (Js (hs i) : Set ι)) n + +theorem exists_nat_proj (hs : ∀ n, s n ∈ closedCompactCylinders α) (i : ι) (hi : i ∈ allProj hs) : + ∃ n, i ∈ Js (hs n) := by + simpa only [allProj, mem_iUnion, Finset.mem_coe] using hi + +open Classical in +/-- The smallest `n` such that `i ∈ Js (hs n)`. That is, the first `n` such that `i` belongs to the +finset defining the cylinder for `s n`. -/ +noncomputable def indexProj (hs : ∀ n, s n ∈ closedCompactCylinders α) (i : allProj hs) : ℕ := + Nat.find (exists_nat_proj hs i i.2) + +open Classical in +theorem mem_indexProj (hs : ∀ n, s n ∈ closedCompactCylinders α) (i : allProj hs) : + (i : ι) ∈ Js (hs (indexProj hs i)) := + Nat.find_spec (exists_nat_proj hs i i.2) + +open Classical in +theorem indexProj_le (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) (i : Js (hs n)) : + indexProj hs ⟨i, subset_allProj hs n i.2⟩ ≤ n := + Nat.find_le i.2 + +lemma surjective_proj_allProj [∀ i, Nonempty (α i)] (hs : ∀ n, s n ∈ closedCompactCylinders α) : + Function.Surjective (fun (f : (Π i, α i)) (i : allProj hs) ↦ f (i : ι)) := by + intro y + let x := (inferInstance : Nonempty (Π i, α i)).some + classical + refine ⟨fun i ↦ if hi : i ∈ allProj hs then y ⟨i, hi⟩ else x i, ?_⟩ + ext i + simp only [Subtype.coe_prop, dite_true] + +end AllProj + +section projCylinder + +/-- Given a countable family of closed cylinders, consider one of them as depending only on +the countably many coordinates that appear in all of them. -/ +def projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : + Set (∀ i : allProj hs, α i) := + (fun (f : ∀ i : allProj hs, α i) (i : Js (hs n)) ↦ f ⟨i, subset_allProj hs _ i.2⟩) ⁻¹' (As (hs n)) + +lemma mem_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) + (x : ∀ i : allProj hs, α i) : + x ∈ projCylinder hs n ↔ (fun (i : Js (hs n)) ↦ x ⟨i, subset_allProj hs _ i.2⟩) ∈ As (hs n) := by + simp only [projCylinder, Set.mem_preimage] + +theorem preimage_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : + (fun (f : ∀ i, α i) (i : allProj hs) ↦ f i) ⁻¹' (projCylinder hs n) = s n := by + conv_rhs => rw [closedCompactCylinders.eq_cylinder (hs n)] + rfl + +lemma nonempty_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) + (n : ℕ) (hs_nonempty : (s n).Nonempty) : + (projCylinder hs n).Nonempty := by + rw [← preimage_projCylinder hs n] at hs_nonempty + exact nonempty_of_nonempty_preimage hs_nonempty + +lemma nonempty_projCylinder_iff [∀ i, Nonempty (α i)] + (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : + (projCylinder hs n).Nonempty ↔ (s n).Nonempty := by + refine ⟨fun h ↦ ?_, nonempty_projCylinder hs n⟩ + obtain ⟨x, hx⟩ := h + rw [mem_projCylinder] at hx + rw [closedCompactCylinders.eq_cylinder (hs n), MeasureTheory.cylinder] + refine Set.Nonempty.preimage ?_ ?_ + · exact ⟨_, hx⟩ + · intro y + let x := (inferInstance : Nonempty (∀ i, α i)).some + classical + refine ⟨fun i ↦ if hi : i ∈ Js (hs n) then y ⟨i, hi⟩ else x i, ?_⟩ + ext i + simp only [Finset.restrict_def, Finset.coe_mem, dite_true] + +theorem isClosed_projCylinder + (hs : ∀ n, s n ∈ closedCompactCylinders α) (hs_closed : ∀ n, IsClosed (As (hs n))) (n : ℕ) : + IsClosed (projCylinder hs n) := + (hs_closed n).preimage (by exact continuous_pi (fun i ↦ continuous_apply _)) + +end projCylinder + +section piCylinderSet + +open Classical in +/-- Given countably many closed compact cylinders, the product set which, in each relevant +coordinate, is the projection of the first cylinder for which this coordinate is relevant. -/ +def piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : + Set (∀ i : allProj hs, α i) := + {x : ∀ i : allProj hs, α i | + ∀ i, x i ∈ (fun a : ∀ j : Js (hs (indexProj hs i)), α j ↦ a ⟨i, mem_indexProj hs i⟩) '' + (As (hs (indexProj hs i)))} + +lemma mem_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) + (x : ∀ i : allProj hs, α i) : + x ∈ piCylinderSet hs ↔ + ∀ i, x i ∈ (fun a : ∀ j : Js (hs (indexProj hs i)), α j ↦ a ⟨i, mem_indexProj hs i⟩) '' + (As (hs (indexProj hs i))) := by + simp only [piCylinderSet, mem_image, Subtype.forall, mem_setOf_eq] + +theorem isCompact_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : + IsCompact (piCylinderSet hs) := + isCompact_pi_infinite fun _ ↦ + (closedCompactCylinders.isCompact (hs _)).image (continuous_apply _) + +theorem piCylinderSet_eq_pi_univ (hs : ∀ n, s n ∈ closedCompactCylinders α) : + piCylinderSet hs = + pi univ fun i ↦ + (fun a : ∀ j : Js (hs (indexProj hs i)), α j ↦ a ⟨i, mem_indexProj hs i⟩) '' + (As (hs (indexProj hs i))) := by + ext; simp only [piCylinderSet, mem_univ_pi]; rfl + +theorem isClosed_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : + IsClosed (piCylinderSet hs) := by + rw [piCylinderSet_eq_pi_univ] + exact isClosed_set_pi fun i _ ↦ IsClosed.isClosed_image_restrict_singleton _ + (closedCompactCylinders.isCompact (hs _)) (closedCompactCylinders.isClosed (hs _)) + +theorem nonempty_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) + (hs_nonempty : ∀ i, (s i).Nonempty) : + (piCylinderSet hs).Nonempty := by + have hs_nonempty' i : (As (hs i)).Nonempty := by + specialize hs_nonempty i + rw [closedCompactCylinders.eq_cylinder (hs i)] at hs_nonempty + exact nonempty_of_nonempty_preimage hs_nonempty + let b i := (hs_nonempty' (indexProj hs i)).some + have hb_mem i : b i ∈ As (hs (indexProj hs i)) := (hs_nonempty' (indexProj hs i)).choose_spec + let a : ∀ i : allProj hs, α i := fun i ↦ b i ⟨i, mem_indexProj hs i⟩ + refine ⟨a, ?_⟩ + simp only [piCylinderSet, mem_image, SetCoe.forall, mem_setOf_eq] + exact fun j hj ↦ ⟨b ⟨j, hj⟩, hb_mem _, rfl⟩ + +end piCylinderSet + +theorem iInter_subset_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : + (⋂ n, projCylinder hs n) ⊆ piCylinderSet hs := by + intro x hx + rw [mem_iInter] at hx + rw [mem_piCylinderSet] + intro i + specialize hx (indexProj hs i) + rw [mem_projCylinder] at hx + exact ⟨fun i : Js (hs (indexProj hs i)) ↦ x ⟨i, subset_allProj hs _ i.2⟩, hx, rfl⟩ + +theorem nonempty_iInter_projCylinder_inter_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) + (hs_nonempty : ∀ i, (s i).Nonempty) + (h_nonempty : ∀ n, (⋂ i ≤ n, projCylinder hs i).Nonempty) (n : ℕ) : + ((⋂ i ≤ n, projCylinder hs i) ∩ piCylinderSet hs).Nonempty := by + obtain ⟨x, hx⟩ := nonempty_piCylinderSet hs hs_nonempty + obtain ⟨y, hy⟩ := h_nonempty n + let z := fun i : allProj hs ↦ if indexProj hs i ≤ n then y i else x i + refine ⟨z, mem_inter ?_ ?_⟩ + · simp only [mem_iInter, mem_projCylinder] + intro i hi + have : (fun j : Js (hs i) ↦ + ite (indexProj hs ⟨j, subset_allProj hs i j.2⟩ ≤ n) (y ⟨j, subset_allProj hs i j.2⟩) + (x ⟨j, subset_allProj hs i j.2⟩)) = + fun j : Js (hs i) ↦ y ⟨j, subset_allProj hs i j.2⟩ := by + ext j + rw [if_pos] + refine le_trans (le_of_eq ?_) ((indexProj_le hs i j).trans hi) + congr + rw [this] + have hyi : y ∈ projCylinder hs i := by + suffices ⋂ j ≤ n, projCylinder hs j ⊆ projCylinder hs i by exact this hy + exact biInter_subset_of_mem hi + rwa [mem_projCylinder] at hyi + · rw [mem_piCylinderSet] + intro i + by_cases hi_le : indexProj hs i ≤ n + · let m := indexProj hs i + have hy' : y ∈ projCylinder hs m := by + suffices ⋂ j ≤ n, projCylinder hs j ⊆ projCylinder hs m by exact this hy + exact biInter_subset_of_mem hi_le + rw [mem_projCylinder] at hy' + refine ⟨fun j ↦ y ⟨j, subset_allProj hs _ j.2⟩, hy', ?_⟩ + simp_rw [z, if_pos hi_le] + · rw [mem_piCylinderSet] at hx + specialize hx i + obtain ⟨x', hx'_mem, hx'_eq⟩ := hx + refine ⟨x', hx'_mem, ?_⟩ + simp_rw [z, if_neg hi_le] + exact hx'_eq + +theorem nonempty_iInter_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) + (hs_nonempty : ∀ i, (s i).Nonempty) + (h_nonempty : ∀ n, (⋂ i ≤ n, projCylinder hs i).Nonempty) : + (⋂ i, projCylinder hs i).Nonempty := by + suffices ((⋂ i, projCylinder hs i) ∩ piCylinderSet hs).Nonempty by + rwa [inter_eq_left.mpr (iInter_subset_piCylinderSet hs)] at this + have : (⋂ n, projCylinder hs n) = (⋂ n, ⋂ i ≤ n, projCylinder hs i) := by + ext x + simp only [mem_iInter] + exact ⟨fun h i j _ ↦ h j, fun h i ↦ h i i le_rfl⟩ + rw [this, iInter_inter] + have h_closed : ∀ n, IsClosed (⋂ i ≤ n, projCylinder hs i) := + fun n ↦ isClosed_biInter (fun i _ ↦ isClosed_projCylinder hs + (fun n ↦ (closedCompactCylinders.isClosed (hs n))) i) + refine IsCompact.nonempty_iInter_of_sequence_nonempty_isCompact_isClosed + (fun n ↦ (⋂ i ≤ n, projCylinder hs i) ∩ piCylinderSet hs) ?_ ?_ ?_ ?_ + · refine fun i ↦ inter_subset_inter ?_ subset_rfl + simp_rw [Set.biInter_le_succ] + exact inter_subset_left + · exact fun n ↦ nonempty_iInter_projCylinder_inter_piCylinderSet hs hs_nonempty h_nonempty n + · exact (isCompact_piCylinderSet hs).inter_left (h_closed _) + · exact fun n ↦ IsClosed.inter (h_closed n) (isClosed_piCylinderSet hs) + +lemma exists_finset_iInter_projCylinder_eq_empty [∀ i, Nonempty (α i)] + (hs : ∀ n, s n ∈ closedCompactCylinders α) (h : ⋂ n, projCylinder hs n = ∅) : + ∃ t : Finset ℕ, (⋂ i ∈ t, projCylinder hs i) = ∅ := by + by_contra! h_nonempty + refine absurd h (Set.Nonempty.ne_empty ?_) + refine nonempty_iInter_projCylinder hs (fun i ↦ ?_) (fun n ↦ ?_) + · specialize h_nonempty {i} + simp only [Finset.mem_singleton, iInter_iInter_eq_left, ne_eq] at h_nonempty + rwa [nonempty_projCylinder_iff] at h_nonempty + · specialize h_nonempty (Finset.range (n + 1)) + simp only [Finset.mem_range, ne_eq, Nat.lt_succ_iff] at h_nonempty + exact h_nonempty + +/-- The `closedCompactCylinders` are a compact system. -/ +theorem isCompactSystem_closedCompactCylinders : IsCompactSystem (closedCompactCylinders α) := by + intro s hs h + by_cases hα : ∀ i, Nonempty (α i) + swap; · exact ⟨∅, by simpa [not_nonempty_iff] using hα⟩ + have h' : ⋂ n, projCylinder hs n = ∅ := by + simp_rw [← preimage_projCylinder hs, ← preimage_iInter] at h + have h_surj : Function.Surjective (fun (f : (∀ i, α i)) (i : allProj hs) ↦ f (i : ι)) := + surjective_proj_allProj hs + rwa [← not_nonempty_iff_eq_empty, ← Function.Surjective.nonempty_preimage h_surj, + not_nonempty_iff_eq_empty] + obtain ⟨t, ht⟩ := exists_finset_iInter_projCylinder_eq_empty hs h' + refine ⟨t, ?_⟩ + simp_rw [← preimage_projCylinder hs, ← preimage_iInter₂, ht, preimage_empty] + +end ClosedCompactCylinders From 43bd3e6bb550f889233c8e0049cdab00cb75f860 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Tue, 11 Mar 2025 15:17:09 +0100 Subject: [PATCH 055/129] update squareCylinder --- Mathlib/Data/Set/Prod.lean | 38 ++++ .../Constructions/Cylinders.lean | 110 ++++++---- .../Topology/Compactness/CompactSystem.lean | 205 +++++++++++++++++- 3 files changed, 298 insertions(+), 55 deletions(-) diff --git a/Mathlib/Data/Set/Prod.lean b/Mathlib/Data/Set/Prod.lean index 55aacc6e21b3a2..eb332210c1ac07 100644 --- a/Mathlib/Data/Set/Prod.lean +++ b/Mathlib/Data/Set/Prod.lean @@ -684,6 +684,21 @@ theorem pi_eq_empty_iff' : s.pi t = ∅ ↔ ∃ i ∈ s, t i = ∅ := by simp [p theorem disjoint_pi : Disjoint (s.pi t₁) (s.pi t₂) ↔ ∃ i ∈ s, Disjoint (t₁ i) (t₂ i) := by simp only [disjoint_iff_inter_eq_empty, ← pi_inter_distrib, pi_eq_empty_iff'] +theorem pi_nonempty_iff' [∀ i, Decidable (i ∈ s)] : + (s.pi t).Nonempty ↔ ∀ i ∈ s, (t i).Nonempty := by + classical + rw [pi_nonempty_iff] + have h := fun i ↦ exists_mem_of_nonempty (α i) + choose y hy using h + refine ⟨fun h i hi ↦ ?_, fun h i ↦ ?_⟩ + · obtain ⟨x, hx⟩ := h i + exact ⟨x, hx hi⟩ + · choose x hx using h + use (if g : i ∈ s then x i g else y i) + intro hi + simp only [hi, ↓reduceDIte] + exact hx i hi + end Nonempty @[simp] @@ -717,6 +732,10 @@ theorem pi_if {p : ι → Prop} [h : DecidablePred p] (s : Set ι) (t₁ t₂ : theorem union_pi : (s₁ ∪ s₂).pi t = s₁.pi t ∩ s₂.pi t := by simp [pi, or_imp, forall_and, setOf_and] +theorem pi_antitone (h : s₁ ⊆ s₂) : s₂.pi t ⊆ s₁.pi t := by + rw [← union_diff_cancel h, union_pi] + exact Set.inter_subset_left + theorem union_pi_inter (ht₁ : ∀ i ∉ s₁, t₁ i = univ) (ht₂ : ∀ i ∉ s₂, t₂ i = univ) : (s₁ ∪ s₂).pi (fun i ↦ t₁ i ∩ t₂ i) = s₁.pi t₁ ∩ s₂.pi t₂ := by @@ -865,6 +884,25 @@ theorem subset_pi_eval_image (s : Set ι) (u : Set (∀ i, α i)) : u ⊆ pi s f theorem univ_pi_ite (s : Set ι) [DecidablePred (· ∈ s)] (t : ∀ i, Set (α i)) : (pi univ fun i => if i ∈ s then t i else univ) = s.pi t := by grind +lemma pi_image_eq_of_subset {C : (i : ι) → Set (Set (α i))} + (hC : ∀ i, Nonempty (C i)) + {s₁ s₂ : Set ι} [∀ i : ι, Decidable (i ∈ s₁)] + (hst : s₁ ⊆ s₂) : s₁.pi '' s₁.pi C = s₁.pi '' s₂.pi C := by + let C_mem (i : ι) : Set (α i) := ((Set.exists_mem_of_nonempty (C i)).choose : Set (α i)) + have h_mem (i : ι) : C_mem i ∈ C i := by + simp [C_mem] + ext f + refine ⟨fun ⟨x, ⟨hx1, hx2⟩⟩ ↦ ?_, fun ⟨w, ⟨hw1, hw2⟩⟩ ↦ ?_⟩ + · use fun i ↦ if i ∈ s₁ then x i else C_mem i + refine ⟨fun i hi ↦ ?_, ?_⟩ + · by_cases h1 : i ∈ s₁ <;> simp only [h1, ↓reduceIte] + · exact hx1 i h1 + · exact h_mem i + · rw [← hx2] + exact pi_congr rfl (fun i hi ↦ by simp only [hi, ↓reduceIte]) + · have hw3 := pi_antitone hst hw1 + use w + end Pi end Set diff --git a/Mathlib/MeasureTheory/Constructions/Cylinders.lean b/Mathlib/MeasureTheory/Constructions/Cylinders.lean index 8e875f88c89697..9ae60553d51162 100644 --- a/Mathlib/MeasureTheory/Constructions/Cylinders.lean +++ b/Mathlib/MeasureTheory/Constructions/Cylinders.lean @@ -3,6 +3,7 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber, Yaël Dillies, Kin Yau James Wong -/ +import Mathlib.Data.Finset.Lattice.Basic import Mathlib.MeasureTheory.SetSemiring import Mathlib.Topology.Constructions @@ -23,6 +24,8 @@ Given a finite set `s` of indices, a cylinder is the product of a set of `∀ i a product set. * `cylinder s S`: cylinder with base set `S : Set (∀ i : s, α i)` where `s` is a `Finset` +* `squareCylinder s S`: square cylinder with base set `S : (∀ i : s, Set (α i))` where + `s` is a `Finset` * `squareCylinders C` with `C : ∀ i, Set (Set (α i))`: set of all square cylinders such that for all `i` in the finset defining the box, the projection to `α i` belongs to `C i`. The main application of this is with `C i = {s : Set (α i) | MeasurableSet s}`. @@ -47,62 +50,74 @@ variable {ι : Type _} {α : ι → Type _} section squareCylinders -/-- Given a finite set `s` of indices, a square cylinder is the product of a set `S` of -`∀ i : s, α i` and of `univ` on the other indices. The set `S` is a product of sets `t i` such that +/-- Given a finite set `s` of indices, a square cylinder is the product of sets `t i : Set (α i)` +for `i ∈ s` and of `univ` on the other indices. -/ +def squareCylinder (s : Finset ι) (t : ∀ i, Set (α i)) : Set (∀ i, α i) := + (s : Set ι).pi t + +/-- The set `S` is a product of sets `t i` such that for all `i : s`, `t i ∈ C i`. `squareCylinders` is the set of all such squareCylinders. -/ def squareCylinders (C : ∀ i, Set (Set (α i))) : Set (Set (∀ i, α i)) := - {S | ∃ s : Finset ι, ∃ t ∈ univ.pi C, S = (s : Set ι).pi t} + {S | ∃ s : Finset ι, ∃ t ∈ univ.pi C, S = squareCylinder s t} theorem squareCylinders_eq_iUnion_image (C : ∀ i, Set (Set (α i))) : - squareCylinders C = ⋃ s : Finset ι, (fun t ↦ (s : Set ι).pi t) '' univ.pi C := by + squareCylinders C = ⋃ s : Finset ι, (s : Set ι).pi '' univ.pi C := by ext1 f - simp only [squareCylinders, mem_iUnion, mem_image, mem_univ_pi, mem_setOf_eq, - eq_comm (a := f)] + simp only [squareCylinder, squareCylinders, mem_iUnion, mem_image, mem_univ_pi, exists_prop, + mem_setOf_eq, eq_comm (a := f)] -theorem isPiSystem_squareCylinders {C : ∀ i, Set (Set (α i))} (hC : ∀ i, IsPiSystem (C i)) - (hC_univ : ∀ i, univ ∈ C i) : - IsPiSystem (squareCylinders C) := by - rintro S₁ ⟨s₁, t₁, h₁, rfl⟩ S₂ ⟨s₂, t₂, h₂, rfl⟩ hst_nonempty +theorem squareCylinders_eq_iUnion_image' (C : ∀ i, Set (Set (α i))) (hC : ∀ i, Nonempty (C i)) : + squareCylinders C = ⋃ s : Finset ι, (s : Set ι).pi '' (s : Set ι).pi C := by classical + ext1 f + simp only [squareCylinder, squareCylinders, mem_iUnion, mem_image, mem_setOf_eq, eq_comm (a := f)] + have h (s : Set ι): s.pi '' s.pi C = s.pi '' univ.pi C := by + refine pi_image_eq_of_subset hC (subset_univ s) + simp_rw [← mem_image, h] + +theorem isPiSystem_squareCylinders [∀ i, Inhabited (α i)] {C : ∀ i, Set (Set (α i))} + (hC : ∀ i, IsPiSystem (C i)) (hC_univ : ∀ i, univ ∈ C i) : IsPiSystem (squareCylinders C) := by + classical + haveI h_nempty : ∀ i, Nonempty (C i) := fun i ↦ Nonempty.intro ⟨Set.univ, hC_univ i⟩ + rintro S₁ ⟨s₁, t₁, h₁, rfl⟩ S₂ ⟨s₂, t₂, h₂, rfl⟩ hst_nonempty let t₁' := s₁.piecewise t₁ (fun i ↦ univ) + simp only [Set.mem_pi, Set.mem_univ, forall_const] at h₁ h₂ + have ht₁ (i : ι) : t₁' i ∈ C i := by + by_cases h : i ∈ s₁ + · simp only [h, Finset.piecewise_eq_of_mem, t₁'] + exact h₁ i + · simp only [t₁'] + rw [Finset.piecewise_eq_of_not_mem s₁ t₁ (fun i ↦ univ) h] + exact hC_univ i let t₂' := s₂.piecewise t₂ (fun i ↦ univ) - have h1 : ∀ i ∈ (s₁ : Set ι), t₁ i = t₁' i := - fun i hi ↦ (Finset.piecewise_eq_of_mem _ _ _ hi).symm - have h1' : ∀ i ∉ (s₁ : Set ι), t₁' i = univ := - fun i hi ↦ Finset.piecewise_eq_of_notMem _ _ _ hi - have h2 : ∀ i ∈ (s₂ : Set ι), t₂ i = t₂' i := - fun i hi ↦ (Finset.piecewise_eq_of_mem _ _ _ hi).symm - have h2' : ∀ i ∉ (s₂ : Set ι), t₂' i = univ := - fun i hi ↦ Finset.piecewise_eq_of_notMem _ _ _ hi - rw [Set.pi_congr rfl h1, Set.pi_congr rfl h2, ← union_pi_inter h1' h2'] - refine ⟨s₁ ∪ s₂, fun i ↦ t₁' i ∩ t₂' i, ?_, ?_⟩ - · rw [mem_univ_pi] - intro i - have : (t₁' i ∩ t₂' i).Nonempty := by - obtain ⟨f, hf⟩ := hst_nonempty - rw [Set.pi_congr rfl h1, Set.pi_congr rfl h2, mem_inter_iff, mem_pi, mem_pi] at hf - refine ⟨f i, ⟨?_, ?_⟩⟩ - · by_cases hi₁ : i ∈ s₁ - · exact hf.1 i hi₁ - · rw [h1' i hi₁] - exact mem_univ _ - · by_cases hi₂ : i ∈ s₂ - · exact hf.2 i hi₂ - · rw [h2' i hi₂] - exact mem_univ _ - refine hC i _ ?_ _ ?_ this - · by_cases hi₁ : i ∈ s₁ - · rw [← h1 i hi₁] - exact h₁ i (mem_univ _) - · rw [h1' i hi₁] - exact hC_univ i - · by_cases hi₂ : i ∈ s₂ - · rw [← h2 i hi₂] - exact h₂ i (mem_univ _) - · rw [h2' i hi₂] - exact hC_univ i - · rw [Finset.coe_union] + have ht₂ (i : ι) : t₂' i ∈ C i := by + by_cases h : i ∈ s₂ + · simp only [h, Finset.piecewise_eq_of_mem, t₂'] + exact h₂ i + · simp only [t₂'] + rw [Finset.piecewise_eq_of_not_mem s₂ t₂ (fun i ↦ univ) h] + exact hC_univ i + have h₁ : (s₁ : Set ι).pi t₁' = (s₁ : Set ι).pi t₁ := by + refine Set.pi_congr rfl ?_ + exact fun i a ↦ (s₁.piecewise_eq_of_mem t₁ (fun i ↦ Set.univ) a) + have h₂ : (s₂ : Set ι).pi t₂' = (s₂ : Set ι).pi t₂ := by + refine Set.pi_congr rfl ?_ + exact fun i a ↦ (s₂.piecewise_eq_of_mem t₂ (fun i ↦ Set.univ) a) + have h : squareCylinder s₁ t₁ ∩ squareCylinder s₂ t₂ = squareCylinder (s₁ ∪ s₂) + (fun i ↦ t₁' i ∩ t₂' i) := by + rw [squareCylinder, squareCylinder, squareCylinder, Finset.coe_union, union_pi_inter, h₁, h₂] + <;> + exact fun i a ↦ Finset.piecewise_eq_of_not_mem _ _ (fun i ↦ Set.univ) a + rw [h] at hst_nonempty ⊢ + rw [squareCylinder, squareCylinders_eq_iUnion_image' C, mem_iUnion] + · use (s₁ ∪ s₂), (fun i ↦ t₁' i ∩ t₂' i) + refine ⟨?_, rfl⟩ + apply fun i _ ↦ hC i (t₁' i) (ht₁ i) (t₂' i) (ht₂ i) _ + intro i hi + rw [squareCylinder, pi_nonempty_iff'] at hst_nonempty + exact hst_nonempty i hi + · assumption theorem comap_eval_le_generateFrom_squareCylinders_singleton (α : ι → Type*) [m : ∀ i, MeasurableSpace (α i)] (i : ι) : @@ -123,7 +138,7 @@ theorem comap_eval_le_generateFrom_squareCylinders_singleton · simp only [hji, not_false_iff, dif_neg, MeasurableSet.univ] · simp only [eq_mpr_eq_cast, ← h] ext1 x - simp only [Function.eval, cast_eq, dite_eq_ite, ite_true, mem_preimage] + simp only [singleton_pi, Function.eval, cast_eq, dite_eq_ite, ite_true, Set.mem_preimage] /-- The square cylinders formed from measurable sets generate the product σ-algebra. -/ theorem generateFrom_squareCylinders [∀ i, MeasurableSpace (α i)] : @@ -476,4 +491,5 @@ lemma measurable_restrict_cylinderEvents (Δ : Set ι) : rw [@measurable_pi_iff]; exact fun i ↦ measurable_cylinderEvent_apply i.2 end cylinderEvents + end MeasureTheory diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 92eebdf644414d..7ff281a1c316e1 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -28,9 +28,7 @@ system iff inserting `univ` gives a compact system. is a compact system in a `T2Space`. -/ -open Set Finset Nat MeasureTheory - -section definition +open Set Nat MeasureTheory variable {α : Type*} {p : Set α → Prop} {C : ℕ → Set α} @@ -45,9 +43,11 @@ end definition namespace IsCompactSystem -open Classical in -/-- In a compact system, given a countable family with `⋂ i, C i = ∅`, we choose the smallest `n` -with `⋂ (i ≤ n), C i = ∅`. -/ +theorem isCompactSystem_subset (C D : Set (Set α)) (hC : IsCompactSystem C) (h : D ⊆ C) : + IsCompactSystem D := fun s hD hs ↦ hC s (fun i ↦ h (hD i)) hs + +/-- In a compact system, given a countable family with empty intersection, we choose a finite +subfamily with empty intersection. -/ noncomputable def finite_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) (hC_empty : ⋂ i, C i = ∅) : ℕ := @@ -284,6 +284,194 @@ end IsCompactIsClosed end ClosedCompact +section ClosedCompactSquareCylinders + +variable {ι : Type*} {α : ι → Type*} + +variable [∀ i, TopologicalSpace (α i)] + +variable (α) +def closedCompactSquareCylinders : Set (Set (Π i, α i)) := + ⋃ (s) (t) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), {squareCylinder s t} + +variable {α} +@[simp] +theorem mem_closedCompactSquareCylinders (S : Set (Π i, α i)) : + S ∈ closedCompactSquareCylinders α + ↔ ∃ (s t : _) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), + S = squareCylinder s t := by + simp_rw [closedCompactSquareCylinders, mem_iUnion, mem_singleton_iff] + +variable {S : Set (Π i, α i)} + +/-- Note that in `closedCompactSquareCylinders α`, the set of dependent variables is a finset, + but not necessarily in `univ.pi '' univ.pi C`. -/ +theorem closedCompactSquareCylinders_supset (C : (i : ι) → Set (Set (α i))) + (hC : ∀ (i : ι), C i = (fun s : Set (α i) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ))) : + closedCompactSquareCylinders α ⊆ univ.pi '' univ.pi C := by + classical + intro S hS + simp_rw [mem_closedCompactSquareCylinders, squareCylinder] at hS + simp only [mem_image, mem_pi, mem_univ, forall_const] + obtain ⟨s, t, h_cl, h_co, h_pi⟩ := hS + let t' := fun (i : ι) ↦ if (i ∈ s) then (t i) else univ + refine ⟨t', ?_, ?_⟩ + · simp_rw [hC] + intro i + by_cases hi : i ∈ s + · simp only [hi, ↓reduceIte, t'] + apply Or.inl + exact ⟨h_co i hi, h_cl i hi⟩ + · simp only [hi, ↓reduceIte, t'] + apply Or.inr rfl + · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = S + rw [h_pi, univ_pi_ite s t] + +/-- Given a closed compact cylinder, choose a finset of variables such that it only depends on +these variables. -/ +noncomputable def closedCompactSquareCylinders.finset (hS : S ∈ closedCompactSquareCylinders α) : + Finset ι := + ((mem_closedCompactSquareCylinders S).mp hS).choose + +/-- Given a closed compact square cylinder `S`, choose a dependent function `(i : ι) → Set (α i)` +of which it is a lift. -/ +def closedCompactSquareCylinders.func (hS : S ∈ closedCompactSquareCylinders α) : + (i : ι) → Set (α i) := + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose + +theorem closedCompactSquareCylinders.isClosed (hS : S ∈ closedCompactSquareCylinders α) : + ∀ i ∈ closedCompactSquareCylinders.finset hS, + IsClosed (closedCompactSquareCylinders.func hS i) := + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose + +theorem closedCompactSquareCylinders.isCompact (hS : S ∈ closedCompactSquareCylinders α) : + ∀ i ∈ closedCompactSquareCylinders.finset hS, + IsCompact (closedCompactSquareCylinders.func hS i) := + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose + +theorem closedCompactSquareCylinders.eq_squareCylinder (hS : S ∈ closedCompactSquareCylinders α) : + S = squareCylinder (closedCompactSquareCylinders.finset hS) + (closedCompactSquareCylinders.func hS) := + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose_spec + +theorem squareCylinder_mem_closedCompactSquareCylinders (s : Finset ι) (t : (i : ι) → Set (α i)) + (hS_closed : ∀ i ∈ s, IsClosed (t i)) (hS_compact : ∀ i ∈ s, IsCompact (t i)) : + squareCylinder s t ∈ closedCompactSquareCylinders α := by + rw [mem_closedCompactSquareCylinders] + exact ⟨s, t, hS_closed, hS_compact, rfl⟩ + +/- +theorem mem_cylinder_of_mem_closedCompactSquareCylinders [∀ i, MeasurableSpace (α i)] + [∀ i, SecondCountableTopology (α i)] [∀ i, OpensMeasurableSpace (α i)] + (hS : S ∈ closedCompactSquareCylinders α) : + S ∈ measurableCylinders α := by + rw [mem_measurableSquareCylinders] + refine ⟨closedCompactCylinders.finset ht, closedCompactCylinders.set ht, ?_, ?_⟩ + · exact (closedCompactCylinders.isClosed ht).measurableSet + · exact closedCompactCylinders.eq_cylinder ht +-/ + +section pi + +example (P Q : Prop) : (P ↔ Q) ↔ (¬ P ↔ ¬ Q) := by exact Iff.symm not_iff_not + + +theorem iInter_pi_empty_iff {β : Type*} (s : β → Set ι) (t : β → (i : ι) → Set (α i)) : + ( ⋂ b, ((s b).pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β) (_: i ∈ s b), (t b i) = ∅):= by + rw [iInter_eq_empty_iff, not_iff_not.symm] + push_neg + refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ + · have ⟨x, hx⟩ := h + simp only [nonempty_iInter] + intro i + refine ⟨x i, fun j ↦ ?_⟩ + rw [mem_iInter] + intro hi + simp_rw [mem_pi] at hx + exact hx j i hi + · simp only [nonempty_iInter, mem_iInter] at h + choose x hx using h + use x + simp_rw [mem_pi] + intro i + intro j hj + exact hx j i hj + +theorem iInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) : + ( ⋂ b, (univ.pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β), (t b i) = ∅):= by + rw [iInter_pi_empty_iff] + simp only [mem_univ, iInter_true] + +theorem biInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) (p : β → Prop): + ( ⋂ (b : β), ⋂ (_ : p b), (univ.pi (t b)) = ∅) ↔ + (∃ i : ι, ⋂ (b : β), ⋂ (_ : p b), (t b i) = ∅) := by + have h : ⋂ (b : β), ⋂ (_ : p b), (univ.pi (t b)) = + ⋂ (b : { (b' : β) | p b' }), (univ.pi (t b.val)) := by + exact biInter_eq_iInter p fun x h ↦ univ.pi (t x) + have h' (i : ι) : ⋂ (b : β), ⋂ (_ : p b), t b i = ⋂ (b : { (b' : β) | p b' }), t b.val i := by + exact biInter_eq_iInter p fun x h ↦ t x i + simp_rw [h, h', iInter_univ_pi_empty_iff] + +theorem isCompactSystem_pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : + IsCompactSystem (univ.pi '' univ.pi C) := by + intro S hS h_empty + change ∀ i, S i ∈ univ.pi '' univ.pi C at hS + simp only [mem_image, mem_pi, mem_univ, forall_const] at hS + choose x hx1 hx2 using hS + simp_rw [← hx2] at h_empty ⊢ + simp_rw [iInter_univ_pi_empty_iff x] at h_empty + obtain ⟨i, hi⟩ := h_empty + let y := (fun b ↦ x b i) + have hy (b : ℕ) : y b ∈ C i := by + simp only [y] + exact hx1 b i + have ⟨n, hn⟩ := (hC i) y hy hi + use n + simp_rw [Dissipate, ← hx2] at hn ⊢ + rw [biInter_univ_pi_empty_iff x] + use i + +theorem isCompactSystem_CompactClosedOrUniv (C : (i : ι) → Set (Set (α i))) + (hC : ∀ (i : ι), C i = (fun s : Set (α i) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ))) : + IsCompactSystem (univ.pi '' univ.pi C) := by + intro S hS h_empty + change ∀ i, S i ∈ univ.pi '' univ.pi C at hS + simp only [mem_image, mem_pi, mem_univ, forall_const] at hS + choose x hx1 hx2 using hS + simp_rw [← hx2] at h_empty ⊢ + simp_rw [iInter_univ_pi_empty_iff x] at h_empty + obtain ⟨i, hi⟩ := h_empty + + sorry + +end pi + +variable [∀ i, Nonempty (α i)] + + + + + + +theorem isCompactSystem_closedCompactSquareCylinders [∀ i, Nonempty (α i)]: + IsCompactSystem (closedCompactSquareCylinders α) := by + + intro S hS h + have h' : ∀ i, S i ∈ closedCompactSquareCylinders α := by exact fun i ↦ hS i + simp_rw [mem_closedCompactSquareCylinders] at h' + choose s t h_cl h_co hS using h' + simp_rw [Dissipate, hS, squareCylinder] at h ⊢ + simp_rw [pi_eq_empty_iff'] at h + + + + + + sorry + + +end ClosedCompactSquareCylinders + section ClosedCompactCylinders @@ -477,8 +665,9 @@ theorem piCylinderSet_eq_pi_univ (hs : ∀ n, s n ∈ closedCompactCylinders α) theorem isClosed_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : IsClosed (piCylinderSet hs) := by rw [piCylinderSet_eq_pi_univ] - exact isClosed_set_pi fun i _ ↦ IsClosed.isClosed_image_restrict_singleton _ - (closedCompactCylinders.isCompact (hs _)) (closedCompactCylinders.isClosed (hs _)) + sorry + --exact isClosed_set_pi fun i _ ↦ IsClosed.isClosed_image_restrict_singleton _ + -- (closedCompactCylinders.isCompact (hs _)) (closedCompactCylinders.isClosed (hs _)) theorem nonempty_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) (hs_nonempty : ∀ i, (s i).Nonempty) : From 73c8d749e7344e29b34beac8fab04393f93899ce Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Tue, 11 Mar 2025 23:49:50 +0100 Subject: [PATCH 056/129] compactClosedSquareCylinders are a compact system --- .../Topology/Compactness/CompactSystem.lean | 556 ++++-------------- 1 file changed, 115 insertions(+), 441 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 7ff281a1c316e1..64acc21d451cd9 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -26,6 +26,8 @@ system iff inserting `univ` gives a compact system. * `IsClosedCompact.isCompactSystem`: The set of closed and compact sets is a compact system. * `IsClosedCompact.isCompactSystem_of_T2Space`: In a `T2Space α`, the set of compact sets is a compact system in a `T2Space`. +* `IsCompactSystem.closedCompactSquareCylinders`: Closed and compact square cylinders form a + compact system. -/ open Set Nat MeasureTheory @@ -43,9 +45,6 @@ end definition namespace IsCompactSystem -theorem isCompactSystem_subset (C D : Set (Set α)) (hC : IsCompactSystem C) (h : D ⊆ C) : - IsCompactSystem D := fun s hD hs ↦ hC s (fun i ↦ h (hD i)) hs - /-- In a compact system, given a countable family with empty intersection, we choose a finite subfamily with empty intersection. -/ noncomputable @@ -223,17 +222,30 @@ theorem iff_directed' (hpi : IsPiSystem p) : · exact h1 C h3 h4 · exact h1 C h3 s -section IsCompactIsClosed +/-- Any subset of a compact system is a compact system. -/ +theorem of_supset {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : + IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs + -variable {α : Type*} [TopologicalSpace α] +section ClosedCompact -/-- The set of compact and closed sets is a compact system. -/ -theorem of_isCompact_isClosed : - IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by - let p := fun (s : Set α) ↦ IsCompact s ∧ IsClosed s - have h2 : IsPiSystem p := by - intro s hs t ht _ - refine ⟨IsCompact.inter_left ht.1 hs.2, IsClosed.inter hs.2 ht.2⟩ +variable (α : Type*) [TopologicalSpace α] + +/-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ +theorem isClosedCompactOrUnivs : + IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by + let p := fun (s : Set α) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ) + have h2 : ∀ (s t : Set α), p s → p t → p (s ∩ t) := by + intro s t hs ht + by_cases hs' : s = univ + · rw [hs', univ_inter] + exact ht + · by_cases ht' : t = univ + · rw [ht', inter_comm, univ_inter] + exact hs + · exact Or.inl <| ⟨IsCompact.inter_right (Or.resolve_right hs hs').1 + (Or.resolve_right ht ht').2, IsClosed.inter (Or.resolve_right hs hs').2 + (Or.resolve_right ht ht').2⟩ rw [IsCompactSystem.iff_directed' h2] intro s hs h1 h2 let s' := fun (i : { j : ℕ | s j ≠ univ}) ↦ s i @@ -263,118 +275,33 @@ theorem of_isCompact_isClosed : simp only [Set.mem_univ] apply g <| IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed s' hs' (fun j ↦ h2 j) htco htcl - · simp only [ne_eq, coe_setOf, nonempty_subtype, not_exists, not_not] at h - simp [h] + · simp only [ne_eq, coe_setOf, nonempty_subtype, not_exists, not_not, s'] at h + simp only [nonempty_iInter, s', h] + simp only [Set.mem_univ, implies_true, exists_const, s'] -/-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ -theorem of_isCompact_isClosed_or_univ : - IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by - rw [← iff_isCompactSystem_of_or_univ] - exact of_isCompact_isClosed +/-- The set of compact and closed sets is a compact system. -/ +theorem isClosedCompacts : + IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := + IsCompactSystem.of_supset (isClosedCompactOrUnivs α) (fun _ hs ↦ Or.inl hs) -/-- In a `T2Space` the set of compact sets is a compact system. -/ -theorem of_isCompact [T2Space α] : +theorem isCompacts (h : ∀ {s : Set α}, IsCompact s → IsClosed s) : IsCompactSystem (fun s : Set α ↦ IsCompact s) := by have h : (fun s : Set α ↦ IsCompact s) = (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by ext s - refine ⟨fun h' ↦ ⟨h', h'.isClosed⟩, fun h ↦ h.1⟩ - exact h ▸ (of_isCompact_isClosed) + refine ⟨fun h' ↦ ⟨h', h h'⟩, fun h' ↦ h'.1⟩ + exact h ▸ (isClosedCompacts α) -end IsCompactIsClosed +/-- In a `T2Space` The set of compact sets is a compact system. -/ +theorem _of_isCompact_of_T2Space [T2Space α] : + IsCompactSystem (fun s : Set α ↦ IsCompact s) := (isCompacts α) (fun hs ↦ hs.isClosed) end ClosedCompact -section ClosedCompactSquareCylinders - -variable {ι : Type*} {α : ι → Type*} - -variable [∀ i, TopologicalSpace (α i)] - -variable (α) -def closedCompactSquareCylinders : Set (Set (Π i, α i)) := - ⋃ (s) (t) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), {squareCylinder s t} - -variable {α} -@[simp] -theorem mem_closedCompactSquareCylinders (S : Set (Π i, α i)) : - S ∈ closedCompactSquareCylinders α - ↔ ∃ (s t : _) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), - S = squareCylinder s t := by - simp_rw [closedCompactSquareCylinders, mem_iUnion, mem_singleton_iff] - -variable {S : Set (Π i, α i)} - -/-- Note that in `closedCompactSquareCylinders α`, the set of dependent variables is a finset, - but not necessarily in `univ.pi '' univ.pi C`. -/ -theorem closedCompactSquareCylinders_supset (C : (i : ι) → Set (Set (α i))) - (hC : ∀ (i : ι), C i = (fun s : Set (α i) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ))) : - closedCompactSquareCylinders α ⊆ univ.pi '' univ.pi C := by - classical - intro S hS - simp_rw [mem_closedCompactSquareCylinders, squareCylinder] at hS - simp only [mem_image, mem_pi, mem_univ, forall_const] - obtain ⟨s, t, h_cl, h_co, h_pi⟩ := hS - let t' := fun (i : ι) ↦ if (i ∈ s) then (t i) else univ - refine ⟨t', ?_, ?_⟩ - · simp_rw [hC] - intro i - by_cases hi : i ∈ s - · simp only [hi, ↓reduceIte, t'] - apply Or.inl - exact ⟨h_co i hi, h_cl i hi⟩ - · simp only [hi, ↓reduceIte, t'] - apply Or.inr rfl - · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = S - rw [h_pi, univ_pi_ite s t] - -/-- Given a closed compact cylinder, choose a finset of variables such that it only depends on -these variables. -/ -noncomputable def closedCompactSquareCylinders.finset (hS : S ∈ closedCompactSquareCylinders α) : - Finset ι := - ((mem_closedCompactSquareCylinders S).mp hS).choose - -/-- Given a closed compact square cylinder `S`, choose a dependent function `(i : ι) → Set (α i)` -of which it is a lift. -/ -def closedCompactSquareCylinders.func (hS : S ∈ closedCompactSquareCylinders α) : - (i : ι) → Set (α i) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose - -theorem closedCompactSquareCylinders.isClosed (hS : S ∈ closedCompactSquareCylinders α) : - ∀ i ∈ closedCompactSquareCylinders.finset hS, - IsClosed (closedCompactSquareCylinders.func hS i) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose - -theorem closedCompactSquareCylinders.isCompact (hS : S ∈ closedCompactSquareCylinders α) : - ∀ i ∈ closedCompactSquareCylinders.finset hS, - IsCompact (closedCompactSquareCylinders.func hS i) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose - -theorem closedCompactSquareCylinders.eq_squareCylinder (hS : S ∈ closedCompactSquareCylinders α) : - S = squareCylinder (closedCompactSquareCylinders.finset hS) - (closedCompactSquareCylinders.func hS) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose_spec - -theorem squareCylinder_mem_closedCompactSquareCylinders (s : Finset ι) (t : (i : ι) → Set (α i)) - (hS_closed : ∀ i ∈ s, IsClosed (t i)) (hS_compact : ∀ i ∈ s, IsCompact (t i)) : - squareCylinder s t ∈ closedCompactSquareCylinders α := by - rw [mem_closedCompactSquareCylinders] - exact ⟨s, t, hS_closed, hS_compact, rfl⟩ - -/- -theorem mem_cylinder_of_mem_closedCompactSquareCylinders [∀ i, MeasurableSpace (α i)] - [∀ i, SecondCountableTopology (α i)] [∀ i, OpensMeasurableSpace (α i)] - (hS : S ∈ closedCompactSquareCylinders α) : - S ∈ measurableCylinders α := by - rw [mem_measurableSquareCylinders] - refine ⟨closedCompactCylinders.finset ht, closedCompactCylinders.set ht, ?_, ?_⟩ - · exact (closedCompactCylinders.isClosed ht).measurableSet - · exact closedCompactCylinders.eq_cylinder ht --/ +end IsCompactSystem section pi -example (P Q : Prop) : (P ↔ Q) ↔ (¬ P ↔ ¬ Q) := by exact Iff.symm not_iff_not - +variable {ι : Type*} {α : ι → Type*} theorem iInter_pi_empty_iff {β : Type*} (s : β → Set ι) (t : β → (i : ι) → Set (α i)) : ( ⋂ b, ((s b).pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β) (_: i ∈ s b), (t b i) = ∅):= by @@ -412,7 +339,7 @@ theorem biInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α exact biInter_eq_iInter p fun x h ↦ t x i simp_rw [h, h', iInter_univ_pi_empty_iff] -theorem isCompactSystem_pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : +theorem IsCompactSystem.pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : IsCompactSystem (univ.pi '' univ.pi C) := by intro S hS h_empty change ∀ i, S i ∈ univ.pi '' univ.pi C at hS @@ -431,359 +358,106 @@ theorem isCompactSystem_pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCo rw [biInter_univ_pi_empty_iff x] use i -theorem isCompactSystem_CompactClosedOrUniv (C : (i : ι) → Set (Set (α i))) - (hC : ∀ (i : ι), C i = (fun s : Set (α i) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ))) : - IsCompactSystem (univ.pi '' univ.pi C) := by - intro S hS h_empty - change ∀ i, S i ∈ univ.pi '' univ.pi C at hS - simp only [mem_image, mem_pi, mem_univ, forall_const] at hS - choose x hx1 hx2 using hS - simp_rw [← hx2] at h_empty ⊢ - simp_rw [iInter_univ_pi_empty_iff x] at h_empty - obtain ⟨i, hi⟩ := h_empty - - sorry - end pi -variable [∀ i, Nonempty (α i)] - - - - - - -theorem isCompactSystem_closedCompactSquareCylinders [∀ i, Nonempty (α i)]: - IsCompactSystem (closedCompactSquareCylinders α) := by - - intro S hS h - have h' : ∀ i, S i ∈ closedCompactSquareCylinders α := by exact fun i ↦ hS i - simp_rw [mem_closedCompactSquareCylinders] at h' - choose s t h_cl h_co hS using h' - simp_rw [Dissipate, hS, squareCylinder] at h ⊢ - simp_rw [pi_eq_empty_iff'] at h - - - - - - sorry - - -end ClosedCompactSquareCylinders - -section ClosedCompactCylinders - +section ClosedCompactSquareCylinders variable {ι : Type*} {α : ι → Type*} variable [∀ i, TopologicalSpace (α i)] variable (α) +/-- The set of sets of the form `s.pi t`, where `s : Finset ι` and `t i` is both, +closed and compact, for all `i ∈ s`. -/ +def closedCompactSquareCylinders : Set (Set (Π i, α i)) := + ⋃ (s) (t) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), {squareCylinder s t} -/-- The set of all cylinders based on closed compact sets. Note that such a set is closed, but -not compact in general (for instance, the whole space is always a closed compact cylinder). -/ -def closedCompactCylinders : Set (Set (Π i, α i)) := - ⋃ (s) (S) (_ : IsClosed S) (_ : IsCompact S), {cylinder s S} - -theorem empty_mem_closedCompactCylinders : ∅ ∈ closedCompactCylinders α := by - simp_rw [closedCompactCylinders, mem_iUnion, mem_singleton_iff] - exact ⟨∅, ∅, isClosed_empty, isCompact_empty, (cylinder_empty _).symm⟩ - -variable {α} {t : Set (Π i, α i)} - +variable {α} @[simp] -theorem mem_closedCompactCylinders (t : Set (Π i, α i)) : - t ∈ closedCompactCylinders α - ↔ ∃ (s S : _) (_ : IsClosed S) (_ : IsCompact S), t = cylinder s S := by - simp_rw [closedCompactCylinders, mem_iUnion, mem_singleton_iff] +theorem mem_closedCompactSquareCylinders (S : Set (Π i, α i)) : + S ∈ closedCompactSquareCylinders α + ↔ ∃ (s t : _) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), + S = squareCylinder s t := by + simp_rw [closedCompactSquareCylinders, mem_iUnion, mem_singleton_iff] + +variable {S : Set (Π i, α i)} /-- Given a closed compact cylinder, choose a finset of variables such that it only depends on these variables. -/ -noncomputable def closedCompactCylinders.finset (ht : t ∈ closedCompactCylinders α) : +noncomputable def closedCompactSquareCylinders.finset (hS : S ∈ closedCompactSquareCylinders α) : Finset ι := - ((mem_closedCompactCylinders t).mp ht).choose + ((mem_closedCompactSquareCylinders S).mp hS).choose -/-- Given a closed compact cylinder, choose a set depending on finitely many variables of which it -is a lift. -/ -def closedCompactCylinders.set (ht : t ∈ closedCompactCylinders α) : - Set (∀ i : closedCompactCylinders.finset ht, α i) := - ((mem_closedCompactCylinders t).mp ht).choose_spec.choose +/-- Given a closed compact square cylinder `S`, choose a dependent function `(i : ι) → Set (α i)` +of which it is a lift. -/ +def closedCompactSquareCylinders.func (hS : S ∈ closedCompactSquareCylinders α) : + (i : ι) → Set (α i) := + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose -theorem closedCompactCylinders.isClosed (ht : t ∈ closedCompactCylinders α) : - IsClosed (closedCompactCylinders.set ht) := - ((mem_closedCompactCylinders t).mp ht).choose_spec.choose_spec.choose +theorem closedCompactSquareCylinders.isClosed (hS : S ∈ closedCompactSquareCylinders α) : + ∀ i ∈ closedCompactSquareCylinders.finset hS, + IsClosed (closedCompactSquareCylinders.func hS i) := + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose -theorem closedCompactCylinders.isCompact (ht : t ∈ closedCompactCylinders α) : - IsCompact (closedCompactCylinders.set ht) := - ((mem_closedCompactCylinders t).mp ht).choose_spec.choose_spec.choose_spec.choose +theorem closedCompactSquareCylinders.isCompact (hS : S ∈ closedCompactSquareCylinders α) : + ∀ i ∈ closedCompactSquareCylinders.finset hS, + IsCompact (closedCompactSquareCylinders.func hS i) := + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose -theorem closedCompactCylinders.eq_cylinder (ht : t ∈ closedCompactCylinders α) : - t = cylinder (closedCompactCylinders.finset ht) (closedCompactCylinders.set ht) := - ((mem_closedCompactCylinders t).mp ht).choose_spec.choose_spec.choose_spec.choose_spec +theorem closedCompactSquareCylinders.eq_squareCylinder (hS : S ∈ closedCompactSquareCylinders α) : + S = squareCylinder (closedCompactSquareCylinders.finset hS) + (closedCompactSquareCylinders.func hS) := + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose_spec -theorem cylinder_mem_closedCompactCylinders (s : Finset ι) (S : Set (∀ i : s, α i)) - (hS_closed : IsClosed S) (hS_compact : IsCompact S) : - cylinder s S ∈ closedCompactCylinders α := by - rw [mem_closedCompactCylinders] - exact ⟨s, S, hS_closed, hS_compact, rfl⟩ +theorem squareCylinder_mem_closedCompactSquareCylinders (s : Finset ι) (t : (i : ι) → Set (α i)) + (hS_closed : ∀ i ∈ s, IsClosed (t i)) (hS_compact : ∀ i ∈ s, IsCompact (t i)) : + squareCylinder s t ∈ closedCompactSquareCylinders α := by + rw [mem_closedCompactSquareCylinders] + exact ⟨s, t, hS_closed, hS_compact, rfl⟩ -theorem mem_cylinder_of_mem_closedCompactCylinders [∀ i, MeasurableSpace (α i)] +/- +theorem mem_cylinder_of_mem_closedCompactSquareCylinders [∀ i, MeasurableSpace (α i)] [∀ i, SecondCountableTopology (α i)] [∀ i, OpensMeasurableSpace (α i)] - (ht : t ∈ closedCompactCylinders α) : - t ∈ measurableCylinders α := by - rw [mem_measurableCylinders] + (hS : S ∈ closedCompactSquareCylinders α) : + S ∈ measurableCylinders α := by + rw [mem_measurableSquareCylinders] refine ⟨closedCompactCylinders.finset ht, closedCompactCylinders.set ht, ?_, ?_⟩ · exact (closedCompactCylinders.isClosed ht).measurableSet · exact closedCompactCylinders.eq_cylinder ht +-/ -/-! We prove that the `closedCompactCylinders` are a compact system. -/ - -variable {ι : Type*} {α : ι → Type*} [∀ i, TopologicalSpace (α i)] {s : ℕ → Set (Π i, α i)} - -local notation "Js" => closedCompactCylinders.finset -local notation "As" => closedCompactCylinders.set - -section AllProj - -/-- All indices in `ι` that are constrained by the condition `∀ n, s n ∈ closedCompactCylinders α`. -That is, the union of all indices in the bases of the cylinders. -/ -def allProj (hs : ∀ n, s n ∈ closedCompactCylinders α) : Set ι := ⋃ n, Js (hs n) - -theorem subset_allProj (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : - ↑(Js (hs n)) ⊆ allProj hs := - subset_iUnion (fun i ↦ (Js (hs i) : Set ι)) n - -theorem exists_nat_proj (hs : ∀ n, s n ∈ closedCompactCylinders α) (i : ι) (hi : i ∈ allProj hs) : - ∃ n, i ∈ Js (hs n) := by - simpa only [allProj, mem_iUnion, Finset.mem_coe] using hi - -open Classical in -/-- The smallest `n` such that `i ∈ Js (hs n)`. That is, the first `n` such that `i` belongs to the -finset defining the cylinder for `s n`. -/ -noncomputable def indexProj (hs : ∀ n, s n ∈ closedCompactCylinders α) (i : allProj hs) : ℕ := - Nat.find (exists_nat_proj hs i i.2) - -open Classical in -theorem mem_indexProj (hs : ∀ n, s n ∈ closedCompactCylinders α) (i : allProj hs) : - (i : ι) ∈ Js (hs (indexProj hs i)) := - Nat.find_spec (exists_nat_proj hs i i.2) - -open Classical in -theorem indexProj_le (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) (i : Js (hs n)) : - indexProj hs ⟨i, subset_allProj hs n i.2⟩ ≤ n := - Nat.find_le i.2 - -lemma surjective_proj_allProj [∀ i, Nonempty (α i)] (hs : ∀ n, s n ∈ closedCompactCylinders α) : - Function.Surjective (fun (f : (Π i, α i)) (i : allProj hs) ↦ f (i : ι)) := by - intro y - let x := (inferInstance : Nonempty (Π i, α i)).some +theorem IsCompactSystem.CompactClosedOrUniv_pi : + IsCompactSystem (univ.pi '' univ.pi + (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by + apply IsCompactSystem.pi + (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ))) + <| fun i ↦ IsCompactSystem.isClosedCompactOrUnivs (α i) + +/-- In `closedCompactSquareCylinders α`, the set of dependent variables is a finset, + but not necessarily in `univ.pi '' univ.pi _`, where `_` are closed compact set, or `univ`. -/ +theorem closedCompactSquareCylinders_supset (S : _) : + S ∈ closedCompactSquareCylinders α → S ∈ (univ.pi '' univ.pi + (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by classical - refine ⟨fun i ↦ if hi : i ∈ allProj hs then y ⟨i, hi⟩ else x i, ?_⟩ - ext i - simp only [Subtype.coe_prop, dite_true] - -end AllProj - -section projCylinder - -/-- Given a countable family of closed cylinders, consider one of them as depending only on -the countably many coordinates that appear in all of them. -/ -def projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : - Set (∀ i : allProj hs, α i) := - (fun (f : ∀ i : allProj hs, α i) (i : Js (hs n)) ↦ f ⟨i, subset_allProj hs _ i.2⟩) ⁻¹' (As (hs n)) - -lemma mem_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) - (x : ∀ i : allProj hs, α i) : - x ∈ projCylinder hs n ↔ (fun (i : Js (hs n)) ↦ x ⟨i, subset_allProj hs _ i.2⟩) ∈ As (hs n) := by - simp only [projCylinder, Set.mem_preimage] - -theorem preimage_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : - (fun (f : ∀ i, α i) (i : allProj hs) ↦ f i) ⁻¹' (projCylinder hs n) = s n := by - conv_rhs => rw [closedCompactCylinders.eq_cylinder (hs n)] - rfl - -lemma nonempty_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) - (n : ℕ) (hs_nonempty : (s n).Nonempty) : - (projCylinder hs n).Nonempty := by - rw [← preimage_projCylinder hs n] at hs_nonempty - exact nonempty_of_nonempty_preimage hs_nonempty - -lemma nonempty_projCylinder_iff [∀ i, Nonempty (α i)] - (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : - (projCylinder hs n).Nonempty ↔ (s n).Nonempty := by - refine ⟨fun h ↦ ?_, nonempty_projCylinder hs n⟩ - obtain ⟨x, hx⟩ := h - rw [mem_projCylinder] at hx - rw [closedCompactCylinders.eq_cylinder (hs n), MeasureTheory.cylinder] - refine Set.Nonempty.preimage ?_ ?_ - · exact ⟨_, hx⟩ - · intro y - let x := (inferInstance : Nonempty (∀ i, α i)).some - classical - refine ⟨fun i ↦ if hi : i ∈ Js (hs n) then y ⟨i, hi⟩ else x i, ?_⟩ - ext i - simp only [Finset.restrict_def, Finset.coe_mem, dite_true] - -theorem isClosed_projCylinder - (hs : ∀ n, s n ∈ closedCompactCylinders α) (hs_closed : ∀ n, IsClosed (As (hs n))) (n : ℕ) : - IsClosed (projCylinder hs n) := - (hs_closed n).preimage (by exact continuous_pi (fun i ↦ continuous_apply _)) - -end projCylinder + intro hS + simp_rw [mem_closedCompactSquareCylinders, squareCylinder] at hS + simp only [mem_image, mem_pi, mem_univ, forall_const] + obtain ⟨s, t, h_cl, h_co, h_pi⟩ := hS + let t' := fun (i : ι) ↦ if (i ∈ s) then (t i) else univ + refine ⟨t', ?_, ?_⟩ + · intro i + by_cases hi : i ∈ s + · simp only [hi, ↓reduceIte, t'] + exact Or.inl ⟨h_co i hi, h_cl i hi⟩ + · simp only [hi, ↓reduceIte, t'] + apply Or.inr rfl + · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = S + rw [h_pi, univ_pi_ite s t] -section piCylinderSet +/-- Closed and compact square cylinders form a compact system. -/ +theorem IsCompactSystem.closedCompactSquareCylinders : + IsCompactSystem (closedCompactSquareCylinders α) := + IsCompactSystem.of_supset IsCompactSystem.CompactClosedOrUniv_pi + closedCompactSquareCylinders_supset -open Classical in -/-- Given countably many closed compact cylinders, the product set which, in each relevant -coordinate, is the projection of the first cylinder for which this coordinate is relevant. -/ -def piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : - Set (∀ i : allProj hs, α i) := - {x : ∀ i : allProj hs, α i | - ∀ i, x i ∈ (fun a : ∀ j : Js (hs (indexProj hs i)), α j ↦ a ⟨i, mem_indexProj hs i⟩) '' - (As (hs (indexProj hs i)))} - -lemma mem_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) - (x : ∀ i : allProj hs, α i) : - x ∈ piCylinderSet hs ↔ - ∀ i, x i ∈ (fun a : ∀ j : Js (hs (indexProj hs i)), α j ↦ a ⟨i, mem_indexProj hs i⟩) '' - (As (hs (indexProj hs i))) := by - simp only [piCylinderSet, mem_image, Subtype.forall, mem_setOf_eq] - -theorem isCompact_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : - IsCompact (piCylinderSet hs) := - isCompact_pi_infinite fun _ ↦ - (closedCompactCylinders.isCompact (hs _)).image (continuous_apply _) - -theorem piCylinderSet_eq_pi_univ (hs : ∀ n, s n ∈ closedCompactCylinders α) : - piCylinderSet hs = - pi univ fun i ↦ - (fun a : ∀ j : Js (hs (indexProj hs i)), α j ↦ a ⟨i, mem_indexProj hs i⟩) '' - (As (hs (indexProj hs i))) := by - ext; simp only [piCylinderSet, mem_univ_pi]; rfl - -theorem isClosed_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : - IsClosed (piCylinderSet hs) := by - rw [piCylinderSet_eq_pi_univ] - sorry - --exact isClosed_set_pi fun i _ ↦ IsClosed.isClosed_image_restrict_singleton _ - -- (closedCompactCylinders.isCompact (hs _)) (closedCompactCylinders.isClosed (hs _)) - -theorem nonempty_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) - (hs_nonempty : ∀ i, (s i).Nonempty) : - (piCylinderSet hs).Nonempty := by - have hs_nonempty' i : (As (hs i)).Nonempty := by - specialize hs_nonempty i - rw [closedCompactCylinders.eq_cylinder (hs i)] at hs_nonempty - exact nonempty_of_nonempty_preimage hs_nonempty - let b i := (hs_nonempty' (indexProj hs i)).some - have hb_mem i : b i ∈ As (hs (indexProj hs i)) := (hs_nonempty' (indexProj hs i)).choose_spec - let a : ∀ i : allProj hs, α i := fun i ↦ b i ⟨i, mem_indexProj hs i⟩ - refine ⟨a, ?_⟩ - simp only [piCylinderSet, mem_image, SetCoe.forall, mem_setOf_eq] - exact fun j hj ↦ ⟨b ⟨j, hj⟩, hb_mem _, rfl⟩ - -end piCylinderSet - -theorem iInter_subset_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : - (⋂ n, projCylinder hs n) ⊆ piCylinderSet hs := by - intro x hx - rw [mem_iInter] at hx - rw [mem_piCylinderSet] - intro i - specialize hx (indexProj hs i) - rw [mem_projCylinder] at hx - exact ⟨fun i : Js (hs (indexProj hs i)) ↦ x ⟨i, subset_allProj hs _ i.2⟩, hx, rfl⟩ - -theorem nonempty_iInter_projCylinder_inter_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) - (hs_nonempty : ∀ i, (s i).Nonempty) - (h_nonempty : ∀ n, (⋂ i ≤ n, projCylinder hs i).Nonempty) (n : ℕ) : - ((⋂ i ≤ n, projCylinder hs i) ∩ piCylinderSet hs).Nonempty := by - obtain ⟨x, hx⟩ := nonempty_piCylinderSet hs hs_nonempty - obtain ⟨y, hy⟩ := h_nonempty n - let z := fun i : allProj hs ↦ if indexProj hs i ≤ n then y i else x i - refine ⟨z, mem_inter ?_ ?_⟩ - · simp only [mem_iInter, mem_projCylinder] - intro i hi - have : (fun j : Js (hs i) ↦ - ite (indexProj hs ⟨j, subset_allProj hs i j.2⟩ ≤ n) (y ⟨j, subset_allProj hs i j.2⟩) - (x ⟨j, subset_allProj hs i j.2⟩)) = - fun j : Js (hs i) ↦ y ⟨j, subset_allProj hs i j.2⟩ := by - ext j - rw [if_pos] - refine le_trans (le_of_eq ?_) ((indexProj_le hs i j).trans hi) - congr - rw [this] - have hyi : y ∈ projCylinder hs i := by - suffices ⋂ j ≤ n, projCylinder hs j ⊆ projCylinder hs i by exact this hy - exact biInter_subset_of_mem hi - rwa [mem_projCylinder] at hyi - · rw [mem_piCylinderSet] - intro i - by_cases hi_le : indexProj hs i ≤ n - · let m := indexProj hs i - have hy' : y ∈ projCylinder hs m := by - suffices ⋂ j ≤ n, projCylinder hs j ⊆ projCylinder hs m by exact this hy - exact biInter_subset_of_mem hi_le - rw [mem_projCylinder] at hy' - refine ⟨fun j ↦ y ⟨j, subset_allProj hs _ j.2⟩, hy', ?_⟩ - simp_rw [z, if_pos hi_le] - · rw [mem_piCylinderSet] at hx - specialize hx i - obtain ⟨x', hx'_mem, hx'_eq⟩ := hx - refine ⟨x', hx'_mem, ?_⟩ - simp_rw [z, if_neg hi_le] - exact hx'_eq - -theorem nonempty_iInter_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) - (hs_nonempty : ∀ i, (s i).Nonempty) - (h_nonempty : ∀ n, (⋂ i ≤ n, projCylinder hs i).Nonempty) : - (⋂ i, projCylinder hs i).Nonempty := by - suffices ((⋂ i, projCylinder hs i) ∩ piCylinderSet hs).Nonempty by - rwa [inter_eq_left.mpr (iInter_subset_piCylinderSet hs)] at this - have : (⋂ n, projCylinder hs n) = (⋂ n, ⋂ i ≤ n, projCylinder hs i) := by - ext x - simp only [mem_iInter] - exact ⟨fun h i j _ ↦ h j, fun h i ↦ h i i le_rfl⟩ - rw [this, iInter_inter] - have h_closed : ∀ n, IsClosed (⋂ i ≤ n, projCylinder hs i) := - fun n ↦ isClosed_biInter (fun i _ ↦ isClosed_projCylinder hs - (fun n ↦ (closedCompactCylinders.isClosed (hs n))) i) - refine IsCompact.nonempty_iInter_of_sequence_nonempty_isCompact_isClosed - (fun n ↦ (⋂ i ≤ n, projCylinder hs i) ∩ piCylinderSet hs) ?_ ?_ ?_ ?_ - · refine fun i ↦ inter_subset_inter ?_ subset_rfl - simp_rw [Set.biInter_le_succ] - exact inter_subset_left - · exact fun n ↦ nonempty_iInter_projCylinder_inter_piCylinderSet hs hs_nonempty h_nonempty n - · exact (isCompact_piCylinderSet hs).inter_left (h_closed _) - · exact fun n ↦ IsClosed.inter (h_closed n) (isClosed_piCylinderSet hs) - -lemma exists_finset_iInter_projCylinder_eq_empty [∀ i, Nonempty (α i)] - (hs : ∀ n, s n ∈ closedCompactCylinders α) (h : ⋂ n, projCylinder hs n = ∅) : - ∃ t : Finset ℕ, (⋂ i ∈ t, projCylinder hs i) = ∅ := by - by_contra! h_nonempty - refine absurd h (Set.Nonempty.ne_empty ?_) - refine nonempty_iInter_projCylinder hs (fun i ↦ ?_) (fun n ↦ ?_) - · specialize h_nonempty {i} - simp only [Finset.mem_singleton, iInter_iInter_eq_left, ne_eq] at h_nonempty - rwa [nonempty_projCylinder_iff] at h_nonempty - · specialize h_nonempty (Finset.range (n + 1)) - simp only [Finset.mem_range, ne_eq, Nat.lt_succ_iff] at h_nonempty - exact h_nonempty - -/-- The `closedCompactCylinders` are a compact system. -/ -theorem isCompactSystem_closedCompactCylinders : IsCompactSystem (closedCompactCylinders α) := by - intro s hs h - by_cases hα : ∀ i, Nonempty (α i) - swap; · exact ⟨∅, by simpa [not_nonempty_iff] using hα⟩ - have h' : ⋂ n, projCylinder hs n = ∅ := by - simp_rw [← preimage_projCylinder hs, ← preimage_iInter] at h - have h_surj : Function.Surjective (fun (f : (∀ i, α i)) (i : allProj hs) ↦ f (i : ι)) := - surjective_proj_allProj hs - rwa [← not_nonempty_iff_eq_empty, ← Function.Surjective.nonempty_preimage h_surj, - not_nonempty_iff_eq_empty] - obtain ⟨t, ht⟩ := exists_finset_iInter_projCylinder_eq_empty hs h' - refine ⟨t, ?_⟩ - simp_rw [← preimage_projCylinder hs, ← preimage_iInter₂, ht, preimage_empty] - -end ClosedCompactCylinders +end ClosedCompactSquareCylinders From 0411d0f0391009de46e49149ebe8cca636c0f224 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 2 May 2025 08:14:21 +0200 Subject: [PATCH 057/129] update Mathlib --- Mathlib.lean | 1 + Mathlib/Topology/Compactness/CompactSystem.lean | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index 5b4751deecfa23..249f85eb5731f2 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6376,6 +6376,7 @@ import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.CompactlyCoherentSpace import Mathlib.Topology.Compactness.CompactlyGeneratedSpace +import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.DeltaGeneratedSpace import Mathlib.Topology.Compactness.Exterior import Mathlib.Topology.Compactness.HilbertCubeEmbedding diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 64acc21d451cd9..615fd1511c8d90 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -226,7 +226,6 @@ theorem iff_directed' (hpi : IsPiSystem p) : theorem of_supset {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs - section ClosedCompact variable (α : Type*) [TopologicalSpace α] From d988cb4d6506c6977cc2c3f61a4d90897cf301bb Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 2 May 2025 09:00:57 +0200 Subject: [PATCH 058/129] deleted a comment --- Mathlib/Topology/Compactness/CompactSystem.lean | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 615fd1511c8d90..848321346ae3a3 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -414,17 +414,6 @@ theorem squareCylinder_mem_closedCompactSquareCylinders (s : Finset ι) (t : (i rw [mem_closedCompactSquareCylinders] exact ⟨s, t, hS_closed, hS_compact, rfl⟩ -/- -theorem mem_cylinder_of_mem_closedCompactSquareCylinders [∀ i, MeasurableSpace (α i)] - [∀ i, SecondCountableTopology (α i)] [∀ i, OpensMeasurableSpace (α i)] - (hS : S ∈ closedCompactSquareCylinders α) : - S ∈ measurableCylinders α := by - rw [mem_measurableSquareCylinders] - refine ⟨closedCompactCylinders.finset ht, closedCompactCylinders.set ht, ?_, ?_⟩ - · exact (closedCompactCylinders.isClosed ht).measurableSet - · exact closedCompactCylinders.eq_cylinder ht --/ - theorem IsCompactSystem.CompactClosedOrUniv_pi : IsCompactSystem (univ.pi '' univ.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by From aa28d021b34c302f758e5a55b4c866fc2819361a Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 2 May 2025 09:40:06 +0200 Subject: [PATCH 059/129] run mk_all --- Mathlib.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index 249f85eb5731f2..34eccf33ee991c 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6375,8 +6375,8 @@ import Mathlib.Topology.Compactness.Bases import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.CompactlyCoherentSpace -import Mathlib.Topology.Compactness.CompactlyGeneratedSpace import Mathlib.Topology.Compactness.CompactSystem +import Mathlib.Topology.Compactness.CompactlyGeneratedSpace import Mathlib.Topology.Compactness.DeltaGeneratedSpace import Mathlib.Topology.Compactness.Exterior import Mathlib.Topology.Compactness.HilbertCubeEmbedding From d204727f953a042e713755a80549d0a168acfb0e Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 2 May 2025 11:38:56 +0200 Subject: [PATCH 060/129] merge cs --- Mathlib/Topology/Compactness/CompactSystem.lean | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 848321346ae3a3..244ea2ed073e0f 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -4,11 +4,9 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ import Mathlib.Data.Set.Dissipate -import Mathlib.Topology.Separation.Hausdorff -import Mathlib.MeasureTheory.PiSystem import Mathlib.MeasureTheory.Constructions.Cylinders -import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic - +import Mathlib.Order.OmegaCompletePartialOrder +import Mathlib.Topology.Separation.Hausdorff /-! # Compact systems. From f4616b70f4e7af8fc4fc6227da17a7ff0c918106 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 2 May 2025 23:20:26 +0200 Subject: [PATCH 061/129] deleted double thm --- .../Constructions/Cylinders.lean | 20 +++++++++++++------ .../ProjectiveFamilyContent.lean | 16 --------------- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/Mathlib/MeasureTheory/Constructions/Cylinders.lean b/Mathlib/MeasureTheory/Constructions/Cylinders.lean index 9ae60553d51162..d5dbfab136f86e 100644 --- a/Mathlib/MeasureTheory/Constructions/Cylinders.lean +++ b/Mathlib/MeasureTheory/Constructions/Cylinders.lean @@ -6,6 +6,7 @@ Authors: Rémy Degenne, Peter Pfaffelhuber, Yaël Dillies, Kin Yau James Wong import Mathlib.Data.Finset.Lattice.Basic import Mathlib.MeasureTheory.SetSemiring import Mathlib.Topology.Constructions +import Mathlib.MeasureTheory.SetAlgebra /-! # π-systems of cylinders and square cylinders @@ -363,16 +364,23 @@ theorem diff_mem_measurableCylinders (hs : s ∈ measurableCylinders α) rw [diff_eq_compl_inter] exact inter_mem_measurableCylinders (compl_mem_measurableCylinders ht) hs -/-- The measurable cylinders are a ring. -/ -theorem isSetRing_measurableCylinders : IsSetRing (measurableCylinders α) where + +section MeasurableCylinders + +lemma isSetAlgebra_measurableCylinders : IsSetAlgebra (measurableCylinders α) where empty_mem := empty_mem_measurableCylinders α - union_mem := fun _ _ ↦ union_mem_measurableCylinders - diff_mem := fun _ _ ↦ diff_mem_measurableCylinders + compl_mem _ := compl_mem_measurableCylinders + union_mem _ _ := union_mem_measurableCylinders + +lemma isSetRing_measurableCylinders : IsSetRing (measurableCylinders α) := + isSetAlgebra_measurableCylinders.isSetRing -/-- The measurable cylinders are a semiring. -/ -theorem isSetSemiring_measurableCylinders : MeasureTheory.IsSetSemiring (measurableCylinders α) := +lemma isSetSemiring_measurableCylinders : MeasureTheory.IsSetSemiring (measurableCylinders α) := isSetRing_measurableCylinders.isSetSemiring +end MeasurableCylinders + + theorem iUnion_le_mem_measurableCylinders {s : ℕ → Set (∀ i : ι, α i)} (hs : ∀ n, s n ∈ measurableCylinders α) (n : ℕ) : (⋃ i ≤ n, s i) ∈ measurableCylinders α := diff --git a/Mathlib/MeasureTheory/Constructions/ProjectiveFamilyContent.lean b/Mathlib/MeasureTheory/Constructions/ProjectiveFamilyContent.lean index d198a0f5f15ae4..c424fbb7fb7855 100644 --- a/Mathlib/MeasureTheory/Constructions/ProjectiveFamilyContent.lean +++ b/Mathlib/MeasureTheory/Constructions/ProjectiveFamilyContent.lean @@ -5,7 +5,6 @@ Authors: Rémy Degenne, Peter Pfaffelhuber -/ import Mathlib.MeasureTheory.Constructions.Projective import Mathlib.MeasureTheory.Measure.AddContent -import Mathlib.MeasureTheory.SetAlgebra /-! # Additive content built from a projective family of measures @@ -43,21 +42,6 @@ variable {ι : Type*} {α : ι → Type*} {mα : ∀ i, MeasurableSpace (α i)} {P : ∀ J : Finset ι, Measure (Π j : J, α j)} {s t : Set (Π i, α i)} {I : Finset ι} {S : Set (Π i : I, α i)} -section MeasurableCylinders - -lemma isSetAlgebra_measurableCylinders : IsSetAlgebra (measurableCylinders α) where - empty_mem := empty_mem_measurableCylinders α - compl_mem _ := compl_mem_measurableCylinders - union_mem _ _ := union_mem_measurableCylinders - -lemma isSetRing_measurableCylinders : IsSetRing (measurableCylinders α) := - isSetAlgebra_measurableCylinders.isSetRing - -lemma isSetSemiring_measurableCylinders : MeasureTheory.IsSetSemiring (measurableCylinders α) := - isSetRing_measurableCylinders.isSetSemiring - -end MeasurableCylinders - section ProjectiveFamilyFun open Classical in From 47b52df9185c93901026b6bb78bb0fedecebce20 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Tue, 27 May 2025 17:36:44 +0200 Subject: [PATCH 062/129] small --- .../Topology/Compactness/CompactSystem.lean | 113 ++++++++---------- 1 file changed, 52 insertions(+), 61 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 244ea2ed073e0f..badfdf1bdb04cb 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ import Mathlib.Data.Set.Dissipate +import Mathlib.Logic.IsEmpty import Mathlib.MeasureTheory.Constructions.Cylinders import Mathlib.Order.OmegaCompletePartialOrder import Mathlib.Topology.Separation.Hausdorff @@ -294,32 +295,21 @@ theorem _of_isCompact_of_T2Space [T2Space α] : end ClosedCompact -end IsCompactSystem - section pi variable {ι : Type*} {α : ι → Type*} +/- In a product space, the intersection of square cylinders is empty iff there is a coordinate `i` +such that the projections to `i` have empty intersection. -/ theorem iInter_pi_empty_iff {β : Type*} (s : β → Set ι) (t : β → (i : ι) → Set (α i)) : - ( ⋂ b, ((s b).pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β) (_: i ∈ s b), (t b i) = ∅):= by + (⋂ b, ((s b).pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β) (_: i ∈ s b), (t b i) = ∅):= by rw [iInter_eq_empty_iff, not_iff_not.symm] push_neg - refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ - · have ⟨x, hx⟩ := h - simp only [nonempty_iInter] - intro i - refine ⟨x i, fun j ↦ ?_⟩ - rw [mem_iInter] - intro hi - simp_rw [mem_pi] at hx - exact hx j i hi - · simp only [nonempty_iInter, mem_iInter] at h - choose x hx using h - use x - simp_rw [mem_pi] - intro i - intro j hj - exact hx j i hj + simp only [nonempty_iInter, mem_iInter] + refine ⟨fun ⟨x, hx⟩ i ↦ ?_, fun h ↦ ?_⟩ + · refine ⟨x i, fun j hi ↦ hx j i hi⟩ + · choose x hx using h + refine ⟨x, fun i j hj ↦ hx j i hj⟩ theorem iInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) : ( ⋂ b, (univ.pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β), (t b i) = ∅):= by @@ -336,7 +326,7 @@ theorem biInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α exact biInter_eq_iInter p fun x h ↦ t x i simp_rw [h, h', iInter_univ_pi_empty_iff] -theorem IsCompactSystem.pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : +theorem pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : IsCompactSystem (univ.pi '' univ.pi C) := by intro S hS h_empty change ∀ i, S i ∈ univ.pi '' univ.pi C at hS @@ -357,6 +347,8 @@ theorem IsCompactSystem.pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCo end pi +end IsCompactSystem + section ClosedCompactSquareCylinders variable {ι : Type*} {α : ι → Type*} @@ -366,84 +358,83 @@ variable [∀ i, TopologicalSpace (α i)] variable (α) /-- The set of sets of the form `s.pi t`, where `s : Finset ι` and `t i` is both, closed and compact, for all `i ∈ s`. -/ -def closedCompactSquareCylinders : Set (Set (Π i, α i)) := - ⋃ (s) (t) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), {squareCylinder s t} +def compactClosedSquareCylinders : Set (Set (Π i, α i)) := + ⋃ (s) (t) (_ : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)), {squareCylinder s t} + +def squareCylinders_of_prop (p : (i : ι) → Set (α i) → Prop) : Set (Set (Π i, α i)) := + ⋃ (s) (t) (_ : ∀ i ∈ s, p i (t i)), {squareCylinder s t} variable {α} @[simp] -theorem mem_closedCompactSquareCylinders (S : Set (Π i, α i)) : - S ∈ closedCompactSquareCylinders α - ↔ ∃ (s t : _) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), +theorem mem_compactClosedSquareCylinders_iff (S : Set (Π i, α i)) : + S ∈ compactClosedSquareCylinders α + ↔ ∃ (s t : _) (_ : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)), S = squareCylinder s t := by - simp_rw [closedCompactSquareCylinders, mem_iUnion, mem_singleton_iff] + simp_rw [compactClosedSquareCylinders, mem_iUnion, mem_singleton_iff] + variable {S : Set (Π i, α i)} /-- Given a closed compact cylinder, choose a finset of variables such that it only depends on these variables. -/ -noncomputable def closedCompactSquareCylinders.finset (hS : S ∈ closedCompactSquareCylinders α) : +noncomputable def compactClosedSquareCylinders.finset (hS : S ∈ compactClosedSquareCylinders α) : Finset ι := - ((mem_closedCompactSquareCylinders S).mp hS).choose + ((mem_compactClosedSquareCylinders_iff S).mp hS).choose /-- Given a closed compact square cylinder `S`, choose a dependent function `(i : ι) → Set (α i)` of which it is a lift. -/ -def closedCompactSquareCylinders.func (hS : S ∈ closedCompactSquareCylinders α) : +def closedCompactSquareCylinders.func (hS : S ∈ compactClosedSquareCylinders α) : (i : ι) → Set (α i) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose - -theorem closedCompactSquareCylinders.isClosed (hS : S ∈ closedCompactSquareCylinders α) : - ∀ i ∈ closedCompactSquareCylinders.finset hS, - IsClosed (closedCompactSquareCylinders.func hS i) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose + ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose -theorem closedCompactSquareCylinders.isCompact (hS : S ∈ closedCompactSquareCylinders α) : - ∀ i ∈ closedCompactSquareCylinders.finset hS, - IsCompact (closedCompactSquareCylinders.func hS i) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose +theorem compactClosedSquareCylinders.isCompact_isClosed (hS : S ∈ compactClosedSquareCylinders α) : + ∀ i ∈ compactClosedSquareCylinders.finset hS, + IsCompact (closedCompactSquareCylinders.func hS i) ∧ + IsClosed (closedCompactSquareCylinders.func hS i) := + ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose_spec.choose -theorem closedCompactSquareCylinders.eq_squareCylinder (hS : S ∈ closedCompactSquareCylinders α) : - S = squareCylinder (closedCompactSquareCylinders.finset hS) +theorem closedCompactSquareCylinders.eq_squareCylinder (hS : S ∈ compactClosedSquareCylinders α) : + S = squareCylinder (compactClosedSquareCylinders.finset hS) (closedCompactSquareCylinders.func hS) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose_spec + ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose_spec.choose_spec theorem squareCylinder_mem_closedCompactSquareCylinders (s : Finset ι) (t : (i : ι) → Set (α i)) - (hS_closed : ∀ i ∈ s, IsClosed (t i)) (hS_compact : ∀ i ∈ s, IsCompact (t i)) : - squareCylinder s t ∈ closedCompactSquareCylinders α := by - rw [mem_closedCompactSquareCylinders] - exact ⟨s, t, hS_closed, hS_compact, rfl⟩ + (h : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)) : + squareCylinder s t ∈ compactClosedSquareCylinders α := by + rw [mem_compactClosedSquareCylinders_iff] + exact ⟨s, t, h, rfl⟩ -theorem IsCompactSystem.CompactClosedOrUniv_pi : +theorem CompactClosedOrUniv_pi : IsCompactSystem (univ.pi '' univ.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by apply IsCompactSystem.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ))) - <| fun i ↦ IsCompactSystem.isClosedCompactOrUnivs (α i) + <| fun i ↦ IsCompactSystem.of_isCompact_isClosed_or_univ /-- In `closedCompactSquareCylinders α`, the set of dependent variables is a finset, but not necessarily in `univ.pi '' univ.pi _`, where `_` are closed compact set, or `univ`. -/ -theorem closedCompactSquareCylinders_supset (S : _) : - S ∈ closedCompactSquareCylinders α → S ∈ (univ.pi '' univ.pi +theorem compactClosedSquareCylinders_supset (S : _) : + S ∈ compactClosedSquareCylinders α → S ∈ (univ.pi '' univ.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by classical intro hS - simp_rw [mem_closedCompactSquareCylinders, squareCylinder] at hS + simp_rw [mem_compactClosedSquareCylinders_iff, squareCylinder] at hS simp only [mem_image, mem_pi, mem_univ, forall_const] obtain ⟨s, t, h_cl, h_co, h_pi⟩ := hS let t' := fun (i : ι) ↦ if (i ∈ s) then (t i) else univ - refine ⟨t', ?_, ?_⟩ - · intro i - by_cases hi : i ∈ s + refine ⟨t', fun i ↦ ?_, ?_⟩ + · by_cases hi : i ∈ s · simp only [hi, ↓reduceIte, t'] - exact Or.inl ⟨h_co i hi, h_cl i hi⟩ + exact Or.inl (h_cl i hi) · simp only [hi, ↓reduceIte, t'] apply Or.inr rfl - · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = S - rw [h_pi, univ_pi_ite s t] + · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = (s : Set ι).pi t + rw [univ_pi_ite s t] /-- Closed and compact square cylinders form a compact system. -/ -theorem IsCompactSystem.closedCompactSquareCylinders : - IsCompactSystem (closedCompactSquareCylinders α) := - IsCompactSystem.of_supset IsCompactSystem.CompactClosedOrUniv_pi - closedCompactSquareCylinders_supset +theorem isCompactSystem.compactClosedSquareCylinders : + IsCompactSystem (compactClosedSquareCylinders α) := + IsCompactSystem.mono CompactClosedOrUniv_pi + compactClosedSquareCylinders_supset end ClosedCompactSquareCylinders From 1b44f6c7b1044d0a92014b1aeedba05ab35fcbfa Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Wed, 28 May 2025 23:57:20 +0200 Subject: [PATCH 063/129] sq --- .../Topology/Compactness/CompactSystem.lean | 626 ++++++++++++------ 1 file changed, 432 insertions(+), 194 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index badfdf1bdb04cb..c9e08ec54be20a 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -4,7 +4,6 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ import Mathlib.Data.Set.Dissipate -import Mathlib.Logic.IsEmpty import Mathlib.MeasureTheory.Constructions.Cylinders import Mathlib.Order.OmegaCompletePartialOrder import Mathlib.Topology.Separation.Hausdorff @@ -17,16 +16,16 @@ This file defines compact systems of sets. * `IsCompactSystem`: A set of sets is a compact system if, whenever a countable subfamily has empty intersection, then finitely many of them already have empty intersection. - +* `IsCompactSystem.union`: The set system of finite unions of another set system. ## Main results -* `IsCompactSystemiff_isCompactSystem_of_or_univ`: A set system is a compact -system iff inserting `univ` gives a compact system. * `IsClosedCompact.isCompactSystem`: The set of closed and compact sets is a compact system. * `IsClosedCompact.isCompactSystem_of_T2Space`: In a `T2Space α`, the set of compact sets is a compact system in a `T2Space`. +* `IsCompactSystem.union.isCompactSystem`: If `IsCompactSystem p`, the set of finite unions + of `K : Set α` with `p K` is a compact system. * `IsCompactSystem.closedCompactSquareCylinders`: Closed and compact square cylinders form a - compact system. + compact system in a product space. -/ open Set Nat MeasureTheory @@ -44,20 +43,21 @@ end definition namespace IsCompactSystem +/-- In a compact system, given a countable family with empty intersection, we choose a finite +subfamily with empty intersection. -/ /-- In a compact system, given a countable family with empty intersection, we choose a finite subfamily with empty intersection. -/ noncomputable -def finite_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) +def max_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) (hC_empty : ⋂ i, C i = ∅) : ℕ := - Nat.find (hp C hC hC_empty) + (hp C hC hC_empty).choose -open Classical in -lemma dissipate_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) +lemma iInter_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) (hC_empty : ⋂ i, C i = ∅) : - dissipate C (hp.finite_of_empty hC hC_empty) = ∅ := by - apply Nat.find_spec (hp C hC hC_empty) + Dissipate C (hp.max_of_empty hC hC_empty) = ∅ := + (hp C hC hC_empty).choose_spec -theorem iff_nonempty_iInter (p : Set α → Prop) : +theorem iff_of_nempty (p : Set α → Prop) : IsCompactSystem p ↔ (∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ (n : ℕ), (dissipate C n).Nonempty) → (⋂ i, C i).Nonempty) := by refine ⟨fun h C hC hn ↦ ?_, fun h C hC ↦ ?_⟩ <;> have h2 := not_imp_not.mpr <| h C hC @@ -68,9 +68,9 @@ theorem iff_nonempty_iInter (p : Set α → Prop) : /-- In this equivalent formulation for a compact system, note that we use `⋂ k < n, C k` rather than `⋂ k ≤ n, C k`. -/ -lemma iff_nonempty_iInter_of_lt (p : Set α → Prop) : IsCompactSystem p ↔ - ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ n, (⋂ k < n, C k).Nonempty) → (⋂ i, C i).Nonempty := by - simp_rw [iff_nonempty_iInter] +lemma iff_of_not_empty (p : Set α → Prop) : IsCompactSystem p ↔ + ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ n, ⋂ k < n, C k ≠ ∅) → ⋂ i, C i ≠ ∅ := by + simp_rw [← Set.nonempty_iff_ne_empty, iff_of_nempty] refine ⟨fun h C hi h'↦ ?_, fun h C hi h' ↦ ?_⟩ · apply h C hi exact fun n ↦ dissipate_eq ▸ (h' (n + 1)) @@ -85,135 +85,18 @@ lemma iff_nonempty_iInter_of_lt (p : Set α → Prop) : IsCompactSystem p ↔ rw [mem_iInter₂, mem_iInter₂] exact fun h i hi ↦ h i hi.le -/-- Any subset of a compact system is a compact system. -/ -theorem mono {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : - IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs - -/-- A set system is a compact system iff adding `∅` gives a compact system. -/ -lemma iff_isCompactSystem_of_or_empty : IsCompactSystem p ↔ - IsCompactSystem (fun s ↦ (p s ∨ (s = ∅))) := by - refine ⟨fun h s h' hd ↦ ?_, fun h ↦ mono h (fun s ↦ fun a ↦ Or.symm (Or.inr a))⟩ - by_cases g : ∃ n, s n = ∅ - · use g.choose - rw [← subset_empty_iff] at hd ⊢ - exact le_trans (dissipate_subset (by rfl)) g.choose_spec.le - · push_neg at g - have hj (i : _) : p (s i) := by - rcases h' i with a | b - · exact a - · exfalso - revert g i - simp_rw [← Set.not_nonempty_iff_eq_empty] - simp_rw [imp_false, not_not] - exact fun h i ↦ h i - exact h s hj hd - -lemma of_IsEmpty (h : IsEmpty α) (p : Set α → Prop) : IsCompactSystem p := - fun s _ _ ↦ ⟨0, Set.eq_empty_of_isEmpty (dissipate s 0)⟩ - -/-- A set system is a compact system iff adding `univ` gives a compact system. -/ -lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ - IsCompactSystem (fun s ↦ (p s ∨ s = univ)) := by - refine ⟨fun h ↦ ?_, fun h ↦ mono h (fun s ↦ fun a ↦ Or.symm (Or.inr a))⟩ - wlog ht : Nonempty α - · rw [not_nonempty_iff] at ht - apply of_IsEmpty ht - · rw [iff_nonempty_iInter] at h ⊢ - intro s h' hd - classical - by_cases h₀ : ∀ n, ¬p (s n) - · simp only [h₀, false_or] at h' - simp_rw [h', iInter_univ, Set.univ_nonempty] - · push_neg at h₀ - let n := Nat.find h₀ - let s' := fun i ↦ if p (s i) then s i else s n - have h₁ : ∀ i, p (s' i) := by - intro i - by_cases h₁ : p (s i) - · simp only [h₁, ↓reduceIte, s'] - · simp only [h₁, ↓reduceIte, Nat.find_spec h₀, s', n] - have h₃ : ∀ i, (p (s i) → s' i = s i) := fun i h ↦ if_pos h - have h₄ : ∀ i, (¬p (s i) → s' i = s n) := fun i h ↦ if_neg h - have h₂ : ⋂ i, s i = ⋂ i, s' i := by - simp only [s'] at * - ext x - simp only [mem_iInter] - refine ⟨fun h i ↦ ?_, fun h i ↦ ?_⟩ - · by_cases h' : p (s i) <;> simp only [h', ↓reduceIte, h, n] - · specialize h' i - specialize h i - rcases h' with a | b - · simp only [a, ↓reduceIte] at h - exact h - · simp only [b, Set.mem_univ] - apply h₂ ▸ h s' h₁ - by_contra! a - obtain ⟨j, hj⟩ := a - have h₂ (v : ℕ) (hv : n ≤ v) : dissipate s v = dissipate s' v:= by - ext x - refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ <;> simp only [dissipate_def, mem_iInter] at h ⊢ <;> - intro i hi - · by_cases h₅ : p (s i) - · exact (h₃ i h₅) ▸ h i hi - · exact (h₄ i h₅) ▸ h n hv - · by_cases h₅ : p (s i) - · exact (h₃ i h₅) ▸ h i hi - · have h₆ : s i = univ := by - specialize h' i - simp only [h₅, false_or] at h' - exact h' - simp only [h₆, Set.mem_univ] - have h₇ : dissipate s' (max j n) = ∅ := by - rw [← subset_empty_iff] at hj ⊢ - exact le_trans (antitone_dissipate (Nat.le_max_left j n)) hj - specialize h₂ (max j n) (Nat.le_max_right j n) - specialize hd (max j n) - rw [h₂, Set.nonempty_iff_ne_empty, h₇] at hd - exact hd rfl - -theorem iff_directed (hpi : IsPiSystem p) : - IsCompactSystem p ↔ - ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → - ⋂ i, C i = ∅ → ∃ (n : ℕ), C n = ∅ := by - rw [iff_isCompactSystem_of_or_empty] +theorem iff_directed (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : + (IsCompactSystem p) ↔ + (∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → + ⋂ i, C i = ∅ → ∃ (n : ℕ), C n = ∅) := by refine ⟨fun h ↦ fun C hdi hi ↦ ?_, fun h C h1 h2 ↦ ?_⟩ - · rw [exists_dissipate_eq_empty_iff_of_directed C hdi] - apply h C - exact fun i ↦ Or.inl (hi i) - · have hpi' : IsPiSystem (fun s ↦ p s ∨ s = ∅) := by - intro a ha b hb hab - rcases ha with ha₁ | ha₂ - · rcases hb with hb₁ | hb₂ - · left - exact hpi a ha₁ b hb₁ hab - · right - exact hb₂ ▸ (Set.inter_empty a) - · simp only [ha₂, Set.empty_inter] - right - rfl - rw [← biInter_le_eq_iInter] at h2 - obtain h' := h (dissipate C) directed_dissipate - have h₀ : (∀ (n : ℕ), p (dissipate C n) ∨ dissipate C n = ∅) → ⋂ n, dissipate C n = ∅ → - ∃ n, dissipate C n = ∅ := by - intro h₀ h₁ - by_cases f : ∀ n, p (dissipate C n) - · apply h' f h₁ - · push_neg at f - obtain ⟨n, hn⟩ := f - use n - specialize h₀ n - simp_all only [false_or] - obtain h'' := IsPiSystem.dissipate_mem hpi' h1 - have h₁ : ∀ (n : ℕ), p (dissipate C n) ∨ dissipate C n = ∅ := by - intro n - by_cases g : (dissipate C n).Nonempty - · exact h'' n g - · right - exact Set.not_nonempty_iff_eq_empty.mp g - apply h₀ h₁ h2 - -theorem iff_directed' (hpi : IsPiSystem p) : - IsCompactSystem p ↔ + · rw [dissipate_exists_empty_iff_of_directed C hdi] + exact h C hi + · rw [← biInter_le_eq_iInter] at h2 + exact h (Dissipate C) dissipate_directed (dissipate_of_piSystem hpi h1) h2 + +theorem iff_directed' (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : + (IsCompactSystem p) ↔ ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → (∀ (n : ℕ), (C n).Nonempty) → (⋂ i, C i).Nonempty := by rw [IsCompactSystem.iff_directed hpi] @@ -225,10 +108,31 @@ theorem iff_directed' (hpi : IsPiSystem p) : theorem of_supset {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs +section ClosedCompact +/-- Any subset of a compact system is a compact system. -/ +theorem of_supset {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : + IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs + section ClosedCompact +variable (α : Type*) [TopologicalSpace α] variable (α : Type*) [TopologicalSpace α] +/-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ +theorem isClosedCompactOrUnivs : + IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by + let p := fun (s : Set α) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ) + have h2 : ∀ (s t : Set α), p s → p t → p (s ∩ t) := by + intro s t hs ht + by_cases hs' : s = univ + · rw [hs', univ_inter] + exact ht + · by_cases ht' : t = univ + · rw [ht', inter_comm, univ_inter] + exact hs + · exact Or.inl <| ⟨IsCompact.inter_right (Or.resolve_right hs hs').1 + (Or.resolve_right ht ht').2, IsClosed.inter (Or.resolve_right hs hs').2 + (Or.resolve_right ht ht').2⟩ /-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ theorem isClosedCompactOrUnivs : IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by @@ -253,9 +157,9 @@ theorem isClosedCompactOrUnivs : have hz : s z ≠ univ := fun h ↦ a.prop <| eq_univ_of_subset hz1 h use ⟨z, hz⟩ have htcl : ∀ (i : { j : ℕ | s j ≠ univ}), IsClosed (s i) := - fun i ↦ (h1 i).2 + fun i ↦ (Or.resolve_right (h1 i.val) i.prop).2 have htco : ∀ (i : { j : ℕ | s j ≠ univ}), IsCompact (s i) := - fun i ↦ (h1 i).1 + fun i ↦ (Or.resolve_right (h1 i.val) i.prop).1 haveI f : Nonempty α := by apply Exists.nonempty _ · exact fun x ↦ x ∈ s 0 @@ -282,6 +186,15 @@ theorem isClosedCompacts : IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := IsCompactSystem.of_supset (isClosedCompactOrUnivs α) (fun _ hs ↦ Or.inl hs) +theorem isCompacts (h : ∀ {s : Set α}, IsCompact s → IsClosed s) : + simp only [nonempty_iInter, s', h] + simp only [Set.mem_univ, implies_true, exists_const, s'] + +/-- The set of compact and closed sets is a compact system. -/ +theorem isClosedCompacts : + IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := + IsCompactSystem.of_supset (isClosedCompactOrUnivs α) (fun _ hs ↦ Or.inl hs) + theorem isCompacts (h : ∀ {s : Set α}, IsCompact s → IsClosed s) : IsCompactSystem (fun s : Set α ↦ IsCompact s) := by have h : (fun s : Set α ↦ IsCompact s) = (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by @@ -295,21 +208,314 @@ theorem _of_isCompact_of_T2Space [T2Space α] : end ClosedCompact +section Union + +lemma l2 {ι : Type*} (s t : Set α) (u : Set ι) (L : (i : ι) → (hi : i ∈ u) → Set α) + (h : s ⊆ ⋃ (n : ι) (hn : n ∈ u), L n hn) (h' : ∀ (n : ι) (hn : n ∈ u), t ∩ (L n hn) = ∅) : + t ∩ s = ∅ := by + have j : ⋃ (n : ι) (hn : n ∈ u), t ∩ (L n hn) = ∅ := by + simp_rw [iUnion_eq_empty] + exact h' + simp_rw [← subset_empty_iff] at h' j ⊢ + have j' : ⋃ (n : u), t ∩ L n.val n.prop = ⋃ n, ⋃ (hn : n ∈ u), t ∩ L n hn := by + exact iUnion_coe_set u fun i ↦ t ∩ L (↑i) (Subtype.prop i) + rw [← j', ← inter_iUnion, iUnion_coe_set] at j + have gf := inter_subset_inter (t₁ := t) (fun ⦃a_1⦄ a ↦ a) h + apply le_trans gf j + +variable {p : Set α → Prop} (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) + (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) + +-- variable (p : {n : ℕ} → ((k : Fin (n + 1)) → (β k)) → Prop) + +/-- `r n K` is the property which must hold for compact systems: +`∀ N, (⋂ (j < n), (K j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅`. -/ +noncomputable def r (n : ℕ) (K : ℕ → Set α) : Prop := + ∀ N, (⋂ (j < n), (K j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ + +-- h0 -> (get_element_zero hL hc) +-- (h0 : ∃ x : (ℕ → α), x 0 ∈ β 0 ∧ p 0 x) + +lemma nonempty' (n : ℕ) (K : ℕ → Set α) + (hc : ∀ N, (⋂ (k < n), K k) ∩ (⋂ k < N, ⋃₀ (L (n + k))) ≠ ∅) : (L n).Nonempty := by + specialize hc 1 + by_contra! h + simp only [Finset.not_nonempty_iff_eq_empty] at h + apply hc + simp [h] + +lemma nonempty (k : ℕ) (hc : ∀ N, ⋂ k < N, ⋃₀ (L k : Set (Set α)) ≠ ∅) : (L k).Nonempty := by + specialize hc (k + 1) + by_contra! h + simp only [Finset.not_nonempty_iff_eq_empty] at h + apply hc + apply iInter_eq_empty_iff.mpr fun x ↦ ⟨k, ?_⟩ + -- simp only [Nat.lt_add_one, iInter_true, mem_sUnion, Finset.mem_coe, not_exists, not_and] + simp only [Nat.lt_add_one, iInter_true, Finset.mem_coe, not_exists, not_and] + have hg : ⋃₀ (L k : Set (Set α)) = ∅ := by + rw [h] + simp only [Finset.coe_empty, sUnion_empty] + exact of_eq_false (congrFun hg x) + +/-- `q n K` is the joint property that `(∀ k < n, K k ∈ L k)` and `r n K)` holds. -/ +def q : ℕ → (ℕ → Set α) → Prop := fun n K ↦ (∀ k < n, K k ∈ L k) ∧ (r L n K) + +lemma get_element_zero (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : + ∃ (K : ℕ → Set α), q L 0 K := by + simp [q, r, h] + +lemma get_element_succ' (n : ℕ) + (K : ℕ → Set α) (hK : q L n K) : ∃ y, q L (n + 1) (Function.update K n y) := by + simp_rw [q, r] at hK ⊢ + by_contra! h + choose b hb using h + have hn : ∀ y ∈ L n, ∀ k < n + 1, Function.update K n y k ∈ L k := by + intro y hy k hk + by_cases d : n = k + · rw [d] + simp only [Function.update_self] + exact d ▸ hy + · have d' : k < n := by + by_contra h + apply d + simp only [not_lt] at h + apply Eq.symm + exact Nat.eq_of_le_of_lt_succ h hk + simp only [ne_eq, d'.ne, not_false_eq_true, Function.update_of_ne] + exact hK.1 k d' + classical + let b' := fun y ↦ dite (y ∈ L n) (fun hy ↦ (b y (hn y hy))) (fun _ ↦ 0) + have hb' := fun y hy ↦ hb y (hn y hy) + have hb'' (y : Set α) (hy : y ∈ L n) : b y (hn y hy) = b' y := by + simp [b', hy] + obtain ⟨K0Max, ⟨hK0₁, hK0₂⟩⟩ := Finset.exists_max_image (L n) b' (nonempty' L n K hK.2) + apply hK.2 (b' K0Max + 1) + have h₁ (y s : Set α): (⋂ j, ⋂ (_ : j < n + 1), Function.update K n y j) ∩ s = + (⋂ j, ⋂ (_ : j < n), K j) ∩ y ∩ s := by + apply congrFun (congrArg Inter.inter _) s + ext x + refine ⟨fun h ↦ ⟨?_, ?_⟩, fun h ↦ ?_⟩ <;> simp only [mem_iInter, mem_inter_iff] at h ⊢ + · intro i hi + have h' := h i (le_trans hi (le_succ n)) + simp only [ne_eq, hi.ne, not_false_eq_true, Function.update_of_ne] at h' + exact h' + · have h'' := h n (Nat.lt_add_one n) + simp only [Function.update_self] at h'' + exact h'' + · intro i hi + by_cases h₁ : i < n + · simp only [ne_eq, h₁.ne, not_false_eq_true, Function.update_of_ne] + exact h.1 i h₁ + · simp only [not_lt] at h₁ + have h₂ := Nat.eq_of_le_of_lt_succ h₁ hi + rw [h₂] + simp only [Function.update_self] + exact h.2 + simp_rw [h₁] at hb' + + have h₂ : ⋂ k < b' K0Max + 1, ⋃₀ (L (n + k)).toSet ⊆ + ⋃ (y : Set α) (hy : y ∈ L n), y ∩ ⋂ (k < b y (hn y hy)), ⋃₀ (L (n + 1 + k)).toSet := by + obtain ⟨y, hy⟩ := nonempty' L n K hK.2 + intro x hx + simp only [mem_iInter, mem_sUnion, Finset.mem_coe, mem_iUnion, mem_inter_iff, + exists_and_left] at hx ⊢ + obtain ⟨i, hi⟩ := hx 0 (zero_lt_succ (b' K0Max)) + rw [add_zero] at hi + use i, hi.2, hi.1 + intro k hk + have hk' : 1 + k < b' K0Max + 1:= by + rw [add_comm] + simp only [Nat.add_lt_add_iff_right] + apply lt_of_lt_of_le hk + rw [hb''] + apply hK0₂ i hi.1 + exact hi.1 + obtain ⟨t, ht⟩ := hx (1 + k) hk' + rw [← add_assoc] at ht + use t, ht.1, ht.2 + simp_rw [inter_assoc] at hb' + apply l2 (s := ⋂ k < b' K0Max + 1, ⋃₀ (L (n + k)).toSet) (t := (⋂ j < n, K j)) (u := L n) + (L := fun (y : Set α) (hy : y ∈ L n) ↦ (y ∩ ⋂ k, ⋂ (hk : k < b y (hn y hy)), + ⋃₀ (L (n + 1 + k)).toSet)) h₂ hb' + +/-- `mem_of_union_aux h n` is the product of some `K : ℕ → Set α)` and `q n K`. +Constructing `(mem_of_union_aux h n).1` works inductively. When constructing +`(mem_of_union_aux h (n + 1)).1`, we update `(mem_of_union_aux h n).1` only at position `n`. -/ +noncomputable def mem_of_union_aux (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : + (n : ℕ) → ((K : ℕ → Set α) ×' (q L n K)) + | 0 => ⟨(get_element_zero L h).choose, (get_element_zero L h).choose_spec⟩ + | n + 1 => by + have g := (get_element_succ' L) n (mem_of_union_aux h n).1 (mem_of_union_aux h n).2 + exact ⟨Function.update (mem_of_union_aux h n).1 n g.choose, g.choose_spec⟩ + +namespace mem_of_union + +lemma constantEventually (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n k : ℕ) (hkn : k < n) : + (mem_of_union_aux L h n).1 k = (mem_of_union_aux L h (n + 1)).1 k := by + simp [mem_of_union_aux, hkn.ne] + +lemma constantEventually' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n k : ℕ) (hkn : k < n) : + (mem_of_union_aux L h n).1 k = (mem_of_union_aux L h (k + 1)).1 k := by + induction n with + | zero => + cases hkn + | succ n hn => + by_cases h' : k < n + · rw [← hn h'] + exact (constantEventually L h n k h').symm + · have hkn' : k = n := by + exact Nat.eq_of_lt_succ_of_not_lt hkn h' + rw [hkn'] + +lemma constantEventually'' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (m n k : ℕ) + (hkn : k < n) (hkm : k < m) : (mem_of_union_aux L h n).1 k + = (mem_of_union_aux L h m).1 k := by + rw [constantEventually' L h n k hkn, constantEventually' L h m k hkm] + +end mem_of_union + +/-- For `L : ℕ → Finset (Set α)` such that `∀ K ∈ L n, p K` and +`h : ∀ N, ⋂ k < N, ⋃₀ L k ≠ ∅`, `mem_of_union h n` is some `K : ℕ → Set α` such that `K n ∈ L n` +for all `n` (this is `prop₀`) and `∀ N, ⋂ (j < n, K j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ≠ ∅` +(this is `prop₁`.) -/ +noncomputable def mem_of_union (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) := + fun n ↦ (mem_of_union_aux L h (n + 1)).1 n + +namespace mem_of_union + +lemma prop₀ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : mem_of_union L h n ∈ L n := by + exact (mem_of_union_aux L h (n + 1)).2.1 n (Nat.lt_add_one n) + +lemma isSubset (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n N : ℕ) : + (⋂ j < n, mem_of_union L h j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ⊆ + ⋂ (k < n + N), (⋃₀ (L k).toSet) := by + have h' : ⋂ (k < n + N), (⋃₀ (L k).toSet) = + (⋂ (k < n), (⋃₀ (L k).toSet)) ∩ ⋂ (k < N), (⋃₀ (L (n + k)).toSet) := by + ext x + simp only [mem_iInter, mem_sUnion, Finset.mem_coe, mem_inter_iff] + refine ⟨fun h ↦ ⟨fun i hi ↦ ?_, fun i hi ↦ ?_⟩, fun h i hi ↦ ?_⟩ + · refine h i (lt_of_lt_of_le hi (Nat.le_add_right n N)) + · refine h (n + i) (Nat.add_lt_add_left hi n) + · by_cases hin : i < n + · exact h.1 i hin + · have h₁ : i - n < N := Nat.sub_lt_left_of_lt_add (Nat.le_of_not_lt hin) hi + have h₂ : n + (i - n) = i := by + exact add_sub_of_le <| Nat.le_of_not_lt hin + exact h₂ ▸ h.2 (i - n) h₁ + rw [h'] + apply inter_subset_inter _ fun ⦃a⦄ a ↦ a + have h'' (j : ℕ) (hj : j < n) : mem_of_union L h j ⊆ ⋃₀ (L j).toSet := by + exact subset_sUnion_of_mem <| prop₀ L h j + exact iInter₂_mono h'' + +lemma isSubsetN0 (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : + (⋂ j, mem_of_union L h j) ⊆ + ⋂ k, (⋃₀ (L k).toSet) := by + exact iInter_mono <| fun n ↦ + subset_sUnion_of_subset (↑(L n)) (mem_of_union L h n) (fun ⦃a⦄ a ↦ a) (prop₀ L h n) + +lemma has_p (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) + (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : p (mem_of_union L h n) := by + exact hL n (mem_of_union L h n) (prop₀ L h n) + +lemma prop₁ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : + ∀ N, (⋂ (j < n), (mem_of_union L h j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ := by + have h' : r L n (mem_of_union_aux L h n).fst := (mem_of_union_aux L h n).2.2 + simp only [r] at h' + simp only [mem_of_union] + intro N + specialize h' N + conv at h' => + lhs + enter [1,1] + intro j + enter[1] + intro hj + rw [constantEventually' L h n j hj] + exact h' + +lemma prop₁N0 (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : + (⋂ (j < n), (mem_of_union L h j)) ≠ ∅ := by + have h' : (⋂ (k < 0), (⋃₀ (L (n + k)).toSet)) = univ := by + simp + have d (s : Set α) : s = s ∩ univ := by exact left_eq_inter.mpr fun ⦃a⦄ a ↦ trivial + rw [d (⋂ j, ⋂ (_ : j < n), mem_of_union L h j)] + rw [← h'] + exact prop₁ L h n 0 + +end mem_of_union + +/-- Finite unions of sets in a compact system. -/ +def union (p : Set α → Prop) : Set α → Prop := + (sUnion '' ({ L : Set (Set α) | L.Finite ∧ ∀ K ∈ L, p K})) + +namespace union + +lemma mem_iff (s : Set α) : union p s ↔ ∃ L : Finset (Set α), s = ⋃₀ L ∧ ∀ K ∈ L, p K := by + refine ⟨fun ⟨L, hL⟩ ↦ ?_, fun h ↦ ?_⟩ + · simp only [mem_setOf_eq] at hL + let L' := (hL.1.1).toFinset + use L' + rw [← hL.2, Finite.coe_toFinset] + refine ⟨rfl, fun K hK ↦ ?_⟩ + rw [Finite.mem_toFinset] at hK + apply hL.1.2 K hK + · obtain ⟨L, hL⟩ := h + use L + simp only [mem_setOf_eq, Finset.finite_toSet, Finset.mem_coe, true_and] + refine ⟨hL.2, hL.1.symm⟩ + +theorem isCompactSystem (p : Set α → Prop)(hp : IsCompactSystem p) : IsCompactSystem (union p) := by + have hp' := (IsCompactSystem.iff_of_not_empty p).mp hp + rw [IsCompactSystem.iff_of_not_empty] + intro C hi + simp_rw [mem_iff] at hi + choose L' hL' using hi + have hL'1 := fun n ↦ (hL' n).1 + have hL'2 := fun n ↦ (hL' n).2 + simp_rw [hL'1] + intro hL + let K := mem_of_union L' hL + have h₁ : ⋂ i, K i ⊆ ⋂ i, ⋃₀ (L' i).toSet := by + apply mem_of_union.isSubsetN0 L' + have h₂ : ⋂ i, K i ≠ ∅ := by + apply hp' _ + · apply mem_of_union.has_p + exact hL'2 + · apply mem_of_union.prop₁N0 + rw [← nonempty_iff_ne_empty] at h₂ ⊢ + exact Nonempty.mono h₁ h₂ + +end union + +end Union + +end IsCompactSystem + section pi variable {ι : Type*} {α : ι → Type*} -/- In a product space, the intersection of square cylinders is empty iff there is a coordinate `i` -such that the projections to `i` have empty intersection. -/ theorem iInter_pi_empty_iff {β : Type*} (s : β → Set ι) (t : β → (i : ι) → Set (α i)) : - (⋂ b, ((s b).pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β) (_: i ∈ s b), (t b i) = ∅):= by + ( ⋂ b, ((s b).pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β) (_: i ∈ s b), (t b i) = ∅):= by rw [iInter_eq_empty_iff, not_iff_not.symm] push_neg - simp only [nonempty_iInter, mem_iInter] - refine ⟨fun ⟨x, hx⟩ i ↦ ?_, fun h ↦ ?_⟩ - · refine ⟨x i, fun j hi ↦ hx j i hi⟩ - · choose x hx using h - refine ⟨x, fun i j hj ↦ hx j i hj⟩ + refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ + · have ⟨x, hx⟩ := h + simp only [nonempty_iInter] + intro i + refine ⟨x i, fun j ↦ ?_⟩ + rw [mem_iInter] + intro hi + simp_rw [mem_pi] at hx + exact hx j i hi + · simp only [nonempty_iInter, mem_iInter] at h + choose x hx using h + use x + simp_rw [mem_pi] + intro i + intro j hj + exact hx j i hj theorem iInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) : ( ⋂ b, (univ.pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β), (t b i) = ∅):= by @@ -326,7 +532,7 @@ theorem biInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α exact biInter_eq_iInter p fun x h ↦ t x i simp_rw [h, h', iInter_univ_pi_empty_iff] -theorem pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : +theorem IsCompactSystem.pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : IsCompactSystem (univ.pi '' univ.pi C) := by intro S hS h_empty change ∀ i, S i ∈ univ.pi '' univ.pi C at hS @@ -347,8 +553,6 @@ theorem pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i end pi -end IsCompactSystem - section ClosedCompactSquareCylinders variable {ι : Type*} {α : ι → Type*} @@ -358,83 +562,117 @@ variable [∀ i, TopologicalSpace (α i)] variable (α) /-- The set of sets of the form `s.pi t`, where `s : Finset ι` and `t i` is both, closed and compact, for all `i ∈ s`. -/ -def compactClosedSquareCylinders : Set (Set (Π i, α i)) := - ⋃ (s) (t) (_ : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)), {squareCylinder s t} +def closedCompactSquareCylinders : Set (Set (Π i, α i)) := + ⋃ (s) (t) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), {squareCylinder s t} + +def closedCompactSquareCylinders' : Set (Set (Π i, α i)) := + ⋃ (s : Finset ι), s.toSet.pi '' s.toSet.pi + (fun (i : ι) ↦ fun t : Set (α i) ↦ IsCompact t ∧ IsClosed t) -def squareCylinders_of_prop (p : (i : ι) → Set (α i) → Prop) : Set (Set (Π i, α i)) := - ⋃ (s) (t) (_ : ∀ i ∈ s, p i (t i)), {squareCylinder s t} +lemma supset : + closedCompactSquareCylinders' α ⊆ (univ.pi '' univ.pi + (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by + intro S + simp [closedCompactSquareCylinders'] + intro s t hs hS + classical + use fun i ↦ (if i ∈ s then (t i) else univ) + simp + refine ⟨?_, ?_⟩ + · intro i + by_cases hs' : i ∈ s + · simp [hs'] + exact Or.inl (hs i hs') + · simp [hs'] + exact Or.inr rfl + · rw [← hS, ← univ_pi_ite s.toSet t] + simp variable {α} @[simp] -theorem mem_compactClosedSquareCylinders_iff (S : Set (Π i, α i)) : - S ∈ compactClosedSquareCylinders α +theorem mem_closedCompactSquareCylinders' (S : Set (Π i, α i)) : + S ∈ closedCompactSquareCylinders' α ↔ ∃ (s t : _) (_ : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)), - S = squareCylinder s t := by - simp_rw [compactClosedSquareCylinders, mem_iUnion, mem_singleton_iff] + squareCylinder s t = S := by + refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ <;> + simp only [closedCompactSquareCylinders', squareCylinder, + mem_iUnion, mem_image, mem_pi, Finset.mem_coe, exists_prop] at h ⊢ <;> + · exact h +@[simp] +theorem mem_closedCompactSquareCylinders (S : Set (Π i, α i)) : + S ∈ closedCompactSquareCylinders α + ↔ ∃ (s t : _) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), + S = squareCylinder s t := by + simp_rw [closedCompactSquareCylinders, mem_iUnion, mem_singleton_iff] variable {S : Set (Π i, α i)} /-- Given a closed compact cylinder, choose a finset of variables such that it only depends on these variables. -/ -noncomputable def compactClosedSquareCylinders.finset (hS : S ∈ compactClosedSquareCylinders α) : +noncomputable def closedCompactSquareCylinders.finset (hS : S ∈ closedCompactSquareCylinders α) : Finset ι := - ((mem_compactClosedSquareCylinders_iff S).mp hS).choose + ((mem_closedCompactSquareCylinders S).mp hS).choose /-- Given a closed compact square cylinder `S`, choose a dependent function `(i : ι) → Set (α i)` of which it is a lift. -/ -def closedCompactSquareCylinders.func (hS : S ∈ compactClosedSquareCylinders α) : +def closedCompactSquareCylinders.func (hS : S ∈ closedCompactSquareCylinders α) : (i : ι) → Set (α i) := - ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose + +theorem closedCompactSquareCylinders.isClosed (hS : S ∈ closedCompactSquareCylinders α) : + ∀ i ∈ closedCompactSquareCylinders.finset hS, + IsClosed (closedCompactSquareCylinders.func hS i) := + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose -theorem compactClosedSquareCylinders.isCompact_isClosed (hS : S ∈ compactClosedSquareCylinders α) : - ∀ i ∈ compactClosedSquareCylinders.finset hS, - IsCompact (closedCompactSquareCylinders.func hS i) ∧ - IsClosed (closedCompactSquareCylinders.func hS i) := - ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose_spec.choose +theorem closedCompactSquareCylinders.isCompact (hS : S ∈ closedCompactSquareCylinders α) : + ∀ i ∈ closedCompactSquareCylinders.finset hS, + IsCompact (closedCompactSquareCylinders.func hS i) := + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose -theorem closedCompactSquareCylinders.eq_squareCylinder (hS : S ∈ compactClosedSquareCylinders α) : - S = squareCylinder (compactClosedSquareCylinders.finset hS) +theorem closedCompactSquareCylinders.eq_squareCylinder (hS : S ∈ closedCompactSquareCylinders α) : + S = squareCylinder (closedCompactSquareCylinders.finset hS) (closedCompactSquareCylinders.func hS) := - ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose_spec.choose_spec + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose_spec theorem squareCylinder_mem_closedCompactSquareCylinders (s : Finset ι) (t : (i : ι) → Set (α i)) - (h : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)) : - squareCylinder s t ∈ compactClosedSquareCylinders α := by - rw [mem_compactClosedSquareCylinders_iff] - exact ⟨s, t, h, rfl⟩ + (hS_closed : ∀ i ∈ s, IsClosed (t i)) (hS_compact : ∀ i ∈ s, IsCompact (t i)) : + squareCylinder s t ∈ closedCompactSquareCylinders α := by + rw [mem_closedCompactSquareCylinders] + exact ⟨s, t, hS_closed, hS_compact, rfl⟩ -theorem CompactClosedOrUniv_pi : +theorem IsCompactSystem.CompactClosedOrUniv_pi : IsCompactSystem (univ.pi '' univ.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by apply IsCompactSystem.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ))) - <| fun i ↦ IsCompactSystem.of_isCompact_isClosed_or_univ + <| fun i ↦ IsCompactSystem.isClosedCompactOrUnivs (α i) /-- In `closedCompactSquareCylinders α`, the set of dependent variables is a finset, but not necessarily in `univ.pi '' univ.pi _`, where `_` are closed compact set, or `univ`. -/ -theorem compactClosedSquareCylinders_supset (S : _) : - S ∈ compactClosedSquareCylinders α → S ∈ (univ.pi '' univ.pi +theorem closedCompactSquareCylinders_supset (S : _) : + S ∈ closedCompactSquareCylinders α → S ∈ (univ.pi '' univ.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by classical intro hS - simp_rw [mem_compactClosedSquareCylinders_iff, squareCylinder] at hS + simp_rw [mem_closedCompactSquareCylinders, squareCylinder] at hS simp only [mem_image, mem_pi, mem_univ, forall_const] obtain ⟨s, t, h_cl, h_co, h_pi⟩ := hS let t' := fun (i : ι) ↦ if (i ∈ s) then (t i) else univ - refine ⟨t', fun i ↦ ?_, ?_⟩ - · by_cases hi : i ∈ s + refine ⟨t', ?_, ?_⟩ + · intro i + by_cases hi : i ∈ s · simp only [hi, ↓reduceIte, t'] - exact Or.inl (h_cl i hi) + exact Or.inl ⟨h_co i hi, h_cl i hi⟩ · simp only [hi, ↓reduceIte, t'] apply Or.inr rfl - · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = (s : Set ι).pi t - rw [univ_pi_ite s t] + · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = S + rw [h_pi, univ_pi_ite s t] /-- Closed and compact square cylinders form a compact system. -/ -theorem isCompactSystem.compactClosedSquareCylinders : - IsCompactSystem (compactClosedSquareCylinders α) := - IsCompactSystem.mono CompactClosedOrUniv_pi - compactClosedSquareCylinders_supset +theorem IsCompactSystem.closedCompactSquareCylinders : + IsCompactSystem (closedCompactSquareCylinders α) := + IsCompactSystem.of_supset IsCompactSystem.CompactClosedOrUniv_pi + closedCompactSquareCylinders_supset end ClosedCompactSquareCylinders From 897d8e8449268681d10b38515b52a51b3f9f6a57 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Thu, 29 May 2025 23:53:16 +0200 Subject: [PATCH 064/129] need univ --- .../Topology/Compactness/CompactSystem.lean | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index c9e08ec54be20a..1888da32006e9b 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -551,6 +551,25 @@ theorem IsCompactSystem.pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCo rw [biInter_univ_pi_empty_iff x] use i +theorem squareCylinders (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : + IsCompactSystem (squareCylinders C) := by + apply IsCompactSystem.mono (pi C hC) + intro S hS + obtain ⟨s, t, h₀, h₁⟩ := hS + simp [squareCylinder] at h₁ + rw [h₁] + simp at h₀ + classical + let t' := fun i ↦ (if i ∈ s then (t i) else univ) + use t' + refine ⟨?_, ?_⟩ + · simp + sorry + · sorry + + sorry + + end pi section ClosedCompactSquareCylinders From f269df73806824d330e2e575d2a6f684b71ee27b Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 30 May 2025 00:22:16 +0200 Subject: [PATCH 065/129] Revert "need univ" This reverts commit 3cff98073fccef4f724317f05b5a40bb504b88d0. --- .../Topology/Compactness/CompactSystem.lean | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 1888da32006e9b..c9e08ec54be20a 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -551,25 +551,6 @@ theorem IsCompactSystem.pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCo rw [biInter_univ_pi_empty_iff x] use i -theorem squareCylinders (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : - IsCompactSystem (squareCylinders C) := by - apply IsCompactSystem.mono (pi C hC) - intro S hS - obtain ⟨s, t, h₀, h₁⟩ := hS - simp [squareCylinder] at h₁ - rw [h₁] - simp at h₀ - classical - let t' := fun i ↦ (if i ∈ s then (t i) else univ) - use t' - refine ⟨?_, ?_⟩ - · simp - sorry - · sorry - - sorry - - end pi section ClosedCompactSquareCylinders From 46286745c81aaaf36256f00dabdc403bdeccdb58 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 30 May 2025 00:27:53 +0200 Subject: [PATCH 066/129] Revert "sq" This reverts commit 7fbd0b2c9f9982253b4acdd211c44ee24b399755. --- .../Topology/Compactness/CompactSystem.lean | 686 ++++++------------ 1 file changed, 217 insertions(+), 469 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index c9e08ec54be20a..c28efdbb667e5e 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ import Mathlib.Data.Set.Dissipate +import Mathlib.Logic.IsEmpty import Mathlib.MeasureTheory.Constructions.Cylinders import Mathlib.Order.OmegaCompletePartialOrder import Mathlib.Topology.Separation.Hausdorff @@ -16,16 +17,16 @@ This file defines compact systems of sets. * `IsCompactSystem`: A set of sets is a compact system if, whenever a countable subfamily has empty intersection, then finitely many of them already have empty intersection. -* `IsCompactSystem.union`: The set system of finite unions of another set system. + ## Main results +* `IsCompactSystemiff_isCompactSystem_of_or_univ`: A set system is a compact +system iff inserting `univ` gives a compact system. * `IsClosedCompact.isCompactSystem`: The set of closed and compact sets is a compact system. * `IsClosedCompact.isCompactSystem_of_T2Space`: In a `T2Space α`, the set of compact sets is a compact system in a `T2Space`. -* `IsCompactSystem.union.isCompactSystem`: If `IsCompactSystem p`, the set of finite unions - of `K : Set α` with `p K` is a compact system. * `IsCompactSystem.closedCompactSquareCylinders`: Closed and compact square cylinders form a - compact system in a product space. + compact system. -/ open Set Nat MeasureTheory @@ -43,21 +44,21 @@ end definition namespace IsCompactSystem -/-- In a compact system, given a countable family with empty intersection, we choose a finite -subfamily with empty intersection. -/ -/-- In a compact system, given a countable family with empty intersection, we choose a finite -subfamily with empty intersection. -/ +open Classical in +/-- In a compact system, given a countable family with `⋂ i, C i = ∅`, we choose the smallest `n` +with `⋂ (i ≤ n), C i = ∅`. -/ noncomputable -def max_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) +def finite_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) (hC_empty : ⋂ i, C i = ∅) : ℕ := - (hp C hC hC_empty).choose + Nat.find (hp C hC hC_empty) -lemma iInter_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) +open Classical in +lemma dissipate_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) (hC_empty : ⋂ i, C i = ∅) : - Dissipate C (hp.max_of_empty hC hC_empty) = ∅ := - (hp C hC hC_empty).choose_spec + Dissipate C (hp.finite_of_empty hC hC_empty) = ∅ := by + apply Nat.find_spec (hp C hC hC_empty) -theorem iff_of_nempty (p : Set α → Prop) : +theorem iff_nonempty_iInter (p : Set α → Prop) : IsCompactSystem p ↔ (∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ (n : ℕ), (dissipate C n).Nonempty) → (⋂ i, C i).Nonempty) := by refine ⟨fun h C hC hn ↦ ?_, fun h C hC ↦ ?_⟩ <;> have h2 := not_imp_not.mpr <| h C hC @@ -68,9 +69,9 @@ theorem iff_of_nempty (p : Set α → Prop) : /-- In this equivalent formulation for a compact system, note that we use `⋂ k < n, C k` rather than `⋂ k ≤ n, C k`. -/ -lemma iff_of_not_empty (p : Set α → Prop) : IsCompactSystem p ↔ - ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ n, ⋂ k < n, C k ≠ ∅) → ⋂ i, C i ≠ ∅ := by - simp_rw [← Set.nonempty_iff_ne_empty, iff_of_nempty] +lemma iff_nonempty_iInter_of_lt (p : Set α → Prop) : IsCompactSystem p ↔ + ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ n, (⋂ k < n, C k).Nonempty) → (⋂ i, C i).Nonempty := by + simp_rw [iff_nonempty_iInter] refine ⟨fun h C hi h'↦ ?_, fun h C hi h' ↦ ?_⟩ · apply h C hi exact fun n ↦ dissipate_eq ▸ (h' (n + 1)) @@ -85,18 +86,135 @@ lemma iff_of_not_empty (p : Set α → Prop) : IsCompactSystem p ↔ rw [mem_iInter₂, mem_iInter₂] exact fun h i hi ↦ h i hi.le -theorem iff_directed (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : - (IsCompactSystem p) ↔ - (∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → - ⋂ i, C i = ∅ → ∃ (n : ℕ), C n = ∅) := by - refine ⟨fun h ↦ fun C hdi hi ↦ ?_, fun h C h1 h2 ↦ ?_⟩ - · rw [dissipate_exists_empty_iff_of_directed C hdi] - exact h C hi - · rw [← biInter_le_eq_iInter] at h2 - exact h (Dissipate C) dissipate_directed (dissipate_of_piSystem hpi h1) h2 +/-- Any subset of a compact system is a compact system. -/ +theorem mono {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : + IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs -theorem iff_directed' (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : - (IsCompactSystem p) ↔ +/-- A set system is a compact system iff adding `∅` gives a compact system. -/ +lemma iff_isCompactSystem_of_or_empty : IsCompactSystem p ↔ + IsCompactSystem (fun s ↦ (p s ∨ (s = ∅))) := by + refine ⟨fun h s h' hd ↦ ?_, fun h ↦ mono h (fun s ↦ fun a ↦ Or.symm (Or.inr a))⟩ + by_cases g : ∃ n, s n = ∅ + · use g.choose + rw [← subset_empty_iff] at hd ⊢ + exact le_trans (dissipate_subset (by rfl)) g.choose_spec.le + · push_neg at g + have hj (i : _) : p (s i) := by + rcases h' i with a | b + · exact a + · exfalso + revert g i + simp_rw [← Set.not_nonempty_iff_eq_empty] + simp_rw [imp_false, not_not] + exact fun h i ↦ h i + exact h s hj hd + +lemma of_IsEmpty (h : IsEmpty α) (p : Set α → Prop) : IsCompactSystem p := + fun s _ _ ↦ ⟨0, Set.eq_empty_of_isEmpty (Dissipate s 0)⟩ + +/-- A set system is a compact system iff adding `univ` gives a compact system. -/ +lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ + IsCompactSystem (fun s ↦ (p s ∨ s = univ)) := by + refine ⟨fun h ↦ ?_, fun h ↦ mono h (fun s ↦ fun a ↦ Or.symm (Or.inr a))⟩ + wlog ht : Nonempty α + · rw [not_nonempty_iff] at ht + apply of_IsEmpty ht + · rw [iff_nonempty_iInter] at h ⊢ + intro s h' hd + classical + by_cases h₀ : ∀ n, ¬p (s n) + · simp only [h₀, false_or] at h' + simp_rw [h', iInter_univ, Set.univ_nonempty] + · push_neg at h₀ + let n := Nat.find h₀ + let s' := fun i ↦ if p (s i) then s i else s n + have h₁ : ∀ i, p (s' i) := by + intro i + by_cases h₁ : p (s i) + · simp only [h₁, ↓reduceIte, s'] + · simp only [h₁, ↓reduceIte, Nat.find_spec h₀, s', n] + have h₃ : ∀ i, (p (s i) → s' i = s i) := fun i h ↦ if_pos h + have h₄ : ∀ i, (¬p (s i) → s' i = s n) := fun i h ↦ if_neg h + have h₂ : ⋂ i, s i = ⋂ i, s' i := by + simp only [s'] at * + ext x + simp only [mem_iInter] + refine ⟨fun h i ↦ ?_, fun h i ↦ ?_⟩ + · by_cases h' : p (s i) <;> simp only [h', ↓reduceIte, h, s', n] + · specialize h' i + specialize h i + rcases h' with a | b + · simp only [a, ↓reduceIte, s', n] at h + exact h + · simp only [b, Set.mem_univ] + apply h₂ ▸ h s' h₁ + by_contra! a + obtain ⟨j, hj⟩ := a + have h₂ (v : ℕ) (hv : n ≤ v) : Dissipate s v = Dissipate s' v:= by + ext x + refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ <;> simp only [dissipate_def, mem_iInter] at h ⊢ <;> + intro i hi + · by_cases h₅ : p (s i) + · exact (h₃ i h₅) ▸ h i hi + · exact (h₄ i h₅) ▸ h n hv + · by_cases h₅ : p (s i) + · exact (h₃ i h₅) ▸ h i hi + · have h₆ : s i = univ := by + specialize h' i + simp only [h₅, false_or] at h' + exact h' + simp only [h₆, Set.mem_univ] + have h₇ : Dissipate s' (max j n) = ∅ := by + rw [← subset_empty_iff] at hj ⊢ + exact le_trans (antitone_dissipate (Nat.le_max_left j n)) hj + specialize h₂ (max j n) (Nat.le_max_right j n) + specialize hd (max j n) + rw [h₂, Set.nonempty_iff_ne_empty, h₇] at hd + exact hd rfl + +theorem iff_directed (hpi : IsPiSystem p) : + IsCompactSystem p ↔ + ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → + ⋂ i, C i = ∅ → ∃ (n : ℕ), C n = ∅ := by + rw [iff_isCompactSystem_of_or_empty] + refine ⟨fun h ↦ fun C hdi hi ↦ ?_, fun h C h1 h2 ↦ ?_⟩ + · rw [exists_dissipate_eq_empty_iff_of_directed C hdi] + apply h C + exact fun i ↦ Or.inl (hi i) + · have hpi' : IsPiSystem (fun s ↦ p s ∨ s = ∅) := by + intro a ha b hb hab + rcases ha with ha₁ | ha₂ + · rcases hb with hb₁ | hb₂ + · left + exact hpi a ha₁ b hb₁ hab + · right + exact hb₂ ▸ (Set.inter_empty a) + · simp only [ha₂, Set.empty_inter] + right + rfl + rw [← biInter_le_eq_iInter] at h2 + obtain h' := h (Dissipate C) directed_dissipate + have h₀ : (∀ (n : ℕ), p (Dissipate C n) ∨ Dissipate C n = ∅) → ⋂ n, Dissipate C n = ∅ → + ∃ n, Dissipate C n = ∅ := by + intro h₀ h₁ + by_cases f : ∀ n, p (Dissipate C n) + · apply h' f h₁ + · push_neg at f + obtain ⟨n, hn⟩ := f + use n + specialize h₀ n + simp_all only [false_or] + obtain h'' := dissipate_of_piSystem hpi' h1 + have h₁ : ∀ (n : ℕ), p (Dissipate C n) ∨ Dissipate C n = ∅ := by + intro n + by_cases g : (Dissipate C n).Nonempty + · exact h'' n g + · right + exact Set.not_nonempty_iff_eq_empty.mp g + apply h₀ h₁ h2 + +theorem iff_directed' (hpi : IsPiSystem p) : + IsCompactSystem p ↔ ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → (∀ (n : ℕ), (C n).Nonempty) → (⋂ i, C i).Nonempty := by rw [IsCompactSystem.iff_directed hpi] @@ -104,50 +222,17 @@ theorem iff_directed' (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : · exact h1 C h3 h4 · exact h1 C h3 s -/-- Any subset of a compact system is a compact system. -/ -theorem of_supset {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : - IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs +section IsCompactIsClosed -section ClosedCompact -/-- Any subset of a compact system is a compact system. -/ -theorem of_supset {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : - IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs - -section ClosedCompact +variable {α : Type*} [TopologicalSpace α] -variable (α : Type*) [TopologicalSpace α] -variable (α : Type*) [TopologicalSpace α] - -/-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ -theorem isClosedCompactOrUnivs : - IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by - let p := fun (s : Set α) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ) - have h2 : ∀ (s t : Set α), p s → p t → p (s ∩ t) := by - intro s t hs ht - by_cases hs' : s = univ - · rw [hs', univ_inter] - exact ht - · by_cases ht' : t = univ - · rw [ht', inter_comm, univ_inter] - exact hs - · exact Or.inl <| ⟨IsCompact.inter_right (Or.resolve_right hs hs').1 - (Or.resolve_right ht ht').2, IsClosed.inter (Or.resolve_right hs hs').2 - (Or.resolve_right ht ht').2⟩ -/-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ -theorem isClosedCompactOrUnivs : - IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by - let p := fun (s : Set α) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ) - have h2 : ∀ (s t : Set α), p s → p t → p (s ∩ t) := by - intro s t hs ht - by_cases hs' : s = univ - · rw [hs', univ_inter] - exact ht - · by_cases ht' : t = univ - · rw [ht', inter_comm, univ_inter] - exact hs - · exact Or.inl <| ⟨IsCompact.inter_right (Or.resolve_right hs hs').1 - (Or.resolve_right ht ht').2, IsClosed.inter (Or.resolve_right hs hs').2 - (Or.resolve_right ht ht').2⟩ +/-- The set of compact and closed sets is a compact system. -/ +theorem of_isCompact_isClosed : + IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by + let p := fun (s : Set α) ↦ IsCompact s ∧ IsClosed s + have h2 : IsPiSystem p := by + intro s hs t ht _ + refine ⟨IsCompact.inter_left ht.1 hs.2, IsClosed.inter hs.2 ht.2⟩ rw [IsCompactSystem.iff_directed' h2] intro s hs h1 h2 let s' := fun (i : { j : ℕ | s j ≠ univ}) ↦ s i @@ -157,9 +242,9 @@ theorem isClosedCompactOrUnivs : have hz : s z ≠ univ := fun h ↦ a.prop <| eq_univ_of_subset hz1 h use ⟨z, hz⟩ have htcl : ∀ (i : { j : ℕ | s j ≠ univ}), IsClosed (s i) := - fun i ↦ (Or.resolve_right (h1 i.val) i.prop).2 + fun i ↦ (h1 i).2 have htco : ∀ (i : { j : ℕ | s j ≠ univ}), IsCompact (s i) := - fun i ↦ (Or.resolve_right (h1 i.val) i.prop).1 + fun i ↦ (h1 i).1 haveI f : Nonempty α := by apply Exists.nonempty _ · exact fun x ↦ x ∈ s 0 @@ -178,344 +263,39 @@ theorem isClosedCompactOrUnivs : apply g <| IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed s' hs' (fun j ↦ h2 j) htco htcl · simp only [ne_eq, coe_setOf, nonempty_subtype, not_exists, not_not, s'] at h - simp only [nonempty_iInter, s', h] - simp only [Set.mem_univ, implies_true, exists_const, s'] + simp [s', h] -/-- The set of compact and closed sets is a compact system. -/ -theorem isClosedCompacts : - IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := - IsCompactSystem.of_supset (isClosedCompactOrUnivs α) (fun _ hs ↦ Or.inl hs) - -theorem isCompacts (h : ∀ {s : Set α}, IsCompact s → IsClosed s) : - simp only [nonempty_iInter, s', h] - simp only [Set.mem_univ, implies_true, exists_const, s'] - -/-- The set of compact and closed sets is a compact system. -/ -theorem isClosedCompacts : - IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := - IsCompactSystem.of_supset (isClosedCompactOrUnivs α) (fun _ hs ↦ Or.inl hs) +/-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ +theorem of_isCompact_isClosed_or_univ : + IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by + rw [← iff_isCompactSystem_of_or_univ] + exact of_isCompact_isClosed -theorem isCompacts (h : ∀ {s : Set α}, IsCompact s → IsClosed s) : +/-- In a `T2Space` the set of compact sets is a compact system. -/ +theorem of_isCompact [T2Space α] : IsCompactSystem (fun s : Set α ↦ IsCompact s) := by have h : (fun s : Set α ↦ IsCompact s) = (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by ext s - refine ⟨fun h' ↦ ⟨h', h h'⟩, fun h' ↦ h'.1⟩ - exact h ▸ (isClosedCompacts α) - -/-- In a `T2Space` The set of compact sets is a compact system. -/ -theorem _of_isCompact_of_T2Space [T2Space α] : - IsCompactSystem (fun s : Set α ↦ IsCompact s) := (isCompacts α) (fun hs ↦ hs.isClosed) - -end ClosedCompact - -section Union - -lemma l2 {ι : Type*} (s t : Set α) (u : Set ι) (L : (i : ι) → (hi : i ∈ u) → Set α) - (h : s ⊆ ⋃ (n : ι) (hn : n ∈ u), L n hn) (h' : ∀ (n : ι) (hn : n ∈ u), t ∩ (L n hn) = ∅) : - t ∩ s = ∅ := by - have j : ⋃ (n : ι) (hn : n ∈ u), t ∩ (L n hn) = ∅ := by - simp_rw [iUnion_eq_empty] - exact h' - simp_rw [← subset_empty_iff] at h' j ⊢ - have j' : ⋃ (n : u), t ∩ L n.val n.prop = ⋃ n, ⋃ (hn : n ∈ u), t ∩ L n hn := by - exact iUnion_coe_set u fun i ↦ t ∩ L (↑i) (Subtype.prop i) - rw [← j', ← inter_iUnion, iUnion_coe_set] at j - have gf := inter_subset_inter (t₁ := t) (fun ⦃a_1⦄ a ↦ a) h - apply le_trans gf j - -variable {p : Set α → Prop} (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) - (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) - --- variable (p : {n : ℕ} → ((k : Fin (n + 1)) → (β k)) → Prop) - -/-- `r n K` is the property which must hold for compact systems: -`∀ N, (⋂ (j < n), (K j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅`. -/ -noncomputable def r (n : ℕ) (K : ℕ → Set α) : Prop := - ∀ N, (⋂ (j < n), (K j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ - --- h0 -> (get_element_zero hL hc) --- (h0 : ∃ x : (ℕ → α), x 0 ∈ β 0 ∧ p 0 x) - -lemma nonempty' (n : ℕ) (K : ℕ → Set α) - (hc : ∀ N, (⋂ (k < n), K k) ∩ (⋂ k < N, ⋃₀ (L (n + k))) ≠ ∅) : (L n).Nonempty := by - specialize hc 1 - by_contra! h - simp only [Finset.not_nonempty_iff_eq_empty] at h - apply hc - simp [h] - -lemma nonempty (k : ℕ) (hc : ∀ N, ⋂ k < N, ⋃₀ (L k : Set (Set α)) ≠ ∅) : (L k).Nonempty := by - specialize hc (k + 1) - by_contra! h - simp only [Finset.not_nonempty_iff_eq_empty] at h - apply hc - apply iInter_eq_empty_iff.mpr fun x ↦ ⟨k, ?_⟩ - -- simp only [Nat.lt_add_one, iInter_true, mem_sUnion, Finset.mem_coe, not_exists, not_and] - simp only [Nat.lt_add_one, iInter_true, Finset.mem_coe, not_exists, not_and] - have hg : ⋃₀ (L k : Set (Set α)) = ∅ := by - rw [h] - simp only [Finset.coe_empty, sUnion_empty] - exact of_eq_false (congrFun hg x) - -/-- `q n K` is the joint property that `(∀ k < n, K k ∈ L k)` and `r n K)` holds. -/ -def q : ℕ → (ℕ → Set α) → Prop := fun n K ↦ (∀ k < n, K k ∈ L k) ∧ (r L n K) - -lemma get_element_zero (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : - ∃ (K : ℕ → Set α), q L 0 K := by - simp [q, r, h] - -lemma get_element_succ' (n : ℕ) - (K : ℕ → Set α) (hK : q L n K) : ∃ y, q L (n + 1) (Function.update K n y) := by - simp_rw [q, r] at hK ⊢ - by_contra! h - choose b hb using h - have hn : ∀ y ∈ L n, ∀ k < n + 1, Function.update K n y k ∈ L k := by - intro y hy k hk - by_cases d : n = k - · rw [d] - simp only [Function.update_self] - exact d ▸ hy - · have d' : k < n := by - by_contra h - apply d - simp only [not_lt] at h - apply Eq.symm - exact Nat.eq_of_le_of_lt_succ h hk - simp only [ne_eq, d'.ne, not_false_eq_true, Function.update_of_ne] - exact hK.1 k d' - classical - let b' := fun y ↦ dite (y ∈ L n) (fun hy ↦ (b y (hn y hy))) (fun _ ↦ 0) - have hb' := fun y hy ↦ hb y (hn y hy) - have hb'' (y : Set α) (hy : y ∈ L n) : b y (hn y hy) = b' y := by - simp [b', hy] - obtain ⟨K0Max, ⟨hK0₁, hK0₂⟩⟩ := Finset.exists_max_image (L n) b' (nonempty' L n K hK.2) - apply hK.2 (b' K0Max + 1) - have h₁ (y s : Set α): (⋂ j, ⋂ (_ : j < n + 1), Function.update K n y j) ∩ s = - (⋂ j, ⋂ (_ : j < n), K j) ∩ y ∩ s := by - apply congrFun (congrArg Inter.inter _) s - ext x - refine ⟨fun h ↦ ⟨?_, ?_⟩, fun h ↦ ?_⟩ <;> simp only [mem_iInter, mem_inter_iff] at h ⊢ - · intro i hi - have h' := h i (le_trans hi (le_succ n)) - simp only [ne_eq, hi.ne, not_false_eq_true, Function.update_of_ne] at h' - exact h' - · have h'' := h n (Nat.lt_add_one n) - simp only [Function.update_self] at h'' - exact h'' - · intro i hi - by_cases h₁ : i < n - · simp only [ne_eq, h₁.ne, not_false_eq_true, Function.update_of_ne] - exact h.1 i h₁ - · simp only [not_lt] at h₁ - have h₂ := Nat.eq_of_le_of_lt_succ h₁ hi - rw [h₂] - simp only [Function.update_self] - exact h.2 - simp_rw [h₁] at hb' - - have h₂ : ⋂ k < b' K0Max + 1, ⋃₀ (L (n + k)).toSet ⊆ - ⋃ (y : Set α) (hy : y ∈ L n), y ∩ ⋂ (k < b y (hn y hy)), ⋃₀ (L (n + 1 + k)).toSet := by - obtain ⟨y, hy⟩ := nonempty' L n K hK.2 - intro x hx - simp only [mem_iInter, mem_sUnion, Finset.mem_coe, mem_iUnion, mem_inter_iff, - exists_and_left] at hx ⊢ - obtain ⟨i, hi⟩ := hx 0 (zero_lt_succ (b' K0Max)) - rw [add_zero] at hi - use i, hi.2, hi.1 - intro k hk - have hk' : 1 + k < b' K0Max + 1:= by - rw [add_comm] - simp only [Nat.add_lt_add_iff_right] - apply lt_of_lt_of_le hk - rw [hb''] - apply hK0₂ i hi.1 - exact hi.1 - obtain ⟨t, ht⟩ := hx (1 + k) hk' - rw [← add_assoc] at ht - use t, ht.1, ht.2 - simp_rw [inter_assoc] at hb' - apply l2 (s := ⋂ k < b' K0Max + 1, ⋃₀ (L (n + k)).toSet) (t := (⋂ j < n, K j)) (u := L n) - (L := fun (y : Set α) (hy : y ∈ L n) ↦ (y ∩ ⋂ k, ⋂ (hk : k < b y (hn y hy)), - ⋃₀ (L (n + 1 + k)).toSet)) h₂ hb' - -/-- `mem_of_union_aux h n` is the product of some `K : ℕ → Set α)` and `q n K`. -Constructing `(mem_of_union_aux h n).1` works inductively. When constructing -`(mem_of_union_aux h (n + 1)).1`, we update `(mem_of_union_aux h n).1` only at position `n`. -/ -noncomputable def mem_of_union_aux (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : - (n : ℕ) → ((K : ℕ → Set α) ×' (q L n K)) - | 0 => ⟨(get_element_zero L h).choose, (get_element_zero L h).choose_spec⟩ - | n + 1 => by - have g := (get_element_succ' L) n (mem_of_union_aux h n).1 (mem_of_union_aux h n).2 - exact ⟨Function.update (mem_of_union_aux h n).1 n g.choose, g.choose_spec⟩ - -namespace mem_of_union - -lemma constantEventually (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n k : ℕ) (hkn : k < n) : - (mem_of_union_aux L h n).1 k = (mem_of_union_aux L h (n + 1)).1 k := by - simp [mem_of_union_aux, hkn.ne] - -lemma constantEventually' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n k : ℕ) (hkn : k < n) : - (mem_of_union_aux L h n).1 k = (mem_of_union_aux L h (k + 1)).1 k := by - induction n with - | zero => - cases hkn - | succ n hn => - by_cases h' : k < n - · rw [← hn h'] - exact (constantEventually L h n k h').symm - · have hkn' : k = n := by - exact Nat.eq_of_lt_succ_of_not_lt hkn h' - rw [hkn'] - -lemma constantEventually'' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (m n k : ℕ) - (hkn : k < n) (hkm : k < m) : (mem_of_union_aux L h n).1 k - = (mem_of_union_aux L h m).1 k := by - rw [constantEventually' L h n k hkn, constantEventually' L h m k hkm] - -end mem_of_union - -/-- For `L : ℕ → Finset (Set α)` such that `∀ K ∈ L n, p K` and -`h : ∀ N, ⋂ k < N, ⋃₀ L k ≠ ∅`, `mem_of_union h n` is some `K : ℕ → Set α` such that `K n ∈ L n` -for all `n` (this is `prop₀`) and `∀ N, ⋂ (j < n, K j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ≠ ∅` -(this is `prop₁`.) -/ -noncomputable def mem_of_union (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) := - fun n ↦ (mem_of_union_aux L h (n + 1)).1 n - -namespace mem_of_union - -lemma prop₀ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : mem_of_union L h n ∈ L n := by - exact (mem_of_union_aux L h (n + 1)).2.1 n (Nat.lt_add_one n) - -lemma isSubset (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n N : ℕ) : - (⋂ j < n, mem_of_union L h j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ⊆ - ⋂ (k < n + N), (⋃₀ (L k).toSet) := by - have h' : ⋂ (k < n + N), (⋃₀ (L k).toSet) = - (⋂ (k < n), (⋃₀ (L k).toSet)) ∩ ⋂ (k < N), (⋃₀ (L (n + k)).toSet) := by - ext x - simp only [mem_iInter, mem_sUnion, Finset.mem_coe, mem_inter_iff] - refine ⟨fun h ↦ ⟨fun i hi ↦ ?_, fun i hi ↦ ?_⟩, fun h i hi ↦ ?_⟩ - · refine h i (lt_of_lt_of_le hi (Nat.le_add_right n N)) - · refine h (n + i) (Nat.add_lt_add_left hi n) - · by_cases hin : i < n - · exact h.1 i hin - · have h₁ : i - n < N := Nat.sub_lt_left_of_lt_add (Nat.le_of_not_lt hin) hi - have h₂ : n + (i - n) = i := by - exact add_sub_of_le <| Nat.le_of_not_lt hin - exact h₂ ▸ h.2 (i - n) h₁ - rw [h'] - apply inter_subset_inter _ fun ⦃a⦄ a ↦ a - have h'' (j : ℕ) (hj : j < n) : mem_of_union L h j ⊆ ⋃₀ (L j).toSet := by - exact subset_sUnion_of_mem <| prop₀ L h j - exact iInter₂_mono h'' - -lemma isSubsetN0 (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : - (⋂ j, mem_of_union L h j) ⊆ - ⋂ k, (⋃₀ (L k).toSet) := by - exact iInter_mono <| fun n ↦ - subset_sUnion_of_subset (↑(L n)) (mem_of_union L h n) (fun ⦃a⦄ a ↦ a) (prop₀ L h n) - -lemma has_p (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) - (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : p (mem_of_union L h n) := by - exact hL n (mem_of_union L h n) (prop₀ L h n) - -lemma prop₁ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : - ∀ N, (⋂ (j < n), (mem_of_union L h j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ := by - have h' : r L n (mem_of_union_aux L h n).fst := (mem_of_union_aux L h n).2.2 - simp only [r] at h' - simp only [mem_of_union] - intro N - specialize h' N - conv at h' => - lhs - enter [1,1] - intro j - enter[1] - intro hj - rw [constantEventually' L h n j hj] - exact h' - -lemma prop₁N0 (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : - (⋂ (j < n), (mem_of_union L h j)) ≠ ∅ := by - have h' : (⋂ (k < 0), (⋃₀ (L (n + k)).toSet)) = univ := by - simp - have d (s : Set α) : s = s ∩ univ := by exact left_eq_inter.mpr fun ⦃a⦄ a ↦ trivial - rw [d (⋂ j, ⋂ (_ : j < n), mem_of_union L h j)] - rw [← h'] - exact prop₁ L h n 0 - -end mem_of_union - -/-- Finite unions of sets in a compact system. -/ -def union (p : Set α → Prop) : Set α → Prop := - (sUnion '' ({ L : Set (Set α) | L.Finite ∧ ∀ K ∈ L, p K})) - -namespace union - -lemma mem_iff (s : Set α) : union p s ↔ ∃ L : Finset (Set α), s = ⋃₀ L ∧ ∀ K ∈ L, p K := by - refine ⟨fun ⟨L, hL⟩ ↦ ?_, fun h ↦ ?_⟩ - · simp only [mem_setOf_eq] at hL - let L' := (hL.1.1).toFinset - use L' - rw [← hL.2, Finite.coe_toFinset] - refine ⟨rfl, fun K hK ↦ ?_⟩ - rw [Finite.mem_toFinset] at hK - apply hL.1.2 K hK - · obtain ⟨L, hL⟩ := h - use L - simp only [mem_setOf_eq, Finset.finite_toSet, Finset.mem_coe, true_and] - refine ⟨hL.2, hL.1.symm⟩ - -theorem isCompactSystem (p : Set α → Prop)(hp : IsCompactSystem p) : IsCompactSystem (union p) := by - have hp' := (IsCompactSystem.iff_of_not_empty p).mp hp - rw [IsCompactSystem.iff_of_not_empty] - intro C hi - simp_rw [mem_iff] at hi - choose L' hL' using hi - have hL'1 := fun n ↦ (hL' n).1 - have hL'2 := fun n ↦ (hL' n).2 - simp_rw [hL'1] - intro hL - let K := mem_of_union L' hL - have h₁ : ⋂ i, K i ⊆ ⋂ i, ⋃₀ (L' i).toSet := by - apply mem_of_union.isSubsetN0 L' - have h₂ : ⋂ i, K i ≠ ∅ := by - apply hp' _ - · apply mem_of_union.has_p - exact hL'2 - · apply mem_of_union.prop₁N0 - rw [← nonempty_iff_ne_empty] at h₂ ⊢ - exact Nonempty.mono h₁ h₂ - -end union - -end Union + refine ⟨fun h' ↦ ⟨h', h'.isClosed⟩, fun h ↦ h.1⟩ + exact h ▸ (of_isCompact_isClosed) -end IsCompactSystem +end IsCompactIsClosed section pi variable {ι : Type*} {α : ι → Type*} +/- In a product space, the intersection of square cylinders is empty iff there is a coordinate `i` +such that the projections to `i` have empty intersection. -/ theorem iInter_pi_empty_iff {β : Type*} (s : β → Set ι) (t : β → (i : ι) → Set (α i)) : - ( ⋂ b, ((s b).pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β) (_: i ∈ s b), (t b i) = ∅):= by + (⋂ b, ((s b).pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β) (_: i ∈ s b), (t b i) = ∅):= by rw [iInter_eq_empty_iff, not_iff_not.symm] push_neg - refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ - · have ⟨x, hx⟩ := h - simp only [nonempty_iInter] - intro i - refine ⟨x i, fun j ↦ ?_⟩ - rw [mem_iInter] - intro hi - simp_rw [mem_pi] at hx - exact hx j i hi - · simp only [nonempty_iInter, mem_iInter] at h - choose x hx using h - use x - simp_rw [mem_pi] - intro i - intro j hj - exact hx j i hj + simp only [nonempty_iInter, mem_iInter] + refine ⟨fun ⟨x, hx⟩ i ↦ ?_, fun h ↦ ?_⟩ + · refine ⟨x i, fun j hi ↦ hx j i hi⟩ + · choose x hx using h + refine ⟨x, fun i j hj ↦ hx j i hj⟩ theorem iInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) : ( ⋂ b, (univ.pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β), (t b i) = ∅):= by @@ -532,7 +312,7 @@ theorem biInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α exact biInter_eq_iInter p fun x h ↦ t x i simp_rw [h, h', iInter_univ_pi_empty_iff] -theorem IsCompactSystem.pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : +theorem pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : IsCompactSystem (univ.pi '' univ.pi C) := by intro S hS h_empty change ∀ i, S i ∈ univ.pi '' univ.pi C at hS @@ -553,6 +333,8 @@ theorem IsCompactSystem.pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCo end pi +end IsCompactSystem + section ClosedCompactSquareCylinders variable {ι : Type*} {α : ι → Type*} @@ -562,117 +344,83 @@ variable [∀ i, TopologicalSpace (α i)] variable (α) /-- The set of sets of the form `s.pi t`, where `s : Finset ι` and `t i` is both, closed and compact, for all `i ∈ s`. -/ -def closedCompactSquareCylinders : Set (Set (Π i, α i)) := - ⋃ (s) (t) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), {squareCylinder s t} - -def closedCompactSquareCylinders' : Set (Set (Π i, α i)) := - ⋃ (s : Finset ι), s.toSet.pi '' s.toSet.pi - (fun (i : ι) ↦ fun t : Set (α i) ↦ IsCompact t ∧ IsClosed t) +def compactClosedSquareCylinders : Set (Set (Π i, α i)) := + ⋃ (s) (t) (_ : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)), {squareCylinder s t} -lemma supset : - closedCompactSquareCylinders' α ⊆ (univ.pi '' univ.pi - (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by - intro S - simp [closedCompactSquareCylinders'] - intro s t hs hS - classical - use fun i ↦ (if i ∈ s then (t i) else univ) - simp - refine ⟨?_, ?_⟩ - · intro i - by_cases hs' : i ∈ s - · simp [hs'] - exact Or.inl (hs i hs') - · simp [hs'] - exact Or.inr rfl - · rw [← hS, ← univ_pi_ite s.toSet t] - simp +def squareCylinders_of_prop (p : (i : ι) → Set (α i) → Prop) : Set (Set (Π i, α i)) := + ⋃ (s) (t) (_ : ∀ i ∈ s, p i (t i)), {squareCylinder s t} variable {α} @[simp] -theorem mem_closedCompactSquareCylinders' (S : Set (Π i, α i)) : - S ∈ closedCompactSquareCylinders' α +theorem mem_compactClosedSquareCylinders_iff (S : Set (Π i, α i)) : + S ∈ compactClosedSquareCylinders α ↔ ∃ (s t : _) (_ : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)), - squareCylinder s t = S := by - refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ <;> - simp only [closedCompactSquareCylinders', squareCylinder, - mem_iUnion, mem_image, mem_pi, Finset.mem_coe, exists_prop] at h ⊢ <;> - · exact h - -@[simp] -theorem mem_closedCompactSquareCylinders (S : Set (Π i, α i)) : - S ∈ closedCompactSquareCylinders α - ↔ ∃ (s t : _) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), S = squareCylinder s t := by - simp_rw [closedCompactSquareCylinders, mem_iUnion, mem_singleton_iff] + simp_rw [compactClosedSquareCylinders, mem_iUnion, mem_singleton_iff] + variable {S : Set (Π i, α i)} /-- Given a closed compact cylinder, choose a finset of variables such that it only depends on these variables. -/ -noncomputable def closedCompactSquareCylinders.finset (hS : S ∈ closedCompactSquareCylinders α) : +noncomputable def compactClosedSquareCylinders.finset (hS : S ∈ compactClosedSquareCylinders α) : Finset ι := - ((mem_closedCompactSquareCylinders S).mp hS).choose + ((mem_compactClosedSquareCylinders_iff S).mp hS).choose /-- Given a closed compact square cylinder `S`, choose a dependent function `(i : ι) → Set (α i)` of which it is a lift. -/ -def closedCompactSquareCylinders.func (hS : S ∈ closedCompactSquareCylinders α) : +def closedCompactSquareCylinders.func (hS : S ∈ compactClosedSquareCylinders α) : (i : ι) → Set (α i) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose - -theorem closedCompactSquareCylinders.isClosed (hS : S ∈ closedCompactSquareCylinders α) : - ∀ i ∈ closedCompactSquareCylinders.finset hS, - IsClosed (closedCompactSquareCylinders.func hS i) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose + ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose -theorem closedCompactSquareCylinders.isCompact (hS : S ∈ closedCompactSquareCylinders α) : - ∀ i ∈ closedCompactSquareCylinders.finset hS, - IsCompact (closedCompactSquareCylinders.func hS i) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose +theorem compactClosedSquareCylinders.isCompact_isClosed (hS : S ∈ compactClosedSquareCylinders α) : + ∀ i ∈ compactClosedSquareCylinders.finset hS, + IsCompact (closedCompactSquareCylinders.func hS i) ∧ + IsClosed (closedCompactSquareCylinders.func hS i) := + ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose_spec.choose -theorem closedCompactSquareCylinders.eq_squareCylinder (hS : S ∈ closedCompactSquareCylinders α) : - S = squareCylinder (closedCompactSquareCylinders.finset hS) +theorem closedCompactSquareCylinders.eq_squareCylinder (hS : S ∈ compactClosedSquareCylinders α) : + S = squareCylinder (compactClosedSquareCylinders.finset hS) (closedCompactSquareCylinders.func hS) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose_spec + ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose_spec.choose_spec theorem squareCylinder_mem_closedCompactSquareCylinders (s : Finset ι) (t : (i : ι) → Set (α i)) - (hS_closed : ∀ i ∈ s, IsClosed (t i)) (hS_compact : ∀ i ∈ s, IsCompact (t i)) : - squareCylinder s t ∈ closedCompactSquareCylinders α := by - rw [mem_closedCompactSquareCylinders] - exact ⟨s, t, hS_closed, hS_compact, rfl⟩ + (h : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)) : + squareCylinder s t ∈ compactClosedSquareCylinders α := by + rw [mem_compactClosedSquareCylinders_iff] + exact ⟨s, t, h, rfl⟩ -theorem IsCompactSystem.CompactClosedOrUniv_pi : +theorem CompactClosedOrUniv_pi : IsCompactSystem (univ.pi '' univ.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by apply IsCompactSystem.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ))) - <| fun i ↦ IsCompactSystem.isClosedCompactOrUnivs (α i) + <| fun i ↦ IsCompactSystem.of_isCompact_isClosed_or_univ /-- In `closedCompactSquareCylinders α`, the set of dependent variables is a finset, but not necessarily in `univ.pi '' univ.pi _`, where `_` are closed compact set, or `univ`. -/ -theorem closedCompactSquareCylinders_supset (S : _) : - S ∈ closedCompactSquareCylinders α → S ∈ (univ.pi '' univ.pi +theorem compactClosedSquareCylinders_supset (S : _) : + S ∈ compactClosedSquareCylinders α → S ∈ (univ.pi '' univ.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by classical intro hS - simp_rw [mem_closedCompactSquareCylinders, squareCylinder] at hS + simp_rw [mem_compactClosedSquareCylinders_iff, squareCylinder] at hS simp only [mem_image, mem_pi, mem_univ, forall_const] obtain ⟨s, t, h_cl, h_co, h_pi⟩ := hS let t' := fun (i : ι) ↦ if (i ∈ s) then (t i) else univ - refine ⟨t', ?_, ?_⟩ - · intro i - by_cases hi : i ∈ s + refine ⟨t', fun i ↦ ?_, ?_⟩ + · by_cases hi : i ∈ s · simp only [hi, ↓reduceIte, t'] - exact Or.inl ⟨h_co i hi, h_cl i hi⟩ + exact Or.inl (h_cl i hi) · simp only [hi, ↓reduceIte, t'] apply Or.inr rfl - · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = S - rw [h_pi, univ_pi_ite s t] + · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = (s : Set ι).pi t + rw [univ_pi_ite s t] /-- Closed and compact square cylinders form a compact system. -/ -theorem IsCompactSystem.closedCompactSquareCylinders : - IsCompactSystem (closedCompactSquareCylinders α) := - IsCompactSystem.of_supset IsCompactSystem.CompactClosedOrUniv_pi - closedCompactSquareCylinders_supset +theorem isCompactSystem.compactClosedSquareCylinders : + IsCompactSystem (compactClosedSquareCylinders α) := + IsCompactSystem.mono CompactClosedOrUniv_pi + compactClosedSquareCylinders_supset end ClosedCompactSquareCylinders From 253f4e781dca2bc67d28617baaf01bd24855b0f9 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 30 May 2025 11:18:16 +0200 Subject: [PATCH 067/129] more general pi --- .../Constructions/Cylinders.lean | 31 +++++ .../Topology/Compactness/CompactSystem.lean | 109 +++++------------- 2 files changed, 63 insertions(+), 77 deletions(-) diff --git a/Mathlib/MeasureTheory/Constructions/Cylinders.lean b/Mathlib/MeasureTheory/Constructions/Cylinders.lean index d5dbfab136f86e..33c35ab2e807e5 100644 --- a/Mathlib/MeasureTheory/Constructions/Cylinders.lean +++ b/Mathlib/MeasureTheory/Constructions/Cylinders.lean @@ -77,6 +77,37 @@ theorem squareCylinders_eq_iUnion_image' (C : ∀ i, Set (Set (α i))) (hC : ∀ refine pi_image_eq_of_subset hC (subset_univ s) simp_rw [← mem_image, h] +@[simp] +theorem mem_squareCylinders (C : ∀ i, Set (Set (α i))) (hC : ∀ i, Nonempty (C i)) (S : _) : + S ∈ squareCylinders C ↔ ∃ (s t : _) (_ : ∀ i ∈ s, t i ∈ C i), S = squareCylinder s t := by + simp_rw [squareCylinders_eq_iUnion_image, squareCylinder] + refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ + · simp only [mem_iUnion, mem_image, mem_pi, mem_univ, forall_const] at h + obtain ⟨s, t, h₀, h₁⟩ := h + use s, t + simp only [h₁, h₀, implies_true, exists_const] + · obtain ⟨s, t, h₀, rfl⟩ := h + simp only [mem_iUnion, mem_image, mem_pi, mem_univ, forall_const] + classical + use s, (fun i ↦ if i ∈ s.toSet then t i else (hC i).some) + refine ⟨fun i ↦ ?_ ,?_⟩ + · by_cases h : i ∈ s <;> simp only [Finset.mem_coe, h, ↓reduceIte, Subtype.coe_prop, h₀] + · refine Set.pi_congr rfl (fun i hi ↦ by simp only [hi, ↓reduceIte] at *) + +theorem squareCylinders_subset_pi (C : ∀ i, Set (Set (α i))) (hC : ∀ i, univ ∈ C i) : + squareCylinders C ⊆ univ.pi '' univ.pi C := by + intro S hS + obtain ⟨s, t, h₀, h₁⟩ := hS + simp only [squareCylinder, mem_pi, mem_univ, forall_const] at h₀ h₁ + classical + use fun i ↦ (if i ∈ s.toSet then (t i) else univ) + refine ⟨fun i ↦ ?_, ?_⟩ + · simp only [mem_pi, mem_univ, forall_const] + by_cases hi : i ∈ s.toSet <;> simp only [hi, ↓reduceIte] + · exact h₀ i + · exact hC i + · rw [h₁, univ_pi_ite s t] + theorem isPiSystem_squareCylinders [∀ i, Inhabited (α i)] {C : ∀ i, Set (Set (α i))} (hC : ∀ i, IsPiSystem (C i)) (hC_univ : ∀ i, univ ∈ C i) : IsPiSystem (squareCylinders C) := by classical diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index c28efdbb667e5e..b1194242f23705 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -265,6 +265,11 @@ theorem of_isCompact_isClosed : · simp only [ne_eq, coe_setOf, nonempty_subtype, not_exists, not_not, s'] at h simp [s', h] +theorem nonempty_isCompactIsClosed : Nonempty { t : Set α | IsCompact t ∧ IsClosed t } := by + simp only [coe_setOf, nonempty_subtype] + use ∅ + simp + /-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ theorem of_isCompact_isClosed_or_univ : IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by @@ -331,6 +336,21 @@ theorem pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i rw [biInter_univ_pi_empty_iff x] use i +theorem squareCylinders (C : (i : ι) → Set (Set (α i))) (hC₀ : ∀ i, IsCompactSystem (C i)) + (hC₁ : ∀ i, Nonempty (C i)) : + IsCompactSystem (squareCylinders C) := by + apply IsCompactSystem.mono (pi _ (fun i ↦ iff_isCompactSystem_of_or_univ.mp (hC₀ i))) + intro S hS + apply squareCylinders_subset_pi _ (fun i ↦ Or.inr rfl) + change S ∈ MeasureTheory.squareCylinders C at hS + rw [mem_squareCylinders C hC₁] at hS + rw [mem_squareCylinders (fun i s ↦ C i s ∨ s = univ) + (fun i ↦ nonempty_subtype.mpr ⟨univ, Or.inr rfl⟩)] + obtain ⟨s, t, h₀, h₁⟩ := hS + use s, t + simp only [exists_prop] + exact ⟨fun i hi ↦ Or.inl (h₀ i hi), h₁⟩ + end pi end IsCompactSystem @@ -344,83 +364,18 @@ variable [∀ i, TopologicalSpace (α i)] variable (α) /-- The set of sets of the form `s.pi t`, where `s : Finset ι` and `t i` is both, closed and compact, for all `i ∈ s`. -/ -def compactClosedSquareCylinders : Set (Set (Π i, α i)) := - ⋃ (s) (t) (_ : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)), {squareCylinder s t} - -def squareCylinders_of_prop (p : (i : ι) → Set (α i) → Prop) : Set (Set (Π i, α i)) := - ⋃ (s) (t) (_ : ∀ i ∈ s, p i (t i)), {squareCylinder s t} - -variable {α} -@[simp] -theorem mem_compactClosedSquareCylinders_iff (S : Set (Π i, α i)) : - S ∈ compactClosedSquareCylinders α - ↔ ∃ (s t : _) (_ : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)), - S = squareCylinder s t := by - simp_rw [compactClosedSquareCylinders, mem_iUnion, mem_singleton_iff] - - -variable {S : Set (Π i, α i)} - -/-- Given a closed compact cylinder, choose a finset of variables such that it only depends on -these variables. -/ -noncomputable def compactClosedSquareCylinders.finset (hS : S ∈ compactClosedSquareCylinders α) : - Finset ι := - ((mem_compactClosedSquareCylinders_iff S).mp hS).choose - -/-- Given a closed compact square cylinder `S`, choose a dependent function `(i : ι) → Set (α i)` -of which it is a lift. -/ -def closedCompactSquareCylinders.func (hS : S ∈ compactClosedSquareCylinders α) : - (i : ι) → Set (α i) := - ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose - -theorem compactClosedSquareCylinders.isCompact_isClosed (hS : S ∈ compactClosedSquareCylinders α) : - ∀ i ∈ compactClosedSquareCylinders.finset hS, - IsCompact (closedCompactSquareCylinders.func hS i) ∧ - IsClosed (closedCompactSquareCylinders.func hS i) := - ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose_spec.choose - -theorem closedCompactSquareCylinders.eq_squareCylinder (hS : S ∈ compactClosedSquareCylinders α) : - S = squareCylinder (compactClosedSquareCylinders.finset hS) - (closedCompactSquareCylinders.func hS) := - ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose_spec.choose_spec - -theorem squareCylinder_mem_closedCompactSquareCylinders (s : Finset ι) (t : (i : ι) → Set (α i)) - (h : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)) : - squareCylinder s t ∈ compactClosedSquareCylinders α := by - rw [mem_compactClosedSquareCylinders_iff] - exact ⟨s, t, h, rfl⟩ - -theorem CompactClosedOrUniv_pi : - IsCompactSystem (univ.pi '' univ.pi - (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by - apply IsCompactSystem.pi - (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ))) - <| fun i ↦ IsCompactSystem.of_isCompact_isClosed_or_univ - -/-- In `closedCompactSquareCylinders α`, the set of dependent variables is a finset, - but not necessarily in `univ.pi '' univ.pi _`, where `_` are closed compact set, or `univ`. -/ -theorem compactClosedSquareCylinders_supset (S : _) : - S ∈ compactClosedSquareCylinders α → S ∈ (univ.pi '' univ.pi - (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by - classical - intro hS - simp_rw [mem_compactClosedSquareCylinders_iff, squareCylinder] at hS - simp only [mem_image, mem_pi, mem_univ, forall_const] - obtain ⟨s, t, h_cl, h_co, h_pi⟩ := hS - let t' := fun (i : ι) ↦ if (i ∈ s) then (t i) else univ - refine ⟨t', fun i ↦ ?_, ?_⟩ - · by_cases hi : i ∈ s - · simp only [hi, ↓reduceIte, t'] - exact Or.inl (h_cl i hi) - · simp only [hi, ↓reduceIte, t'] - apply Or.inr rfl - · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = (s : Set ι).pi t - rw [univ_pi_ite s t] - -/-- Closed and compact square cylinders form a compact system. -/ +def MeasureTheory.compactClosedSquareCylinders : Set (Set (Π i, α i)) := + MeasureTheory.squareCylinders (fun i ↦ { t : Set (α i) | IsCompact t ∧ IsClosed t }) + +/-- Products of compact and closed sets form a a compact system. -/ +theorem IsCompactSystem.compactClosedPi : + IsCompactSystem (univ.pi '' univ.pi (fun i ↦ { t : Set (α i) | IsCompact t ∧ IsClosed t })) := + IsCompactSystem.pi _ (fun _ ↦ IsCompactSystem.of_isCompact_isClosed) + +/-- Compact and closed square cylinders are a compact system. -/ theorem isCompactSystem.compactClosedSquareCylinders : - IsCompactSystem (compactClosedSquareCylinders α) := - IsCompactSystem.mono CompactClosedOrUniv_pi - compactClosedSquareCylinders_supset + IsCompactSystem (MeasureTheory.compactClosedSquareCylinders α) := + IsCompactSystem.squareCylinders _ (fun _ ↦ IsCompactSystem.of_isCompact_isClosed) + (fun _ ↦ IsCompactSystem.nonempty_isCompactIsClosed) end ClosedCompactSquareCylinders From 215f0d158e22b1b5ccb2d8cf174980b9192fd0ad Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:04:47 +0200 Subject: [PATCH 068/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index 34eccf33ee991c..3ca5c7360bfcbb 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -99,6 +99,7 @@ import Mathlib.Algebra.Category.CommAlgCat.Basic import Mathlib.Algebra.Category.CommAlgCat.FiniteType import Mathlib.Algebra.Category.CommAlgCat.Monoidal import Mathlib.Algebra.Category.ContinuousCohomology.Basic +import Mathlib.Algebra.Category.CommAlgCat.Basic import Mathlib.Algebra.Category.FGModuleCat.Basic import Mathlib.Algebra.Category.FGModuleCat.EssentiallySmall import Mathlib.Algebra.Category.FGModuleCat.Limits From d5a702ef55cd39b4378f3aef64cc7d71f39aa5d9 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:04:59 +0200 Subject: [PATCH 069/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index 3ca5c7360bfcbb..135c8f9363717f 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -5704,6 +5704,7 @@ import Mathlib.RingTheory.Spectrum.Prime.Jacobson import Mathlib.RingTheory.Spectrum.Prime.LTSeries import Mathlib.RingTheory.Spectrum.Prime.Module import Mathlib.RingTheory.Spectrum.Prime.Noetherian +import Mathlib.RingTheory.Spectrum.Prime.LTSeries import Mathlib.RingTheory.Spectrum.Prime.Polynomial import Mathlib.RingTheory.Spectrum.Prime.RingHom import Mathlib.RingTheory.Spectrum.Prime.TensorProduct From a24b4bd80ff13f092d790fabe3373f3dab2636ba Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:05:07 +0200 Subject: [PATCH 070/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index 135c8f9363717f..0c4115d81e9dd3 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -5891,6 +5891,7 @@ import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Tactic.CategoryTheory.IsoReassoc import Mathlib.Tactic.CategoryTheory.Monoidal.Basic import Mathlib.Tactic.CategoryTheory.Monoidal.Datatypes +import Mathlib.Tactic.CategoryTheory.IsoReassoc import Mathlib.Tactic.CategoryTheory.Monoidal.Normalize import Mathlib.Tactic.CategoryTheory.Monoidal.PureCoherence import Mathlib.Tactic.CategoryTheory.MonoidalComp From ff537ba332ec6656d7670ab00acda37487dd7861 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:05:19 +0200 Subject: [PATCH 071/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index 0c4115d81e9dd3..915412eeee5581 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6205,6 +6205,7 @@ import Mathlib.Topology.Algebra.IsUniformGroup.Defs import Mathlib.Topology.Algebra.IsUniformGroup.Order import Mathlib.Topology.Algebra.LinearTopology import Mathlib.Topology.Algebra.Localization +import Mathlib.Topology.Algebra.IsUniformGroup.Order import Mathlib.Topology.Algebra.MetricSpace.Lipschitz import Mathlib.Topology.Algebra.Module.Alternating.Basic import Mathlib.Topology.Algebra.Module.Alternating.Topology From 4afcceddff4b498917a53f2ba5a92972b2af19ee Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:05:29 +0200 Subject: [PATCH 072/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Mathlib.lean b/Mathlib.lean index 915412eeee5581..3799eca2b168db 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6376,6 +6376,8 @@ import Mathlib.Topology.Compactification.OnePoint.Sphere import Mathlib.Topology.Compactification.OnePointEquiv import Mathlib.Topology.Compactification.StoneCech import Mathlib.Topology.Compactness.Bases +import Mathlib.Topology.Compactification.OnePoint.Basic +import Mathlib.Topology.Compactification.OnePoint.ProjectiveLine import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.CompactlyCoherentSpace From bb0b6b715269cb93ee73614169edfc6010b65b5e Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:05:40 +0200 Subject: [PATCH 073/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index 3799eca2b168db..bf951ad9391fc9 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6384,6 +6384,7 @@ import Mathlib.Topology.Compactness.CompactlyCoherentSpace import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.CompactlyGeneratedSpace import Mathlib.Topology.Compactness.DeltaGeneratedSpace +import Mathlib.Topology.Compactness.CompactlyCoherentSpace import Mathlib.Topology.Compactness.Exterior import Mathlib.Topology.Compactness.HilbertCubeEmbedding import Mathlib.Topology.Compactness.Lindelof From abac4a1c85f74ee85a0209feb9a97e24437b1e3a Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:08:31 +0200 Subject: [PATCH 074/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index bf951ad9391fc9..5620d7b99e4cbf 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -1817,7 +1817,8 @@ import Mathlib.Analysis.NormedSpace.Multilinear.Curry import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn import Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic -import Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear +import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn +import Mathlib.Analysis.NormedSpace.Multilinear.Basic import Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness import Mathlib.Analysis.NormedSpace.OperatorNorm.Mul import Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm From 400f4755d385858dbe74b2da6a71d95f4bc2ba2b Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:09:05 +0200 Subject: [PATCH 075/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index 5620d7b99e4cbf..34856e6450c0ca 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -2604,7 +2604,8 @@ import Mathlib.CategoryTheory.Shift.InducedShiftSequence import Mathlib.CategoryTheory.Shift.Linear import Mathlib.CategoryTheory.Shift.Localization import Mathlib.CategoryTheory.Shift.Opposite -import Mathlib.CategoryTheory.Shift.Pullback +import Mathlib.CategoryTheory.Shift.Linear +import Mathlib.CategoryTheory.Shift.Induced import Mathlib.CategoryTheory.Shift.Quotient import Mathlib.CategoryTheory.Shift.ShiftSequence import Mathlib.CategoryTheory.Shift.ShiftedHom From 53fdd304a0b758fa6d03544f39e2dba656ccb058 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:09:16 +0200 Subject: [PATCH 076/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index 34856e6450c0ca..058f90fc434fcb 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -3287,7 +3287,8 @@ import Mathlib.Data.Matrix.RowCol import Mathlib.Data.Matrix.Vec import Mathlib.Data.Matroid.Basic import Mathlib.Data.Matroid.Circuit -import Mathlib.Data.Matroid.Closure +import Mathlib.Data.Matrix.Vec +import Mathlib.Data.Matrix.Reflection import Mathlib.Data.Matroid.Constructions import Mathlib.Data.Matroid.Dual import Mathlib.Data.Matroid.IndepAxioms From 8eb7ef55020433aee1a3cf1bcbe5f59e20164ac7 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:09:24 +0200 Subject: [PATCH 077/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index 058f90fc434fcb..995bab1222a5c3 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -4030,7 +4030,8 @@ import Mathlib.LinearAlgebra.Alternating.DomCoprod import Mathlib.LinearAlgebra.Alternating.Uncurry.Fin import Mathlib.LinearAlgebra.AnnihilatingPolynomial import Mathlib.LinearAlgebra.Basis.Basic -import Mathlib.LinearAlgebra.Basis.Bilinear +import Mathlib.LinearAlgebra.Alternating.Uncurry.Fin +import Mathlib.LinearAlgebra.Alternating.Curry import Mathlib.LinearAlgebra.Basis.Cardinality import Mathlib.LinearAlgebra.Basis.Defs import Mathlib.LinearAlgebra.Basis.Exact From 7d9ee80c6836374c5b4f536ae65052c9b3db6394 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:09:31 +0200 Subject: [PATCH 078/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index 995bab1222a5c3..7202cd0c9ba2a0 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -4257,7 +4257,8 @@ import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Relations import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Semisimple import Mathlib.LinearAlgebra.RootSystem.Hom import Mathlib.LinearAlgebra.RootSystem.Irreducible -import Mathlib.LinearAlgebra.RootSystem.IsValuedIn +import Mathlib.LinearAlgebra.RootSystem.GeckConstruction +import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas import Mathlib.LinearAlgebra.RootSystem.OfBilinear import Mathlib.LinearAlgebra.RootSystem.Reduced import Mathlib.LinearAlgebra.RootSystem.RootPairingCat From 9108ae3f6704806293fa5486f939d320c2059967 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:10:51 +0200 Subject: [PATCH 079/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 1 - 1 file changed, 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index 7202cd0c9ba2a0..bbf25c3c034753 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6392,7 +6392,6 @@ import Mathlib.Topology.Compactness.DeltaGeneratedSpace import Mathlib.Topology.Compactness.CompactlyCoherentSpace import Mathlib.Topology.Compactness.Exterior import Mathlib.Topology.Compactness.HilbertCubeEmbedding -import Mathlib.Topology.Compactness.Lindelof import Mathlib.Topology.Compactness.LocallyCompact import Mathlib.Topology.Compactness.LocallyFinite import Mathlib.Topology.Compactness.NhdsKer From 684cf3d1ee1195f904bdf9b27a0943f0d1cde781 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sun, 8 Jun 2025 23:51:57 +0200 Subject: [PATCH 080/129] changed deprecated --- Mathlib/MeasureTheory/Constructions/Cylinders.lean | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Mathlib/MeasureTheory/Constructions/Cylinders.lean b/Mathlib/MeasureTheory/Constructions/Cylinders.lean index 33c35ab2e807e5..1ae07c3e1a9951 100644 --- a/Mathlib/MeasureTheory/Constructions/Cylinders.lean +++ b/Mathlib/MeasureTheory/Constructions/Cylinders.lean @@ -120,7 +120,7 @@ theorem isPiSystem_squareCylinders [∀ i, Inhabited (α i)] {C : ∀ i, Set (Se · simp only [h, Finset.piecewise_eq_of_mem, t₁'] exact h₁ i · simp only [t₁'] - rw [Finset.piecewise_eq_of_not_mem s₁ t₁ (fun i ↦ univ) h] + rw [Finset.piecewise_eq_of_notMem s₁ t₁ (fun i ↦ univ) h] exact hC_univ i let t₂' := s₂.piecewise t₂ (fun i ↦ univ) have ht₂ (i : ι) : t₂' i ∈ C i := by @@ -128,7 +128,7 @@ theorem isPiSystem_squareCylinders [∀ i, Inhabited (α i)] {C : ∀ i, Set (Se · simp only [h, Finset.piecewise_eq_of_mem, t₂'] exact h₂ i · simp only [t₂'] - rw [Finset.piecewise_eq_of_not_mem s₂ t₂ (fun i ↦ univ) h] + rw [Finset.piecewise_eq_of_notMem s₂ t₂ (fun i ↦ univ) h] exact hC_univ i have h₁ : (s₁ : Set ι).pi t₁' = (s₁ : Set ι).pi t₁ := by refine Set.pi_congr rfl ?_ @@ -140,7 +140,7 @@ theorem isPiSystem_squareCylinders [∀ i, Inhabited (α i)] {C : ∀ i, Set (Se (fun i ↦ t₁' i ∩ t₂' i) := by rw [squareCylinder, squareCylinder, squareCylinder, Finset.coe_union, union_pi_inter, h₁, h₂] <;> - exact fun i a ↦ Finset.piecewise_eq_of_not_mem _ _ (fun i ↦ Set.univ) a + exact fun i a ↦ Finset.piecewise_eq_of_notMem _ _ (fun i ↦ Set.univ) a rw [h] at hst_nonempty ⊢ rw [squareCylinder, squareCylinders_eq_iUnion_image' C, mem_iUnion] · use (s₁ ∪ s₂), (fun i ↦ t₁' i ∩ t₂' i) From af06d899d099bf5b8bbcc411b687e6f6c94a704e Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Wed, 20 Aug 2025 23:48:27 +0200 Subject: [PATCH 081/129] rebase --- Mathlib.lean | 24 ++++--------- Mathlib/Data/Set/Prod.lean | 2 +- .../Constructions/Cylinders.lean | 7 ++-- .../Topology/Compactness/CompactSystem.lean | 36 +++++++++---------- 4 files changed, 29 insertions(+), 40 deletions(-) diff --git a/Mathlib.lean b/Mathlib.lean index bbf25c3c034753..5b4751deecfa23 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -99,7 +99,6 @@ import Mathlib.Algebra.Category.CommAlgCat.Basic import Mathlib.Algebra.Category.CommAlgCat.FiniteType import Mathlib.Algebra.Category.CommAlgCat.Monoidal import Mathlib.Algebra.Category.ContinuousCohomology.Basic -import Mathlib.Algebra.Category.CommAlgCat.Basic import Mathlib.Algebra.Category.FGModuleCat.Basic import Mathlib.Algebra.Category.FGModuleCat.EssentiallySmall import Mathlib.Algebra.Category.FGModuleCat.Limits @@ -1817,8 +1816,7 @@ import Mathlib.Analysis.NormedSpace.Multilinear.Curry import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn import Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic -import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn -import Mathlib.Analysis.NormedSpace.Multilinear.Basic +import Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear import Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness import Mathlib.Analysis.NormedSpace.OperatorNorm.Mul import Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm @@ -2604,8 +2602,7 @@ import Mathlib.CategoryTheory.Shift.InducedShiftSequence import Mathlib.CategoryTheory.Shift.Linear import Mathlib.CategoryTheory.Shift.Localization import Mathlib.CategoryTheory.Shift.Opposite -import Mathlib.CategoryTheory.Shift.Linear -import Mathlib.CategoryTheory.Shift.Induced +import Mathlib.CategoryTheory.Shift.Pullback import Mathlib.CategoryTheory.Shift.Quotient import Mathlib.CategoryTheory.Shift.ShiftSequence import Mathlib.CategoryTheory.Shift.ShiftedHom @@ -3287,8 +3284,7 @@ import Mathlib.Data.Matrix.RowCol import Mathlib.Data.Matrix.Vec import Mathlib.Data.Matroid.Basic import Mathlib.Data.Matroid.Circuit -import Mathlib.Data.Matrix.Vec -import Mathlib.Data.Matrix.Reflection +import Mathlib.Data.Matroid.Closure import Mathlib.Data.Matroid.Constructions import Mathlib.Data.Matroid.Dual import Mathlib.Data.Matroid.IndepAxioms @@ -4030,8 +4026,7 @@ import Mathlib.LinearAlgebra.Alternating.DomCoprod import Mathlib.LinearAlgebra.Alternating.Uncurry.Fin import Mathlib.LinearAlgebra.AnnihilatingPolynomial import Mathlib.LinearAlgebra.Basis.Basic -import Mathlib.LinearAlgebra.Alternating.Uncurry.Fin -import Mathlib.LinearAlgebra.Alternating.Curry +import Mathlib.LinearAlgebra.Basis.Bilinear import Mathlib.LinearAlgebra.Basis.Cardinality import Mathlib.LinearAlgebra.Basis.Defs import Mathlib.LinearAlgebra.Basis.Exact @@ -4257,8 +4252,7 @@ import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Relations import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Semisimple import Mathlib.LinearAlgebra.RootSystem.Hom import Mathlib.LinearAlgebra.RootSystem.Irreducible -import Mathlib.LinearAlgebra.RootSystem.GeckConstruction -import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas +import Mathlib.LinearAlgebra.RootSystem.IsValuedIn import Mathlib.LinearAlgebra.RootSystem.OfBilinear import Mathlib.LinearAlgebra.RootSystem.Reduced import Mathlib.LinearAlgebra.RootSystem.RootPairingCat @@ -5709,7 +5703,6 @@ import Mathlib.RingTheory.Spectrum.Prime.Jacobson import Mathlib.RingTheory.Spectrum.Prime.LTSeries import Mathlib.RingTheory.Spectrum.Prime.Module import Mathlib.RingTheory.Spectrum.Prime.Noetherian -import Mathlib.RingTheory.Spectrum.Prime.LTSeries import Mathlib.RingTheory.Spectrum.Prime.Polynomial import Mathlib.RingTheory.Spectrum.Prime.RingHom import Mathlib.RingTheory.Spectrum.Prime.TensorProduct @@ -5896,7 +5889,6 @@ import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Tactic.CategoryTheory.IsoReassoc import Mathlib.Tactic.CategoryTheory.Monoidal.Basic import Mathlib.Tactic.CategoryTheory.Monoidal.Datatypes -import Mathlib.Tactic.CategoryTheory.IsoReassoc import Mathlib.Tactic.CategoryTheory.Monoidal.Normalize import Mathlib.Tactic.CategoryTheory.Monoidal.PureCoherence import Mathlib.Tactic.CategoryTheory.MonoidalComp @@ -6210,7 +6202,6 @@ import Mathlib.Topology.Algebra.IsUniformGroup.Defs import Mathlib.Topology.Algebra.IsUniformGroup.Order import Mathlib.Topology.Algebra.LinearTopology import Mathlib.Topology.Algebra.Localization -import Mathlib.Topology.Algebra.IsUniformGroup.Order import Mathlib.Topology.Algebra.MetricSpace.Lipschitz import Mathlib.Topology.Algebra.Module.Alternating.Basic import Mathlib.Topology.Algebra.Module.Alternating.Topology @@ -6381,17 +6372,14 @@ import Mathlib.Topology.Compactification.OnePoint.Sphere import Mathlib.Topology.Compactification.OnePointEquiv import Mathlib.Topology.Compactification.StoneCech import Mathlib.Topology.Compactness.Bases -import Mathlib.Topology.Compactification.OnePoint.Basic -import Mathlib.Topology.Compactification.OnePoint.ProjectiveLine import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.CompactlyCoherentSpace -import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.CompactlyGeneratedSpace import Mathlib.Topology.Compactness.DeltaGeneratedSpace -import Mathlib.Topology.Compactness.CompactlyCoherentSpace import Mathlib.Topology.Compactness.Exterior import Mathlib.Topology.Compactness.HilbertCubeEmbedding +import Mathlib.Topology.Compactness.Lindelof import Mathlib.Topology.Compactness.LocallyCompact import Mathlib.Topology.Compactness.LocallyFinite import Mathlib.Topology.Compactness.NhdsKer diff --git a/Mathlib/Data/Set/Prod.lean b/Mathlib/Data/Set/Prod.lean index eb332210c1ac07..99b6f3f7c989ed 100644 --- a/Mathlib/Data/Set/Prod.lean +++ b/Mathlib/Data/Set/Prod.lean @@ -684,7 +684,7 @@ theorem pi_eq_empty_iff' : s.pi t = ∅ ↔ ∃ i ∈ s, t i = ∅ := by simp [p theorem disjoint_pi : Disjoint (s.pi t₁) (s.pi t₂) ↔ ∃ i ∈ s, Disjoint (t₁ i) (t₂ i) := by simp only [disjoint_iff_inter_eq_empty, ← pi_inter_distrib, pi_eq_empty_iff'] -theorem pi_nonempty_iff' [∀ i, Decidable (i ∈ s)] : +theorem pi_nonempty_iff' [∀ i, Decidable (i ∈ s)] : (s.pi t).Nonempty ↔ ∀ i ∈ s, (t i).Nonempty := by classical rw [pi_nonempty_iff] diff --git a/Mathlib/MeasureTheory/Constructions/Cylinders.lean b/Mathlib/MeasureTheory/Constructions/Cylinders.lean index 1ae07c3e1a9951..58ee3b4376cc82 100644 --- a/Mathlib/MeasureTheory/Constructions/Cylinders.lean +++ b/Mathlib/MeasureTheory/Constructions/Cylinders.lean @@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber, Yaël Dillies, Kin Yau James Wong -/ import Mathlib.Data.Finset.Lattice.Basic +import Mathlib.MeasureTheory.MeasurableSpace.Constructions import Mathlib.MeasureTheory.SetSemiring import Mathlib.Topology.Constructions import Mathlib.MeasureTheory.SetAlgebra @@ -65,7 +66,7 @@ def squareCylinders (C : ∀ i, Set (Set (α i))) : Set (Set (∀ i, α i)) := theorem squareCylinders_eq_iUnion_image (C : ∀ i, Set (Set (α i))) : squareCylinders C = ⋃ s : Finset ι, (s : Set ι).pi '' univ.pi C := by ext1 f - simp only [squareCylinder, squareCylinders, mem_iUnion, mem_image, mem_univ_pi, exists_prop, + simp only [squareCylinder, squareCylinders, mem_iUnion, mem_image, mem_univ_pi, mem_setOf_eq, eq_comm (a := f)] theorem squareCylinders_eq_iUnion_image' (C : ∀ i, Set (Set (α i))) (hC : ∀ i, Nonempty (C i)) : @@ -102,7 +103,7 @@ theorem squareCylinders_subset_pi (C : ∀ i, Set (Set (α i))) (hC : ∀ i, uni classical use fun i ↦ (if i ∈ s.toSet then (t i) else univ) refine ⟨fun i ↦ ?_, ?_⟩ - · simp only [mem_pi, mem_univ, forall_const] + · simp only [mem_univ, forall_const] by_cases hi : i ∈ s.toSet <;> simp only [hi, ↓reduceIte] · exact h₀ i · exact hC i @@ -170,7 +171,7 @@ theorem comap_eval_le_generateFrom_squareCylinders_singleton · simp only [hji, not_false_iff, dif_neg, MeasurableSet.univ] · simp only [eq_mpr_eq_cast, ← h] ext1 x - simp only [singleton_pi, Function.eval, cast_eq, dite_eq_ite, ite_true, Set.mem_preimage] + simp only [Function.eval, cast_eq, dite_eq_ite, ite_true, Set.mem_preimage] /-- The square cylinders formed from measurable sets generate the product σ-algebra. -/ theorem generateFrom_squareCylinders [∀ i, MeasurableSpace (α i)] : diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index b1194242f23705..9f260ded5ab3c5 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -55,7 +55,7 @@ def finite_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) open Classical in lemma dissipate_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) (hC_empty : ⋂ i, C i = ∅) : - Dissipate C (hp.finite_of_empty hC hC_empty) = ∅ := by + dissipate C (hp.finite_of_empty hC hC_empty) = ∅ := by apply Nat.find_spec (hp C hC hC_empty) theorem iff_nonempty_iInter (p : Set α → Prop) : @@ -110,7 +110,7 @@ lemma iff_isCompactSystem_of_or_empty : IsCompactSystem p ↔ exact h s hj hd lemma of_IsEmpty (h : IsEmpty α) (p : Set α → Prop) : IsCompactSystem p := - fun s _ _ ↦ ⟨0, Set.eq_empty_of_isEmpty (Dissipate s 0)⟩ + fun s _ _ ↦ ⟨0, Set.eq_empty_of_isEmpty (dissipate s 0)⟩ /-- A set system is a compact system iff adding `univ` gives a compact system. -/ lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ @@ -140,17 +140,17 @@ lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ ext x simp only [mem_iInter] refine ⟨fun h i ↦ ?_, fun h i ↦ ?_⟩ - · by_cases h' : p (s i) <;> simp only [h', ↓reduceIte, h, s', n] + · by_cases h' : p (s i) <;> simp only [h', ↓reduceIte, h, n] · specialize h' i specialize h i rcases h' with a | b - · simp only [a, ↓reduceIte, s', n] at h + · simp only [a, ↓reduceIte] at h exact h · simp only [b, Set.mem_univ] apply h₂ ▸ h s' h₁ by_contra! a obtain ⟨j, hj⟩ := a - have h₂ (v : ℕ) (hv : n ≤ v) : Dissipate s v = Dissipate s' v:= by + have h₂ (v : ℕ) (hv : n ≤ v) : dissipate s v = dissipate s' v:= by ext x refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ <;> simp only [dissipate_def, mem_iInter] at h ⊢ <;> intro i hi @@ -164,7 +164,7 @@ lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ simp only [h₅, false_or] at h' exact h' simp only [h₆, Set.mem_univ] - have h₇ : Dissipate s' (max j n) = ∅ := by + have h₇ : dissipate s' (max j n) = ∅ := by rw [← subset_empty_iff] at hj ⊢ exact le_trans (antitone_dissipate (Nat.le_max_left j n)) hj specialize h₂ (max j n) (Nat.le_max_right j n) @@ -193,21 +193,21 @@ theorem iff_directed (hpi : IsPiSystem p) : right rfl rw [← biInter_le_eq_iInter] at h2 - obtain h' := h (Dissipate C) directed_dissipate - have h₀ : (∀ (n : ℕ), p (Dissipate C n) ∨ Dissipate C n = ∅) → ⋂ n, Dissipate C n = ∅ → - ∃ n, Dissipate C n = ∅ := by + obtain h' := h (dissipate C) directed_dissipate + have h₀ : (∀ (n : ℕ), p (dissipate C n) ∨ dissipate C n = ∅) → ⋂ n, dissipate C n = ∅ → + ∃ n, dissipate C n = ∅ := by intro h₀ h₁ - by_cases f : ∀ n, p (Dissipate C n) + by_cases f : ∀ n, p (dissipate C n) · apply h' f h₁ · push_neg at f obtain ⟨n, hn⟩ := f use n specialize h₀ n simp_all only [false_or] - obtain h'' := dissipate_of_piSystem hpi' h1 - have h₁ : ∀ (n : ℕ), p (Dissipate C n) ∨ Dissipate C n = ∅ := by + obtain h'' := IsPiSystem.dissipate_mem hpi' h1 + have h₁ : ∀ (n : ℕ), p (dissipate C n) ∨ dissipate C n = ∅ := by intro n - by_cases g : (Dissipate C n).Nonempty + by_cases g : (dissipate C n).Nonempty · exact h'' n g · right exact Set.not_nonempty_iff_eq_empty.mp g @@ -262,8 +262,8 @@ theorem of_isCompact_isClosed : simp only [Set.mem_univ] apply g <| IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed s' hs' (fun j ↦ h2 j) htco htcl - · simp only [ne_eq, coe_setOf, nonempty_subtype, not_exists, not_not, s'] at h - simp [s', h] + · simp only [ne_eq, coe_setOf, nonempty_subtype, not_exists, not_not] at h + simp [h] theorem nonempty_isCompactIsClosed : Nonempty { t : Set α | IsCompact t ∧ IsClosed t } := by simp only [coe_setOf, nonempty_subtype] @@ -288,7 +288,7 @@ end IsCompactIsClosed section pi -variable {ι : Type*} {α : ι → Type*} +variable {ι : Type*} {α : ι → Type*} /- In a product space, the intersection of square cylinders is empty iff there is a coordinate `i` such that the projections to `i` have empty intersection. -/ @@ -307,7 +307,7 @@ theorem iInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i rw [iInter_pi_empty_iff] simp only [mem_univ, iInter_true] -theorem biInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) (p : β → Prop): +theorem biInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) (p : β → Prop) : ( ⋂ (b : β), ⋂ (_ : p b), (univ.pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β), ⋂ (_ : p b), (t b i) = ∅) := by have h : ⋂ (b : β), ⋂ (_ : p b), (univ.pi (t b)) = @@ -332,7 +332,7 @@ theorem pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i exact hx1 b i have ⟨n, hn⟩ := (hC i) y hy hi use n - simp_rw [Dissipate, ← hx2] at hn ⊢ + simp_rw [dissipate, ← hx2] at hn ⊢ rw [biInter_univ_pi_empty_iff x] use i From d0fb8d0b1003f115860a8dbe6ae15cbb320e9e24 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Thu, 21 Aug 2025 11:19:07 +0200 Subject: [PATCH 082/129] space --- Mathlib/Topology/Compactness/CompactSystem.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 9f260ded5ab3c5..652006cdab7fd8 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -286,6 +286,7 @@ theorem of_isCompact [T2Space α] : end IsCompactIsClosed + section pi variable {ι : Type*} {α : ι → Type*} From 5761fe99c73e6a5c3f53b12476abbd2b7e81e265 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sun, 23 Feb 2025 21:02:38 +0100 Subject: [PATCH 083/129] started compact2 --- .../Constructions/Cylinders.lean | 21 +- .../Topology/Compactness/CompactSystem.lean | 325 +++++++++++++++++- 2 files changed, 329 insertions(+), 17 deletions(-) diff --git a/Mathlib/MeasureTheory/Constructions/Cylinders.lean b/Mathlib/MeasureTheory/Constructions/Cylinders.lean index 58ee3b4376cc82..07644f62534a48 100644 --- a/Mathlib/MeasureTheory/Constructions/Cylinders.lean +++ b/Mathlib/MeasureTheory/Constructions/Cylinders.lean @@ -3,8 +3,6 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber, Yaël Dillies, Kin Yau James Wong -/ -import Mathlib.Data.Finset.Lattice.Basic -import Mathlib.MeasureTheory.MeasurableSpace.Constructions import Mathlib.MeasureTheory.SetSemiring import Mathlib.Topology.Constructions import Mathlib.MeasureTheory.SetAlgebra @@ -396,23 +394,16 @@ theorem diff_mem_measurableCylinders (hs : s ∈ measurableCylinders α) rw [diff_eq_compl_inter] exact inter_mem_measurableCylinders (compl_mem_measurableCylinders ht) hs - -section MeasurableCylinders - -lemma isSetAlgebra_measurableCylinders : IsSetAlgebra (measurableCylinders α) where +/-- The measurable cylinders are a ring. -/ +theorem isSetRing_measurableCylinders : IsSetRing (measurableCylinders α) where empty_mem := empty_mem_measurableCylinders α - compl_mem _ := compl_mem_measurableCylinders - union_mem _ _ := union_mem_measurableCylinders - -lemma isSetRing_measurableCylinders : IsSetRing (measurableCylinders α) := - isSetAlgebra_measurableCylinders.isSetRing + union_mem := fun _ _ ↦ union_mem_measurableCylinders + diff_mem := fun _ _ ↦ diff_mem_measurableCylinders -lemma isSetSemiring_measurableCylinders : MeasureTheory.IsSetSemiring (measurableCylinders α) := +/-- The measurable cylinders are a semiring. -/ +theorem isSetSemiring_measurableCylinders : MeasureTheory.IsSetSemiring (measurableCylinders α) := isSetRing_measurableCylinders.isSetSemiring -end MeasurableCylinders - - theorem iUnion_le_mem_measurableCylinders {s : ℕ → Set (∀ i : ι, α i)} (hs : ∀ n, s n ∈ measurableCylinders α) (n : ℕ) : (⋃ i ≤ n, s i) ∈ measurableCylinders α := diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 652006cdab7fd8..6401c7bb25cc83 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -8,6 +8,10 @@ import Mathlib.Logic.IsEmpty import Mathlib.MeasureTheory.Constructions.Cylinders import Mathlib.Order.OmegaCompletePartialOrder import Mathlib.Topology.Separation.Hausdorff +import Mathlib.MeasureTheory.PiSystem +import Mathlib.MeasureTheory.Constructions.Cylinders +import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic + /-! # Compact systems. @@ -29,7 +33,9 @@ system iff inserting `univ` gives a compact system. compact system. -/ -open Set Nat MeasureTheory +open Set Finset Nat MeasureTheory + +section definition variable {α : Type*} {p : Set α → Prop} {C : ℕ → Set α} @@ -379,4 +385,319 @@ theorem isCompactSystem.compactClosedSquareCylinders : IsCompactSystem.squareCylinders _ (fun _ ↦ IsCompactSystem.of_isCompact_isClosed) (fun _ ↦ IsCompactSystem.nonempty_isCompactIsClosed) -end ClosedCompactSquareCylinders +end ClosedCompact + +section ClosedCompactCylinders + + +variable {ι : Type*} {α : ι → Type*} + +variable [∀ i, TopologicalSpace (α i)] + +variable (α) + +/-- The set of all cylinders based on closed compact sets. Note that such a set is closed, but +not compact in general (for instance, the whole space is always a closed compact cylinder). -/ +def closedCompactCylinders : Set (Set (Π i, α i)) := + ⋃ (s) (S) (_ : IsClosed S) (_ : IsCompact S), {cylinder s S} + +theorem empty_mem_closedCompactCylinders : ∅ ∈ closedCompactCylinders α := by + simp_rw [closedCompactCylinders, mem_iUnion, mem_singleton_iff] + exact ⟨∅, ∅, isClosed_empty, isCompact_empty, (cylinder_empty _).symm⟩ + +variable {α} {t : Set (Π i, α i)} + +@[simp] +theorem mem_closedCompactCylinders (t : Set (Π i, α i)) : + t ∈ closedCompactCylinders α + ↔ ∃ (s S : _) (_ : IsClosed S) (_ : IsCompact S), t = cylinder s S := by + simp_rw [closedCompactCylinders, mem_iUnion, mem_singleton_iff] + +/-- Given a closed compact cylinder, choose a finset of variables such that it only depends on +these variables. -/ +noncomputable def closedCompactCylinders.finset (ht : t ∈ closedCompactCylinders α) : + Finset ι := + ((mem_closedCompactCylinders t).mp ht).choose + +/-- Given a closed compact cylinder, choose a set depending on finitely many variables of which it +is a lift. -/ +def closedCompactCylinders.set (ht : t ∈ closedCompactCylinders α) : + Set (∀ i : closedCompactCylinders.finset ht, α i) := + ((mem_closedCompactCylinders t).mp ht).choose_spec.choose + +theorem closedCompactCylinders.isClosed (ht : t ∈ closedCompactCylinders α) : + IsClosed (closedCompactCylinders.set ht) := + ((mem_closedCompactCylinders t).mp ht).choose_spec.choose_spec.choose + +theorem closedCompactCylinders.isCompact (ht : t ∈ closedCompactCylinders α) : + IsCompact (closedCompactCylinders.set ht) := + ((mem_closedCompactCylinders t).mp ht).choose_spec.choose_spec.choose_spec.choose + +theorem closedCompactCylinders.eq_cylinder (ht : t ∈ closedCompactCylinders α) : + t = cylinder (closedCompactCylinders.finset ht) (closedCompactCylinders.set ht) := + ((mem_closedCompactCylinders t).mp ht).choose_spec.choose_spec.choose_spec.choose_spec + +theorem cylinder_mem_closedCompactCylinders (s : Finset ι) (S : Set (∀ i : s, α i)) + (hS_closed : IsClosed S) (hS_compact : IsCompact S) : + cylinder s S ∈ closedCompactCylinders α := by + rw [mem_closedCompactCylinders] + exact ⟨s, S, hS_closed, hS_compact, rfl⟩ + +theorem mem_cylinder_of_mem_closedCompactCylinders [∀ i, MeasurableSpace (α i)] + [∀ i, SecondCountableTopology (α i)] [∀ i, OpensMeasurableSpace (α i)] + (ht : t ∈ closedCompactCylinders α) : + t ∈ measurableCylinders α := by + rw [mem_measurableCylinders] + refine ⟨closedCompactCylinders.finset ht, closedCompactCylinders.set ht, ?_, ?_⟩ + · exact (closedCompactCylinders.isClosed ht).measurableSet + · exact closedCompactCylinders.eq_cylinder ht + +/-! We prove that the `closedCompactCylinders` are a compact system. -/ + +variable {ι : Type*} {α : ι → Type*} [∀ i, TopologicalSpace (α i)] {s : ℕ → Set (Π i, α i)} + +local notation "Js" => closedCompactCylinders.finset +local notation "As" => closedCompactCylinders.set + +section AllProj + +/-- All indices in `ι` that are constrained by the condition `∀ n, s n ∈ closedCompactCylinders α`. +That is, the union of all indices in the bases of the cylinders. -/ +def allProj (hs : ∀ n, s n ∈ closedCompactCylinders α) : Set ι := ⋃ n, Js (hs n) + +theorem subset_allProj (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : + ↑(Js (hs n)) ⊆ allProj hs := + subset_iUnion (fun i ↦ (Js (hs i) : Set ι)) n + +theorem exists_nat_proj (hs : ∀ n, s n ∈ closedCompactCylinders α) (i : ι) (hi : i ∈ allProj hs) : + ∃ n, i ∈ Js (hs n) := by + simpa only [allProj, mem_iUnion, Finset.mem_coe] using hi + +open Classical in +/-- The smallest `n` such that `i ∈ Js (hs n)`. That is, the first `n` such that `i` belongs to the +finset defining the cylinder for `s n`. -/ +noncomputable def indexProj (hs : ∀ n, s n ∈ closedCompactCylinders α) (i : allProj hs) : ℕ := + Nat.find (exists_nat_proj hs i i.2) + +open Classical in +theorem mem_indexProj (hs : ∀ n, s n ∈ closedCompactCylinders α) (i : allProj hs) : + (i : ι) ∈ Js (hs (indexProj hs i)) := + Nat.find_spec (exists_nat_proj hs i i.2) + +open Classical in +theorem indexProj_le (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) (i : Js (hs n)) : + indexProj hs ⟨i, subset_allProj hs n i.2⟩ ≤ n := + Nat.find_le i.2 + +lemma surjective_proj_allProj [∀ i, Nonempty (α i)] (hs : ∀ n, s n ∈ closedCompactCylinders α) : + Function.Surjective (fun (f : (Π i, α i)) (i : allProj hs) ↦ f (i : ι)) := by + intro y + let x := (inferInstance : Nonempty (Π i, α i)).some + classical + refine ⟨fun i ↦ if hi : i ∈ allProj hs then y ⟨i, hi⟩ else x i, ?_⟩ + ext i + simp only [Subtype.coe_prop, dite_true] + +end AllProj + +section projCylinder + +/-- Given a countable family of closed cylinders, consider one of them as depending only on +the countably many coordinates that appear in all of them. -/ +def projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : + Set (∀ i : allProj hs, α i) := + (fun (f : ∀ i : allProj hs, α i) (i : Js (hs n)) ↦ f ⟨i, subset_allProj hs _ i.2⟩) ⁻¹' (As (hs n)) + +lemma mem_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) + (x : ∀ i : allProj hs, α i) : + x ∈ projCylinder hs n ↔ (fun (i : Js (hs n)) ↦ x ⟨i, subset_allProj hs _ i.2⟩) ∈ As (hs n) := by + simp only [projCylinder, Set.mem_preimage] + +theorem preimage_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : + (fun (f : ∀ i, α i) (i : allProj hs) ↦ f i) ⁻¹' (projCylinder hs n) = s n := by + conv_rhs => rw [closedCompactCylinders.eq_cylinder (hs n)] + rfl + +lemma nonempty_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) + (n : ℕ) (hs_nonempty : (s n).Nonempty) : + (projCylinder hs n).Nonempty := by + rw [← preimage_projCylinder hs n] at hs_nonempty + exact nonempty_of_nonempty_preimage hs_nonempty + +lemma nonempty_projCylinder_iff [∀ i, Nonempty (α i)] + (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : + (projCylinder hs n).Nonempty ↔ (s n).Nonempty := by + refine ⟨fun h ↦ ?_, nonempty_projCylinder hs n⟩ + obtain ⟨x, hx⟩ := h + rw [mem_projCylinder] at hx + rw [closedCompactCylinders.eq_cylinder (hs n), MeasureTheory.cylinder] + refine Set.Nonempty.preimage ?_ ?_ + · exact ⟨_, hx⟩ + · intro y + let x := (inferInstance : Nonempty (∀ i, α i)).some + classical + refine ⟨fun i ↦ if hi : i ∈ Js (hs n) then y ⟨i, hi⟩ else x i, ?_⟩ + ext i + simp only [Finset.restrict_def, Finset.coe_mem, dite_true] + +theorem isClosed_projCylinder + (hs : ∀ n, s n ∈ closedCompactCylinders α) (hs_closed : ∀ n, IsClosed (As (hs n))) (n : ℕ) : + IsClosed (projCylinder hs n) := + (hs_closed n).preimage (by exact continuous_pi (fun i ↦ continuous_apply _)) + +end projCylinder + +section piCylinderSet + +open Classical in +/-- Given countably many closed compact cylinders, the product set which, in each relevant +coordinate, is the projection of the first cylinder for which this coordinate is relevant. -/ +def piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : + Set (∀ i : allProj hs, α i) := + {x : ∀ i : allProj hs, α i | + ∀ i, x i ∈ (fun a : ∀ j : Js (hs (indexProj hs i)), α j ↦ a ⟨i, mem_indexProj hs i⟩) '' + (As (hs (indexProj hs i)))} + +lemma mem_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) + (x : ∀ i : allProj hs, α i) : + x ∈ piCylinderSet hs ↔ + ∀ i, x i ∈ (fun a : ∀ j : Js (hs (indexProj hs i)), α j ↦ a ⟨i, mem_indexProj hs i⟩) '' + (As (hs (indexProj hs i))) := by + simp only [piCylinderSet, mem_image, Subtype.forall, mem_setOf_eq] + +theorem isCompact_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : + IsCompact (piCylinderSet hs) := + isCompact_pi_infinite fun _ ↦ + (closedCompactCylinders.isCompact (hs _)).image (continuous_apply _) + +theorem piCylinderSet_eq_pi_univ (hs : ∀ n, s n ∈ closedCompactCylinders α) : + piCylinderSet hs = + pi univ fun i ↦ + (fun a : ∀ j : Js (hs (indexProj hs i)), α j ↦ a ⟨i, mem_indexProj hs i⟩) '' + (As (hs (indexProj hs i))) := by + ext; simp only [piCylinderSet, mem_univ_pi]; rfl + +theorem isClosed_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : + IsClosed (piCylinderSet hs) := by + rw [piCylinderSet_eq_pi_univ] + exact isClosed_set_pi fun i _ ↦ IsClosed.isClosed_image_restrict_singleton _ + (closedCompactCylinders.isCompact (hs _)) (closedCompactCylinders.isClosed (hs _)) + +theorem nonempty_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) + (hs_nonempty : ∀ i, (s i).Nonempty) : + (piCylinderSet hs).Nonempty := by + have hs_nonempty' i : (As (hs i)).Nonempty := by + specialize hs_nonempty i + rw [closedCompactCylinders.eq_cylinder (hs i)] at hs_nonempty + exact nonempty_of_nonempty_preimage hs_nonempty + let b i := (hs_nonempty' (indexProj hs i)).some + have hb_mem i : b i ∈ As (hs (indexProj hs i)) := (hs_nonempty' (indexProj hs i)).choose_spec + let a : ∀ i : allProj hs, α i := fun i ↦ b i ⟨i, mem_indexProj hs i⟩ + refine ⟨a, ?_⟩ + simp only [piCylinderSet, mem_image, SetCoe.forall, mem_setOf_eq] + exact fun j hj ↦ ⟨b ⟨j, hj⟩, hb_mem _, rfl⟩ + +end piCylinderSet + +theorem iInter_subset_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : + (⋂ n, projCylinder hs n) ⊆ piCylinderSet hs := by + intro x hx + rw [mem_iInter] at hx + rw [mem_piCylinderSet] + intro i + specialize hx (indexProj hs i) + rw [mem_projCylinder] at hx + exact ⟨fun i : Js (hs (indexProj hs i)) ↦ x ⟨i, subset_allProj hs _ i.2⟩, hx, rfl⟩ + +theorem nonempty_iInter_projCylinder_inter_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) + (hs_nonempty : ∀ i, (s i).Nonempty) + (h_nonempty : ∀ n, (⋂ i ≤ n, projCylinder hs i).Nonempty) (n : ℕ) : + ((⋂ i ≤ n, projCylinder hs i) ∩ piCylinderSet hs).Nonempty := by + obtain ⟨x, hx⟩ := nonempty_piCylinderSet hs hs_nonempty + obtain ⟨y, hy⟩ := h_nonempty n + let z := fun i : allProj hs ↦ if indexProj hs i ≤ n then y i else x i + refine ⟨z, mem_inter ?_ ?_⟩ + · simp only [mem_iInter, mem_projCylinder] + intro i hi + have : (fun j : Js (hs i) ↦ + ite (indexProj hs ⟨j, subset_allProj hs i j.2⟩ ≤ n) (y ⟨j, subset_allProj hs i j.2⟩) + (x ⟨j, subset_allProj hs i j.2⟩)) = + fun j : Js (hs i) ↦ y ⟨j, subset_allProj hs i j.2⟩ := by + ext j + rw [if_pos] + refine le_trans (le_of_eq ?_) ((indexProj_le hs i j).trans hi) + congr + rw [this] + have hyi : y ∈ projCylinder hs i := by + suffices ⋂ j ≤ n, projCylinder hs j ⊆ projCylinder hs i by exact this hy + exact biInter_subset_of_mem hi + rwa [mem_projCylinder] at hyi + · rw [mem_piCylinderSet] + intro i + by_cases hi_le : indexProj hs i ≤ n + · let m := indexProj hs i + have hy' : y ∈ projCylinder hs m := by + suffices ⋂ j ≤ n, projCylinder hs j ⊆ projCylinder hs m by exact this hy + exact biInter_subset_of_mem hi_le + rw [mem_projCylinder] at hy' + refine ⟨fun j ↦ y ⟨j, subset_allProj hs _ j.2⟩, hy', ?_⟩ + simp_rw [z, if_pos hi_le] + · rw [mem_piCylinderSet] at hx + specialize hx i + obtain ⟨x', hx'_mem, hx'_eq⟩ := hx + refine ⟨x', hx'_mem, ?_⟩ + simp_rw [z, if_neg hi_le] + exact hx'_eq + +theorem nonempty_iInter_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) + (hs_nonempty : ∀ i, (s i).Nonempty) + (h_nonempty : ∀ n, (⋂ i ≤ n, projCylinder hs i).Nonempty) : + (⋂ i, projCylinder hs i).Nonempty := by + suffices ((⋂ i, projCylinder hs i) ∩ piCylinderSet hs).Nonempty by + rwa [inter_eq_left.mpr (iInter_subset_piCylinderSet hs)] at this + have : (⋂ n, projCylinder hs n) = (⋂ n, ⋂ i ≤ n, projCylinder hs i) := by + ext x + simp only [mem_iInter] + exact ⟨fun h i j _ ↦ h j, fun h i ↦ h i i le_rfl⟩ + rw [this, iInter_inter] + have h_closed : ∀ n, IsClosed (⋂ i ≤ n, projCylinder hs i) := + fun n ↦ isClosed_biInter (fun i _ ↦ isClosed_projCylinder hs + (fun n ↦ (closedCompactCylinders.isClosed (hs n))) i) + refine IsCompact.nonempty_iInter_of_sequence_nonempty_isCompact_isClosed + (fun n ↦ (⋂ i ≤ n, projCylinder hs i) ∩ piCylinderSet hs) ?_ ?_ ?_ ?_ + · refine fun i ↦ inter_subset_inter ?_ subset_rfl + simp_rw [Set.biInter_le_succ] + exact inter_subset_left + · exact fun n ↦ nonempty_iInter_projCylinder_inter_piCylinderSet hs hs_nonempty h_nonempty n + · exact (isCompact_piCylinderSet hs).inter_left (h_closed _) + · exact fun n ↦ IsClosed.inter (h_closed n) (isClosed_piCylinderSet hs) + +lemma exists_finset_iInter_projCylinder_eq_empty [∀ i, Nonempty (α i)] + (hs : ∀ n, s n ∈ closedCompactCylinders α) (h : ⋂ n, projCylinder hs n = ∅) : + ∃ t : Finset ℕ, (⋂ i ∈ t, projCylinder hs i) = ∅ := by + by_contra! h_nonempty + refine absurd h (Set.Nonempty.ne_empty ?_) + refine nonempty_iInter_projCylinder hs (fun i ↦ ?_) (fun n ↦ ?_) + · specialize h_nonempty {i} + simp only [Finset.mem_singleton, iInter_iInter_eq_left, ne_eq] at h_nonempty + rwa [nonempty_projCylinder_iff] at h_nonempty + · specialize h_nonempty (Finset.range (n + 1)) + simp only [Finset.mem_range, ne_eq, Nat.lt_succ_iff] at h_nonempty + exact h_nonempty + +/-- The `closedCompactCylinders` are a compact system. -/ +theorem isCompactSystem_closedCompactCylinders : IsCompactSystem (closedCompactCylinders α) := by + intro s hs h + by_cases hα : ∀ i, Nonempty (α i) + swap; · exact ⟨∅, by simpa [not_nonempty_iff] using hα⟩ + have h' : ⋂ n, projCylinder hs n = ∅ := by + simp_rw [← preimage_projCylinder hs, ← preimage_iInter] at h + have h_surj : Function.Surjective (fun (f : (∀ i, α i)) (i : allProj hs) ↦ f (i : ι)) := + surjective_proj_allProj hs + rwa [← not_nonempty_iff_eq_empty, ← Function.Surjective.nonempty_preimage h_surj, + not_nonempty_iff_eq_empty] + obtain ⟨t, ht⟩ := exists_finset_iInter_projCylinder_eq_empty hs h' + refine ⟨t, ?_⟩ + simp_rw [← preimage_projCylinder hs, ← preimage_iInter₂, ht, preimage_empty] + +end ClosedCompactCylinders From c1357f451a96b024b1dc26e55aeb78a903fdac09 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Tue, 11 Mar 2025 15:17:09 +0100 Subject: [PATCH 084/129] update squareCylinder --- Mathlib/Data/Set/Prod.lean | 12 +- .../Constructions/Cylinders.lean | 54 ++--- .../Topology/Compactness/CompactSystem.lean | 205 +++++++++++++++++- 3 files changed, 225 insertions(+), 46 deletions(-) diff --git a/Mathlib/Data/Set/Prod.lean b/Mathlib/Data/Set/Prod.lean index 99b6f3f7c989ed..35c038b5b35270 100644 --- a/Mathlib/Data/Set/Prod.lean +++ b/Mathlib/Data/Set/Prod.lean @@ -684,7 +684,7 @@ theorem pi_eq_empty_iff' : s.pi t = ∅ ↔ ∃ i ∈ s, t i = ∅ := by simp [p theorem disjoint_pi : Disjoint (s.pi t₁) (s.pi t₂) ↔ ∃ i ∈ s, Disjoint (t₁ i) (t₂ i) := by simp only [disjoint_iff_inter_eq_empty, ← pi_inter_distrib, pi_eq_empty_iff'] -theorem pi_nonempty_iff' [∀ i, Decidable (i ∈ s)] : +theorem pi_nonempty_iff' [∀ i, Decidable (i ∈ s)] : (s.pi t).Nonempty ↔ ∀ i ∈ s, (t i).Nonempty := by classical rw [pi_nonempty_iff] @@ -736,6 +736,10 @@ theorem pi_antitone (h : s₁ ⊆ s₂) : s₂.pi t ⊆ s₁.pi t := by rw [← union_diff_cancel h, union_pi] exact Set.inter_subset_left +theorem pi_antitone (h : s₁ ⊆ s₂) : s₂.pi t ⊆ s₁.pi t := by + rw [← union_diff_cancel h, union_pi] + exact Set.inter_subset_left + theorem union_pi_inter (ht₁ : ∀ i ∉ s₁, t₁ i = univ) (ht₂ : ∀ i ∉ s₂, t₂ i = univ) : (s₁ ∪ s₂).pi (fun i ↦ t₁ i ∩ t₂ i) = s₁.pi t₁ ∩ s₂.pi t₂ := by @@ -882,7 +886,11 @@ theorem subset_pi_eval_image (s : Set ι) (u : Set (∀ i, α i)) : u ⊆ pi s f fun f hf _ _ => ⟨f, hf, rfl⟩ theorem univ_pi_ite (s : Set ι) [DecidablePred (· ∈ s)] (t : ∀ i, Set (α i)) : - (pi univ fun i => if i ∈ s then t i else univ) = s.pi t := by grind + (pi univ fun i => if i ∈ s then t i else univ) = s.pi t := by + ext + simp_rw [mem_univ_pi] + refine forall_congr' fun i => ?_ + split_ifs with h <;> simp [h] lemma pi_image_eq_of_subset {C : (i : ι) → Set (Set (α i))} (hC : ∀ i, Nonempty (C i)) diff --git a/Mathlib/MeasureTheory/Constructions/Cylinders.lean b/Mathlib/MeasureTheory/Constructions/Cylinders.lean index 07644f62534a48..6729d5bebb9ab9 100644 --- a/Mathlib/MeasureTheory/Constructions/Cylinders.lean +++ b/Mathlib/MeasureTheory/Constructions/Cylinders.lean @@ -3,6 +3,7 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber, Yaël Dillies, Kin Yau James Wong -/ +import Mathlib.Data.Finset.Lattice.Basic import Mathlib.MeasureTheory.SetSemiring import Mathlib.Topology.Constructions import Mathlib.MeasureTheory.SetAlgebra @@ -24,6 +25,8 @@ Given a finite set `s` of indices, a cylinder is the product of a set of `∀ i a product set. * `cylinder s S`: cylinder with base set `S : Set (∀ i : s, α i)` where `s` is a `Finset` +* `squareCylinder s S`: square cylinder with base set `S : (∀ i : s, Set (α i))` where + `s` is a `Finset` * `squareCylinder s S`: square cylinder with base set `S : (∀ i : s, Set (α i))` where `s` is a `Finset` * `squareCylinders C` with `C : ∀ i, Set (Set (α i))`: set of all square cylinders such that for @@ -50,6 +53,12 @@ variable {ι : Type _} {α : ι → Type _} section squareCylinders +/-- Given a finite set `s` of indices, a square cylinder is the product of sets `t i : Set (α i)` +for `i ∈ s` and of `univ` on the other indices. -/ +def squareCylinder (s : Finset ι) (t : ∀ i, Set (α i)) : Set (∀ i, α i) := + (s : Set ι).pi t + +/-- The set `S` is a product of sets `t i` such that /-- Given a finite set `s` of indices, a square cylinder is the product of sets `t i : Set (α i)` for `i ∈ s` and of `univ` on the other indices. -/ def squareCylinder (s : Finset ι) (t : ∀ i, Set (α i)) : Set (∀ i, α i) := @@ -60,11 +69,12 @@ for all `i : s`, `t i ∈ C i`. `squareCylinders` is the set of all such squareCylinders. -/ def squareCylinders (C : ∀ i, Set (Set (α i))) : Set (Set (∀ i, α i)) := {S | ∃ s : Finset ι, ∃ t ∈ univ.pi C, S = squareCylinder s t} + {S | ∃ s : Finset ι, ∃ t ∈ univ.pi C, S = squareCylinder s t} theorem squareCylinders_eq_iUnion_image (C : ∀ i, Set (Set (α i))) : squareCylinders C = ⋃ s : Finset ι, (s : Set ι).pi '' univ.pi C := by ext1 f - simp only [squareCylinder, squareCylinders, mem_iUnion, mem_image, mem_univ_pi, + simp only [squareCylinder, squareCylinders, mem_iUnion, mem_image, mem_univ_pi, exists_prop, mem_setOf_eq, eq_comm (a := f)] theorem squareCylinders_eq_iUnion_image' (C : ∀ i, Set (Set (α i))) (hC : ∀ i, Nonempty (C i)) : @@ -76,42 +86,13 @@ theorem squareCylinders_eq_iUnion_image' (C : ∀ i, Set (Set (α i))) (hC : ∀ refine pi_image_eq_of_subset hC (subset_univ s) simp_rw [← mem_image, h] -@[simp] -theorem mem_squareCylinders (C : ∀ i, Set (Set (α i))) (hC : ∀ i, Nonempty (C i)) (S : _) : - S ∈ squareCylinders C ↔ ∃ (s t : _) (_ : ∀ i ∈ s, t i ∈ C i), S = squareCylinder s t := by - simp_rw [squareCylinders_eq_iUnion_image, squareCylinder] - refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ - · simp only [mem_iUnion, mem_image, mem_pi, mem_univ, forall_const] at h - obtain ⟨s, t, h₀, h₁⟩ := h - use s, t - simp only [h₁, h₀, implies_true, exists_const] - · obtain ⟨s, t, h₀, rfl⟩ := h - simp only [mem_iUnion, mem_image, mem_pi, mem_univ, forall_const] - classical - use s, (fun i ↦ if i ∈ s.toSet then t i else (hC i).some) - refine ⟨fun i ↦ ?_ ,?_⟩ - · by_cases h : i ∈ s <;> simp only [Finset.mem_coe, h, ↓reduceIte, Subtype.coe_prop, h₀] - · refine Set.pi_congr rfl (fun i hi ↦ by simp only [hi, ↓reduceIte] at *) - -theorem squareCylinders_subset_pi (C : ∀ i, Set (Set (α i))) (hC : ∀ i, univ ∈ C i) : - squareCylinders C ⊆ univ.pi '' univ.pi C := by - intro S hS - obtain ⟨s, t, h₀, h₁⟩ := hS - simp only [squareCylinder, mem_pi, mem_univ, forall_const] at h₀ h₁ - classical - use fun i ↦ (if i ∈ s.toSet then (t i) else univ) - refine ⟨fun i ↦ ?_, ?_⟩ - · simp only [mem_univ, forall_const] - by_cases hi : i ∈ s.toSet <;> simp only [hi, ↓reduceIte] - · exact h₀ i - · exact hC i - · rw [h₁, univ_pi_ite s t] - theorem isPiSystem_squareCylinders [∀ i, Inhabited (α i)] {C : ∀ i, Set (Set (α i))} (hC : ∀ i, IsPiSystem (C i)) (hC_univ : ∀ i, univ ∈ C i) : IsPiSystem (squareCylinders C) := by classical haveI h_nempty : ∀ i, Nonempty (C i) := fun i ↦ Nonempty.intro ⟨Set.univ, hC_univ i⟩ rintro S₁ ⟨s₁, t₁, h₁, rfl⟩ S₂ ⟨s₂, t₂, h₂, rfl⟩ hst_nonempty + haveI h_nempty : ∀ i, Nonempty (C i) := fun i ↦ Nonempty.intro ⟨Set.univ, hC_univ i⟩ + rintro S₁ ⟨s₁, t₁, h₁, rfl⟩ S₂ ⟨s₂, t₂, h₂, rfl⟩ hst_nonempty let t₁' := s₁.piecewise t₁ (fun i ↦ univ) simp only [Set.mem_pi, Set.mem_univ, forall_const] at h₁ h₂ have ht₁ (i : ι) : t₁' i ∈ C i := by @@ -119,7 +100,7 @@ theorem isPiSystem_squareCylinders [∀ i, Inhabited (α i)] {C : ∀ i, Set (Se · simp only [h, Finset.piecewise_eq_of_mem, t₁'] exact h₁ i · simp only [t₁'] - rw [Finset.piecewise_eq_of_notMem s₁ t₁ (fun i ↦ univ) h] + rw [Finset.piecewise_eq_of_not_mem s₁ t₁ (fun i ↦ univ) h] exact hC_univ i let t₂' := s₂.piecewise t₂ (fun i ↦ univ) have ht₂ (i : ι) : t₂' i ∈ C i := by @@ -127,7 +108,7 @@ theorem isPiSystem_squareCylinders [∀ i, Inhabited (α i)] {C : ∀ i, Set (Se · simp only [h, Finset.piecewise_eq_of_mem, t₂'] exact h₂ i · simp only [t₂'] - rw [Finset.piecewise_eq_of_notMem s₂ t₂ (fun i ↦ univ) h] + rw [Finset.piecewise_eq_of_not_mem s₂ t₂ (fun i ↦ univ) h] exact hC_univ i have h₁ : (s₁ : Set ι).pi t₁' = (s₁ : Set ι).pi t₁ := by refine Set.pi_congr rfl ?_ @@ -139,7 +120,7 @@ theorem isPiSystem_squareCylinders [∀ i, Inhabited (α i)] {C : ∀ i, Set (Se (fun i ↦ t₁' i ∩ t₂' i) := by rw [squareCylinder, squareCylinder, squareCylinder, Finset.coe_union, union_pi_inter, h₁, h₂] <;> - exact fun i a ↦ Finset.piecewise_eq_of_notMem _ _ (fun i ↦ Set.univ) a + exact fun i a ↦ Finset.piecewise_eq_of_not_mem _ _ (fun i ↦ Set.univ) a rw [h] at hst_nonempty ⊢ rw [squareCylinder, squareCylinders_eq_iUnion_image' C, mem_iUnion] · use (s₁ ∪ s₂), (fun i ↦ t₁' i ∩ t₂' i) @@ -169,7 +150,7 @@ theorem comap_eval_le_generateFrom_squareCylinders_singleton · simp only [hji, not_false_iff, dif_neg, MeasurableSet.univ] · simp only [eq_mpr_eq_cast, ← h] ext1 x - simp only [Function.eval, cast_eq, dite_eq_ite, ite_true, Set.mem_preimage] + simp only [singleton_pi, Function.eval, cast_eq, dite_eq_ite, ite_true, Set.mem_preimage] /-- The square cylinders formed from measurable sets generate the product σ-algebra. -/ theorem generateFrom_squareCylinders [∀ i, MeasurableSpace (α i)] : @@ -523,4 +504,5 @@ lemma measurable_restrict_cylinderEvents (Δ : Set ι) : end cylinderEvents + end MeasureTheory diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 6401c7bb25cc83..62d4f872a22e44 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -33,9 +33,7 @@ system iff inserting `univ` gives a compact system. compact system. -/ -open Set Finset Nat MeasureTheory - -section definition +open Set Nat MeasureTheory variable {α : Type*} {p : Set α → Prop} {C : ℕ → Set α} @@ -50,9 +48,11 @@ end definition namespace IsCompactSystem -open Classical in -/-- In a compact system, given a countable family with `⋂ i, C i = ∅`, we choose the smallest `n` -with `⋂ (i ≤ n), C i = ∅`. -/ +theorem isCompactSystem_subset (C D : Set (Set α)) (hC : IsCompactSystem C) (h : D ⊆ C) : + IsCompactSystem D := fun s hD hs ↦ hC s (fun i ↦ h (hD i)) hs + +/-- In a compact system, given a countable family with empty intersection, we choose a finite +subfamily with empty intersection. -/ noncomputable def finite_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) (hC_empty : ⋂ i, C i = ∅) : ℕ := @@ -387,6 +387,194 @@ theorem isCompactSystem.compactClosedSquareCylinders : end ClosedCompact +section ClosedCompactSquareCylinders + +variable {ι : Type*} {α : ι → Type*} + +variable [∀ i, TopologicalSpace (α i)] + +variable (α) +def closedCompactSquareCylinders : Set (Set (Π i, α i)) := + ⋃ (s) (t) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), {squareCylinder s t} + +variable {α} +@[simp] +theorem mem_closedCompactSquareCylinders (S : Set (Π i, α i)) : + S ∈ closedCompactSquareCylinders α + ↔ ∃ (s t : _) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), + S = squareCylinder s t := by + simp_rw [closedCompactSquareCylinders, mem_iUnion, mem_singleton_iff] + +variable {S : Set (Π i, α i)} + +/-- Note that in `closedCompactSquareCylinders α`, the set of dependent variables is a finset, + but not necessarily in `univ.pi '' univ.pi C`. -/ +theorem closedCompactSquareCylinders_supset (C : (i : ι) → Set (Set (α i))) + (hC : ∀ (i : ι), C i = (fun s : Set (α i) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ))) : + closedCompactSquareCylinders α ⊆ univ.pi '' univ.pi C := by + classical + intro S hS + simp_rw [mem_closedCompactSquareCylinders, squareCylinder] at hS + simp only [mem_image, mem_pi, mem_univ, forall_const] + obtain ⟨s, t, h_cl, h_co, h_pi⟩ := hS + let t' := fun (i : ι) ↦ if (i ∈ s) then (t i) else univ + refine ⟨t', ?_, ?_⟩ + · simp_rw [hC] + intro i + by_cases hi : i ∈ s + · simp only [hi, ↓reduceIte, t'] + apply Or.inl + exact ⟨h_co i hi, h_cl i hi⟩ + · simp only [hi, ↓reduceIte, t'] + apply Or.inr rfl + · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = S + rw [h_pi, univ_pi_ite s t] + +/-- Given a closed compact cylinder, choose a finset of variables such that it only depends on +these variables. -/ +noncomputable def closedCompactSquareCylinders.finset (hS : S ∈ closedCompactSquareCylinders α) : + Finset ι := + ((mem_closedCompactSquareCylinders S).mp hS).choose + +/-- Given a closed compact square cylinder `S`, choose a dependent function `(i : ι) → Set (α i)` +of which it is a lift. -/ +def closedCompactSquareCylinders.func (hS : S ∈ closedCompactSquareCylinders α) : + (i : ι) → Set (α i) := + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose + +theorem closedCompactSquareCylinders.isClosed (hS : S ∈ closedCompactSquareCylinders α) : + ∀ i ∈ closedCompactSquareCylinders.finset hS, + IsClosed (closedCompactSquareCylinders.func hS i) := + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose + +theorem closedCompactSquareCylinders.isCompact (hS : S ∈ closedCompactSquareCylinders α) : + ∀ i ∈ closedCompactSquareCylinders.finset hS, + IsCompact (closedCompactSquareCylinders.func hS i) := + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose + +theorem closedCompactSquareCylinders.eq_squareCylinder (hS : S ∈ closedCompactSquareCylinders α) : + S = squareCylinder (closedCompactSquareCylinders.finset hS) + (closedCompactSquareCylinders.func hS) := + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose_spec + +theorem squareCylinder_mem_closedCompactSquareCylinders (s : Finset ι) (t : (i : ι) → Set (α i)) + (hS_closed : ∀ i ∈ s, IsClosed (t i)) (hS_compact : ∀ i ∈ s, IsCompact (t i)) : + squareCylinder s t ∈ closedCompactSquareCylinders α := by + rw [mem_closedCompactSquareCylinders] + exact ⟨s, t, hS_closed, hS_compact, rfl⟩ + +/- +theorem mem_cylinder_of_mem_closedCompactSquareCylinders [∀ i, MeasurableSpace (α i)] + [∀ i, SecondCountableTopology (α i)] [∀ i, OpensMeasurableSpace (α i)] + (hS : S ∈ closedCompactSquareCylinders α) : + S ∈ measurableCylinders α := by + rw [mem_measurableSquareCylinders] + refine ⟨closedCompactCylinders.finset ht, closedCompactCylinders.set ht, ?_, ?_⟩ + · exact (closedCompactCylinders.isClosed ht).measurableSet + · exact closedCompactCylinders.eq_cylinder ht +-/ + +section pi + +example (P Q : Prop) : (P ↔ Q) ↔ (¬ P ↔ ¬ Q) := by exact Iff.symm not_iff_not + + +theorem iInter_pi_empty_iff {β : Type*} (s : β → Set ι) (t : β → (i : ι) → Set (α i)) : + ( ⋂ b, ((s b).pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β) (_: i ∈ s b), (t b i) = ∅):= by + rw [iInter_eq_empty_iff, not_iff_not.symm] + push_neg + refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ + · have ⟨x, hx⟩ := h + simp only [nonempty_iInter] + intro i + refine ⟨x i, fun j ↦ ?_⟩ + rw [mem_iInter] + intro hi + simp_rw [mem_pi] at hx + exact hx j i hi + · simp only [nonempty_iInter, mem_iInter] at h + choose x hx using h + use x + simp_rw [mem_pi] + intro i + intro j hj + exact hx j i hj + +theorem iInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) : + ( ⋂ b, (univ.pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β), (t b i) = ∅):= by + rw [iInter_pi_empty_iff] + simp only [mem_univ, iInter_true] + +theorem biInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) (p : β → Prop): + ( ⋂ (b : β), ⋂ (_ : p b), (univ.pi (t b)) = ∅) ↔ + (∃ i : ι, ⋂ (b : β), ⋂ (_ : p b), (t b i) = ∅) := by + have h : ⋂ (b : β), ⋂ (_ : p b), (univ.pi (t b)) = + ⋂ (b : { (b' : β) | p b' }), (univ.pi (t b.val)) := by + exact biInter_eq_iInter p fun x h ↦ univ.pi (t x) + have h' (i : ι) : ⋂ (b : β), ⋂ (_ : p b), t b i = ⋂ (b : { (b' : β) | p b' }), t b.val i := by + exact biInter_eq_iInter p fun x h ↦ t x i + simp_rw [h, h', iInter_univ_pi_empty_iff] + +theorem isCompactSystem_pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : + IsCompactSystem (univ.pi '' univ.pi C) := by + intro S hS h_empty + change ∀ i, S i ∈ univ.pi '' univ.pi C at hS + simp only [mem_image, mem_pi, mem_univ, forall_const] at hS + choose x hx1 hx2 using hS + simp_rw [← hx2] at h_empty ⊢ + simp_rw [iInter_univ_pi_empty_iff x] at h_empty + obtain ⟨i, hi⟩ := h_empty + let y := (fun b ↦ x b i) + have hy (b : ℕ) : y b ∈ C i := by + simp only [y] + exact hx1 b i + have ⟨n, hn⟩ := (hC i) y hy hi + use n + simp_rw [Dissipate, ← hx2] at hn ⊢ + rw [biInter_univ_pi_empty_iff x] + use i + +theorem isCompactSystem_CompactClosedOrUniv (C : (i : ι) → Set (Set (α i))) + (hC : ∀ (i : ι), C i = (fun s : Set (α i) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ))) : + IsCompactSystem (univ.pi '' univ.pi C) := by + intro S hS h_empty + change ∀ i, S i ∈ univ.pi '' univ.pi C at hS + simp only [mem_image, mem_pi, mem_univ, forall_const] at hS + choose x hx1 hx2 using hS + simp_rw [← hx2] at h_empty ⊢ + simp_rw [iInter_univ_pi_empty_iff x] at h_empty + obtain ⟨i, hi⟩ := h_empty + + sorry + +end pi + +variable [∀ i, Nonempty (α i)] + + + + + + +theorem isCompactSystem_closedCompactSquareCylinders [∀ i, Nonempty (α i)]: + IsCompactSystem (closedCompactSquareCylinders α) := by + + intro S hS h + have h' : ∀ i, S i ∈ closedCompactSquareCylinders α := by exact fun i ↦ hS i + simp_rw [mem_closedCompactSquareCylinders] at h' + choose s t h_cl h_co hS using h' + simp_rw [Dissipate, hS, squareCylinder] at h ⊢ + simp_rw [pi_eq_empty_iff'] at h + + + + + + sorry + + +end ClosedCompactSquareCylinders + section ClosedCompactCylinders @@ -580,8 +768,9 @@ theorem piCylinderSet_eq_pi_univ (hs : ∀ n, s n ∈ closedCompactCylinders α) theorem isClosed_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : IsClosed (piCylinderSet hs) := by rw [piCylinderSet_eq_pi_univ] - exact isClosed_set_pi fun i _ ↦ IsClosed.isClosed_image_restrict_singleton _ - (closedCompactCylinders.isCompact (hs _)) (closedCompactCylinders.isClosed (hs _)) + sorry + --exact isClosed_set_pi fun i _ ↦ IsClosed.isClosed_image_restrict_singleton _ + -- (closedCompactCylinders.isCompact (hs _)) (closedCompactCylinders.isClosed (hs _)) theorem nonempty_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) (hs_nonempty : ∀ i, (s i).Nonempty) : From 6aa263b593b2bf4ab9898d4b0790bec0dc982a75 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Tue, 11 Mar 2025 23:49:50 +0100 Subject: [PATCH 085/129] compactClosedSquareCylinders are a compact system --- .../Topology/Compactness/CompactSystem.lean | 610 +++--------------- 1 file changed, 93 insertions(+), 517 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 62d4f872a22e44..4d24b7487c7949 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -31,6 +31,8 @@ system iff inserting `univ` gives a compact system. is a compact system in a `T2Space`. * `IsCompactSystem.closedCompactSquareCylinders`: Closed and compact square cylinders form a compact system. +* `IsCompactSystem.closedCompactSquareCylinders`: Closed and compact square cylinders form a + compact system. -/ open Set Nat MeasureTheory @@ -48,9 +50,6 @@ end definition namespace IsCompactSystem -theorem isCompactSystem_subset (C D : Set (Set α)) (hC : IsCompactSystem C) (h : D ⊆ C) : - IsCompactSystem D := fun s hD hs ↦ hC s (fun i ↦ h (hD i)) hs - /-- In a compact system, given a countable family with empty intersection, we choose a finite subfamily with empty intersection. -/ noncomputable @@ -228,17 +227,30 @@ theorem iff_directed' (hpi : IsPiSystem p) : · exact h1 C h3 h4 · exact h1 C h3 s -section IsCompactIsClosed +/-- Any subset of a compact system is a compact system. -/ +theorem of_supset {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : + IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs -variable {α : Type*} [TopologicalSpace α] -/-- The set of compact and closed sets is a compact system. -/ -theorem of_isCompact_isClosed : - IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by - let p := fun (s : Set α) ↦ IsCompact s ∧ IsClosed s - have h2 : IsPiSystem p := by - intro s hs t ht _ - refine ⟨IsCompact.inter_left ht.1 hs.2, IsClosed.inter hs.2 ht.2⟩ +section ClosedCompact + +variable (α : Type*) [TopologicalSpace α] + +/-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ +theorem isClosedCompactOrUnivs : + IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by + let p := fun (s : Set α) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ) + have h2 : ∀ (s t : Set α), p s → p t → p (s ∩ t) := by + intro s t hs ht + by_cases hs' : s = univ + · rw [hs', univ_inter] + exact ht + · by_cases ht' : t = univ + · rw [ht', inter_comm, univ_inter] + exact hs + · exact Or.inl <| ⟨IsCompact.inter_right (Or.resolve_right hs hs').1 + (Or.resolve_right ht ht').2, IsClosed.inter (Or.resolve_right hs hs').2 + (Or.resolve_right ht ht').2⟩ rw [IsCompactSystem.iff_directed' h2] intro s hs h1 h2 let s' := fun (i : { j : ℕ | s j ≠ univ}) ↦ s i @@ -268,53 +280,61 @@ theorem of_isCompact_isClosed : simp only [Set.mem_univ] apply g <| IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed s' hs' (fun j ↦ h2 j) htco htcl - · simp only [ne_eq, coe_setOf, nonempty_subtype, not_exists, not_not] at h - simp [h] + · simp only [ne_eq, coe_setOf, nonempty_subtype, not_exists, not_not, s'] at h + simp only [nonempty_iInter, s', h] + simp only [Set.mem_univ, implies_true, exists_const, s'] -theorem nonempty_isCompactIsClosed : Nonempty { t : Set α | IsCompact t ∧ IsClosed t } := by - simp only [coe_setOf, nonempty_subtype] - use ∅ - simp - -/-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ -theorem of_isCompact_isClosed_or_univ : - IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by - rw [← iff_isCompactSystem_of_or_univ] - exact of_isCompact_isClosed +/-- The set of compact and closed sets is a compact system. -/ +theorem isClosedCompacts : + IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := + IsCompactSystem.of_supset (isClosedCompactOrUnivs α) (fun _ hs ↦ Or.inl hs) -/-- In a `T2Space` the set of compact sets is a compact system. -/ -theorem of_isCompact [T2Space α] : +theorem isCompacts (h : ∀ {s : Set α}, IsCompact s → IsClosed s) : IsCompactSystem (fun s : Set α ↦ IsCompact s) := by have h : (fun s : Set α ↦ IsCompact s) = (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by ext s - refine ⟨fun h' ↦ ⟨h', h'.isClosed⟩, fun h ↦ h.1⟩ - exact h ▸ (of_isCompact_isClosed) + refine ⟨fun h' ↦ ⟨h', h h'⟩, fun h' ↦ h'.1⟩ + exact h ▸ (isClosedCompacts α) + +/-- In a `T2Space` The set of compact sets is a compact system. -/ +theorem _of_isCompact_of_T2Space [T2Space α] : + IsCompactSystem (fun s : Set α ↦ IsCompact s) := (isCompacts α) (fun hs ↦ hs.isClosed) -end IsCompactIsClosed +end ClosedCompact +end IsCompactSystem section pi -variable {ι : Type*} {α : ι → Type*} +variable {ι : Type*} {α : ι → Type*} -/- In a product space, the intersection of square cylinders is empty iff there is a coordinate `i` -such that the projections to `i` have empty intersection. -/ theorem iInter_pi_empty_iff {β : Type*} (s : β → Set ι) (t : β → (i : ι) → Set (α i)) : - (⋂ b, ((s b).pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β) (_: i ∈ s b), (t b i) = ∅):= by + ( ⋂ b, ((s b).pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β) (_: i ∈ s b), (t b i) = ∅):= by rw [iInter_eq_empty_iff, not_iff_not.symm] push_neg - simp only [nonempty_iInter, mem_iInter] - refine ⟨fun ⟨x, hx⟩ i ↦ ?_, fun h ↦ ?_⟩ - · refine ⟨x i, fun j hi ↦ hx j i hi⟩ - · choose x hx using h - refine ⟨x, fun i j hj ↦ hx j i hj⟩ + refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ + · have ⟨x, hx⟩ := h + simp only [nonempty_iInter] + intro i + refine ⟨x i, fun j ↦ ?_⟩ + rw [mem_iInter] + intro hi + simp_rw [mem_pi] at hx + exact hx j i hi + · simp only [nonempty_iInter, mem_iInter] at h + choose x hx using h + use x + simp_rw [mem_pi] + intro i + intro j hj + exact hx j i hj theorem iInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) : ( ⋂ b, (univ.pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β), (t b i) = ∅):= by rw [iInter_pi_empty_iff] simp only [mem_univ, iInter_true] -theorem biInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) (p : β → Prop) : +theorem biInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) (p : β → Prop): ( ⋂ (b : β), ⋂ (_ : p b), (univ.pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β), ⋂ (_ : p b), (t b i) = ∅) := by have h : ⋂ (b : β), ⋂ (_ : p b), (univ.pi (t b)) = @@ -324,7 +344,7 @@ theorem biInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α exact biInter_eq_iInter p fun x h ↦ t x i simp_rw [h, h', iInter_univ_pi_empty_iff] -theorem pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : +theorem IsCompactSystem.pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : IsCompactSystem (univ.pi '' univ.pi C) := by intro S hS h_empty change ∀ i, S i ∈ univ.pi '' univ.pi C at hS @@ -339,29 +359,12 @@ theorem pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i exact hx1 b i have ⟨n, hn⟩ := (hC i) y hy hi use n - simp_rw [dissipate, ← hx2] at hn ⊢ + simp_rw [Dissipate, ← hx2] at hn ⊢ rw [biInter_univ_pi_empty_iff x] use i -theorem squareCylinders (C : (i : ι) → Set (Set (α i))) (hC₀ : ∀ i, IsCompactSystem (C i)) - (hC₁ : ∀ i, Nonempty (C i)) : - IsCompactSystem (squareCylinders C) := by - apply IsCompactSystem.mono (pi _ (fun i ↦ iff_isCompactSystem_of_or_univ.mp (hC₀ i))) - intro S hS - apply squareCylinders_subset_pi _ (fun i ↦ Or.inr rfl) - change S ∈ MeasureTheory.squareCylinders C at hS - rw [mem_squareCylinders C hC₁] at hS - rw [mem_squareCylinders (fun i s ↦ C i s ∨ s = univ) - (fun i ↦ nonempty_subtype.mpr ⟨univ, Or.inr rfl⟩)] - obtain ⟨s, t, h₀, h₁⟩ := hS - use s, t - simp only [exists_prop] - exact ⟨fun i hi ↦ Or.inl (h₀ i hi), h₁⟩ - end pi -end IsCompactSystem - section ClosedCompactSquareCylinders variable {ι : Type*} {α : ι → Type*} @@ -371,29 +374,6 @@ variable [∀ i, TopologicalSpace (α i)] variable (α) /-- The set of sets of the form `s.pi t`, where `s : Finset ι` and `t i` is both, closed and compact, for all `i ∈ s`. -/ -def MeasureTheory.compactClosedSquareCylinders : Set (Set (Π i, α i)) := - MeasureTheory.squareCylinders (fun i ↦ { t : Set (α i) | IsCompact t ∧ IsClosed t }) - -/-- Products of compact and closed sets form a a compact system. -/ -theorem IsCompactSystem.compactClosedPi : - IsCompactSystem (univ.pi '' univ.pi (fun i ↦ { t : Set (α i) | IsCompact t ∧ IsClosed t })) := - IsCompactSystem.pi _ (fun _ ↦ IsCompactSystem.of_isCompact_isClosed) - -/-- Compact and closed square cylinders are a compact system. -/ -theorem isCompactSystem.compactClosedSquareCylinders : - IsCompactSystem (MeasureTheory.compactClosedSquareCylinders α) := - IsCompactSystem.squareCylinders _ (fun _ ↦ IsCompactSystem.of_isCompact_isClosed) - (fun _ ↦ IsCompactSystem.nonempty_isCompactIsClosed) - -end ClosedCompact - -section ClosedCompactSquareCylinders - -variable {ι : Type*} {α : ι → Type*} - -variable [∀ i, TopologicalSpace (α i)] - -variable (α) def closedCompactSquareCylinders : Set (Set (Π i, α i)) := ⋃ (s) (t) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), {squareCylinder s t} @@ -407,29 +387,6 @@ theorem mem_closedCompactSquareCylinders (S : Set (Π i, α i)) : variable {S : Set (Π i, α i)} -/-- Note that in `closedCompactSquareCylinders α`, the set of dependent variables is a finset, - but not necessarily in `univ.pi '' univ.pi C`. -/ -theorem closedCompactSquareCylinders_supset (C : (i : ι) → Set (Set (α i))) - (hC : ∀ (i : ι), C i = (fun s : Set (α i) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ))) : - closedCompactSquareCylinders α ⊆ univ.pi '' univ.pi C := by - classical - intro S hS - simp_rw [mem_closedCompactSquareCylinders, squareCylinder] at hS - simp only [mem_image, mem_pi, mem_univ, forall_const] - obtain ⟨s, t, h_cl, h_co, h_pi⟩ := hS - let t' := fun (i : ι) ↦ if (i ∈ s) then (t i) else univ - refine ⟨t', ?_, ?_⟩ - · simp_rw [hC] - intro i - by_cases hi : i ∈ s - · simp only [hi, ↓reduceIte, t'] - apply Or.inl - exact ⟨h_co i hi, h_cl i hi⟩ - · simp only [hi, ↓reduceIte, t'] - apply Or.inr rfl - · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = S - rw [h_pi, univ_pi_ite s t] - /-- Given a closed compact cylinder, choose a finset of variables such that it only depends on these variables. -/ noncomputable def closedCompactSquareCylinders.finset (hS : S ∈ closedCompactSquareCylinders α) : @@ -474,419 +431,38 @@ theorem mem_cylinder_of_mem_closedCompactSquareCylinders [∀ i, MeasurableSpace · exact closedCompactCylinders.eq_cylinder ht -/ -section pi - -example (P Q : Prop) : (P ↔ Q) ↔ (¬ P ↔ ¬ Q) := by exact Iff.symm not_iff_not - - -theorem iInter_pi_empty_iff {β : Type*} (s : β → Set ι) (t : β → (i : ι) → Set (α i)) : - ( ⋂ b, ((s b).pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β) (_: i ∈ s b), (t b i) = ∅):= by - rw [iInter_eq_empty_iff, not_iff_not.symm] - push_neg - refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ - · have ⟨x, hx⟩ := h - simp only [nonempty_iInter] - intro i - refine ⟨x i, fun j ↦ ?_⟩ - rw [mem_iInter] - intro hi - simp_rw [mem_pi] at hx - exact hx j i hi - · simp only [nonempty_iInter, mem_iInter] at h - choose x hx using h - use x - simp_rw [mem_pi] - intro i - intro j hj - exact hx j i hj - -theorem iInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) : - ( ⋂ b, (univ.pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β), (t b i) = ∅):= by - rw [iInter_pi_empty_iff] - simp only [mem_univ, iInter_true] - -theorem biInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) (p : β → Prop): - ( ⋂ (b : β), ⋂ (_ : p b), (univ.pi (t b)) = ∅) ↔ - (∃ i : ι, ⋂ (b : β), ⋂ (_ : p b), (t b i) = ∅) := by - have h : ⋂ (b : β), ⋂ (_ : p b), (univ.pi (t b)) = - ⋂ (b : { (b' : β) | p b' }), (univ.pi (t b.val)) := by - exact biInter_eq_iInter p fun x h ↦ univ.pi (t x) - have h' (i : ι) : ⋂ (b : β), ⋂ (_ : p b), t b i = ⋂ (b : { (b' : β) | p b' }), t b.val i := by - exact biInter_eq_iInter p fun x h ↦ t x i - simp_rw [h, h', iInter_univ_pi_empty_iff] - -theorem isCompactSystem_pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : - IsCompactSystem (univ.pi '' univ.pi C) := by - intro S hS h_empty - change ∀ i, S i ∈ univ.pi '' univ.pi C at hS - simp only [mem_image, mem_pi, mem_univ, forall_const] at hS - choose x hx1 hx2 using hS - simp_rw [← hx2] at h_empty ⊢ - simp_rw [iInter_univ_pi_empty_iff x] at h_empty - obtain ⟨i, hi⟩ := h_empty - let y := (fun b ↦ x b i) - have hy (b : ℕ) : y b ∈ C i := by - simp only [y] - exact hx1 b i - have ⟨n, hn⟩ := (hC i) y hy hi - use n - simp_rw [Dissipate, ← hx2] at hn ⊢ - rw [biInter_univ_pi_empty_iff x] - use i - -theorem isCompactSystem_CompactClosedOrUniv (C : (i : ι) → Set (Set (α i))) - (hC : ∀ (i : ι), C i = (fun s : Set (α i) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ))) : - IsCompactSystem (univ.pi '' univ.pi C) := by - intro S hS h_empty - change ∀ i, S i ∈ univ.pi '' univ.pi C at hS - simp only [mem_image, mem_pi, mem_univ, forall_const] at hS - choose x hx1 hx2 using hS - simp_rw [← hx2] at h_empty ⊢ - simp_rw [iInter_univ_pi_empty_iff x] at h_empty - obtain ⟨i, hi⟩ := h_empty - - sorry - -end pi - -variable [∀ i, Nonempty (α i)] - - - - - - -theorem isCompactSystem_closedCompactSquareCylinders [∀ i, Nonempty (α i)]: - IsCompactSystem (closedCompactSquareCylinders α) := by - - intro S hS h - have h' : ∀ i, S i ∈ closedCompactSquareCylinders α := by exact fun i ↦ hS i - simp_rw [mem_closedCompactSquareCylinders] at h' - choose s t h_cl h_co hS using h' - simp_rw [Dissipate, hS, squareCylinder] at h ⊢ - simp_rw [pi_eq_empty_iff'] at h - - - - - - sorry - - -end ClosedCompactSquareCylinders - -section ClosedCompactCylinders - - -variable {ι : Type*} {α : ι → Type*} - -variable [∀ i, TopologicalSpace (α i)] - -variable (α) - -/-- The set of all cylinders based on closed compact sets. Note that such a set is closed, but -not compact in general (for instance, the whole space is always a closed compact cylinder). -/ -def closedCompactCylinders : Set (Set (Π i, α i)) := - ⋃ (s) (S) (_ : IsClosed S) (_ : IsCompact S), {cylinder s S} - -theorem empty_mem_closedCompactCylinders : ∅ ∈ closedCompactCylinders α := by - simp_rw [closedCompactCylinders, mem_iUnion, mem_singleton_iff] - exact ⟨∅, ∅, isClosed_empty, isCompact_empty, (cylinder_empty _).symm⟩ - -variable {α} {t : Set (Π i, α i)} - -@[simp] -theorem mem_closedCompactCylinders (t : Set (Π i, α i)) : - t ∈ closedCompactCylinders α - ↔ ∃ (s S : _) (_ : IsClosed S) (_ : IsCompact S), t = cylinder s S := by - simp_rw [closedCompactCylinders, mem_iUnion, mem_singleton_iff] - -/-- Given a closed compact cylinder, choose a finset of variables such that it only depends on -these variables. -/ -noncomputable def closedCompactCylinders.finset (ht : t ∈ closedCompactCylinders α) : - Finset ι := - ((mem_closedCompactCylinders t).mp ht).choose - -/-- Given a closed compact cylinder, choose a set depending on finitely many variables of which it -is a lift. -/ -def closedCompactCylinders.set (ht : t ∈ closedCompactCylinders α) : - Set (∀ i : closedCompactCylinders.finset ht, α i) := - ((mem_closedCompactCylinders t).mp ht).choose_spec.choose - -theorem closedCompactCylinders.isClosed (ht : t ∈ closedCompactCylinders α) : - IsClosed (closedCompactCylinders.set ht) := - ((mem_closedCompactCylinders t).mp ht).choose_spec.choose_spec.choose - -theorem closedCompactCylinders.isCompact (ht : t ∈ closedCompactCylinders α) : - IsCompact (closedCompactCylinders.set ht) := - ((mem_closedCompactCylinders t).mp ht).choose_spec.choose_spec.choose_spec.choose - -theorem closedCompactCylinders.eq_cylinder (ht : t ∈ closedCompactCylinders α) : - t = cylinder (closedCompactCylinders.finset ht) (closedCompactCylinders.set ht) := - ((mem_closedCompactCylinders t).mp ht).choose_spec.choose_spec.choose_spec.choose_spec - -theorem cylinder_mem_closedCompactCylinders (s : Finset ι) (S : Set (∀ i : s, α i)) - (hS_closed : IsClosed S) (hS_compact : IsCompact S) : - cylinder s S ∈ closedCompactCylinders α := by - rw [mem_closedCompactCylinders] - exact ⟨s, S, hS_closed, hS_compact, rfl⟩ - -theorem mem_cylinder_of_mem_closedCompactCylinders [∀ i, MeasurableSpace (α i)] - [∀ i, SecondCountableTopology (α i)] [∀ i, OpensMeasurableSpace (α i)] - (ht : t ∈ closedCompactCylinders α) : - t ∈ measurableCylinders α := by - rw [mem_measurableCylinders] - refine ⟨closedCompactCylinders.finset ht, closedCompactCylinders.set ht, ?_, ?_⟩ - · exact (closedCompactCylinders.isClosed ht).measurableSet - · exact closedCompactCylinders.eq_cylinder ht - -/-! We prove that the `closedCompactCylinders` are a compact system. -/ - -variable {ι : Type*} {α : ι → Type*} [∀ i, TopologicalSpace (α i)] {s : ℕ → Set (Π i, α i)} - -local notation "Js" => closedCompactCylinders.finset -local notation "As" => closedCompactCylinders.set - -section AllProj - -/-- All indices in `ι` that are constrained by the condition `∀ n, s n ∈ closedCompactCylinders α`. -That is, the union of all indices in the bases of the cylinders. -/ -def allProj (hs : ∀ n, s n ∈ closedCompactCylinders α) : Set ι := ⋃ n, Js (hs n) - -theorem subset_allProj (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : - ↑(Js (hs n)) ⊆ allProj hs := - subset_iUnion (fun i ↦ (Js (hs i) : Set ι)) n - -theorem exists_nat_proj (hs : ∀ n, s n ∈ closedCompactCylinders α) (i : ι) (hi : i ∈ allProj hs) : - ∃ n, i ∈ Js (hs n) := by - simpa only [allProj, mem_iUnion, Finset.mem_coe] using hi - -open Classical in -/-- The smallest `n` such that `i ∈ Js (hs n)`. That is, the first `n` such that `i` belongs to the -finset defining the cylinder for `s n`. -/ -noncomputable def indexProj (hs : ∀ n, s n ∈ closedCompactCylinders α) (i : allProj hs) : ℕ := - Nat.find (exists_nat_proj hs i i.2) - -open Classical in -theorem mem_indexProj (hs : ∀ n, s n ∈ closedCompactCylinders α) (i : allProj hs) : - (i : ι) ∈ Js (hs (indexProj hs i)) := - Nat.find_spec (exists_nat_proj hs i i.2) - -open Classical in -theorem indexProj_le (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) (i : Js (hs n)) : - indexProj hs ⟨i, subset_allProj hs n i.2⟩ ≤ n := - Nat.find_le i.2 - -lemma surjective_proj_allProj [∀ i, Nonempty (α i)] (hs : ∀ n, s n ∈ closedCompactCylinders α) : - Function.Surjective (fun (f : (Π i, α i)) (i : allProj hs) ↦ f (i : ι)) := by - intro y - let x := (inferInstance : Nonempty (Π i, α i)).some +theorem IsCompactSystem.CompactClosedOrUniv_pi : + IsCompactSystem (univ.pi '' univ.pi + (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by + apply IsCompactSystem.pi + (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ))) + <| fun i ↦ IsCompactSystem.isClosedCompactOrUnivs (α i) + +/-- In `closedCompactSquareCylinders α`, the set of dependent variables is a finset, + but not necessarily in `univ.pi '' univ.pi _`, where `_` are closed compact set, or `univ`. -/ +theorem closedCompactSquareCylinders_supset (S : _) : + S ∈ closedCompactSquareCylinders α → S ∈ (univ.pi '' univ.pi + (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by classical - refine ⟨fun i ↦ if hi : i ∈ allProj hs then y ⟨i, hi⟩ else x i, ?_⟩ - ext i - simp only [Subtype.coe_prop, dite_true] - -end AllProj - -section projCylinder - -/-- Given a countable family of closed cylinders, consider one of them as depending only on -the countably many coordinates that appear in all of them. -/ -def projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : - Set (∀ i : allProj hs, α i) := - (fun (f : ∀ i : allProj hs, α i) (i : Js (hs n)) ↦ f ⟨i, subset_allProj hs _ i.2⟩) ⁻¹' (As (hs n)) - -lemma mem_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) - (x : ∀ i : allProj hs, α i) : - x ∈ projCylinder hs n ↔ (fun (i : Js (hs n)) ↦ x ⟨i, subset_allProj hs _ i.2⟩) ∈ As (hs n) := by - simp only [projCylinder, Set.mem_preimage] - -theorem preimage_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : - (fun (f : ∀ i, α i) (i : allProj hs) ↦ f i) ⁻¹' (projCylinder hs n) = s n := by - conv_rhs => rw [closedCompactCylinders.eq_cylinder (hs n)] - rfl - -lemma nonempty_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) - (n : ℕ) (hs_nonempty : (s n).Nonempty) : - (projCylinder hs n).Nonempty := by - rw [← preimage_projCylinder hs n] at hs_nonempty - exact nonempty_of_nonempty_preimage hs_nonempty - -lemma nonempty_projCylinder_iff [∀ i, Nonempty (α i)] - (hs : ∀ n, s n ∈ closedCompactCylinders α) (n : ℕ) : - (projCylinder hs n).Nonempty ↔ (s n).Nonempty := by - refine ⟨fun h ↦ ?_, nonempty_projCylinder hs n⟩ - obtain ⟨x, hx⟩ := h - rw [mem_projCylinder] at hx - rw [closedCompactCylinders.eq_cylinder (hs n), MeasureTheory.cylinder] - refine Set.Nonempty.preimage ?_ ?_ - · exact ⟨_, hx⟩ - · intro y - let x := (inferInstance : Nonempty (∀ i, α i)).some - classical - refine ⟨fun i ↦ if hi : i ∈ Js (hs n) then y ⟨i, hi⟩ else x i, ?_⟩ - ext i - simp only [Finset.restrict_def, Finset.coe_mem, dite_true] - -theorem isClosed_projCylinder - (hs : ∀ n, s n ∈ closedCompactCylinders α) (hs_closed : ∀ n, IsClosed (As (hs n))) (n : ℕ) : - IsClosed (projCylinder hs n) := - (hs_closed n).preimage (by exact continuous_pi (fun i ↦ continuous_apply _)) - -end projCylinder + intro hS + simp_rw [mem_closedCompactSquareCylinders, squareCylinder] at hS + simp only [mem_image, mem_pi, mem_univ, forall_const] + obtain ⟨s, t, h_cl, h_co, h_pi⟩ := hS + let t' := fun (i : ι) ↦ if (i ∈ s) then (t i) else univ + refine ⟨t', ?_, ?_⟩ + · intro i + by_cases hi : i ∈ s + · simp only [hi, ↓reduceIte, t'] + exact Or.inl ⟨h_co i hi, h_cl i hi⟩ + · simp only [hi, ↓reduceIte, t'] + apply Or.inr rfl + · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = S + rw [h_pi, univ_pi_ite s t] -section piCylinderSet +/-- Closed and compact square cylinders form a compact system. -/ +theorem IsCompactSystem.closedCompactSquareCylinders : + IsCompactSystem (closedCompactSquareCylinders α) := + IsCompactSystem.of_supset IsCompactSystem.CompactClosedOrUniv_pi + closedCompactSquareCylinders_supset -open Classical in -/-- Given countably many closed compact cylinders, the product set which, in each relevant -coordinate, is the projection of the first cylinder for which this coordinate is relevant. -/ -def piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : - Set (∀ i : allProj hs, α i) := - {x : ∀ i : allProj hs, α i | - ∀ i, x i ∈ (fun a : ∀ j : Js (hs (indexProj hs i)), α j ↦ a ⟨i, mem_indexProj hs i⟩) '' - (As (hs (indexProj hs i)))} - -lemma mem_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) - (x : ∀ i : allProj hs, α i) : - x ∈ piCylinderSet hs ↔ - ∀ i, x i ∈ (fun a : ∀ j : Js (hs (indexProj hs i)), α j ↦ a ⟨i, mem_indexProj hs i⟩) '' - (As (hs (indexProj hs i))) := by - simp only [piCylinderSet, mem_image, Subtype.forall, mem_setOf_eq] - -theorem isCompact_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : - IsCompact (piCylinderSet hs) := - isCompact_pi_infinite fun _ ↦ - (closedCompactCylinders.isCompact (hs _)).image (continuous_apply _) - -theorem piCylinderSet_eq_pi_univ (hs : ∀ n, s n ∈ closedCompactCylinders α) : - piCylinderSet hs = - pi univ fun i ↦ - (fun a : ∀ j : Js (hs (indexProj hs i)), α j ↦ a ⟨i, mem_indexProj hs i⟩) '' - (As (hs (indexProj hs i))) := by - ext; simp only [piCylinderSet, mem_univ_pi]; rfl - -theorem isClosed_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : - IsClosed (piCylinderSet hs) := by - rw [piCylinderSet_eq_pi_univ] - sorry - --exact isClosed_set_pi fun i _ ↦ IsClosed.isClosed_image_restrict_singleton _ - -- (closedCompactCylinders.isCompact (hs _)) (closedCompactCylinders.isClosed (hs _)) - -theorem nonempty_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) - (hs_nonempty : ∀ i, (s i).Nonempty) : - (piCylinderSet hs).Nonempty := by - have hs_nonempty' i : (As (hs i)).Nonempty := by - specialize hs_nonempty i - rw [closedCompactCylinders.eq_cylinder (hs i)] at hs_nonempty - exact nonempty_of_nonempty_preimage hs_nonempty - let b i := (hs_nonempty' (indexProj hs i)).some - have hb_mem i : b i ∈ As (hs (indexProj hs i)) := (hs_nonempty' (indexProj hs i)).choose_spec - let a : ∀ i : allProj hs, α i := fun i ↦ b i ⟨i, mem_indexProj hs i⟩ - refine ⟨a, ?_⟩ - simp only [piCylinderSet, mem_image, SetCoe.forall, mem_setOf_eq] - exact fun j hj ↦ ⟨b ⟨j, hj⟩, hb_mem _, rfl⟩ - -end piCylinderSet - -theorem iInter_subset_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) : - (⋂ n, projCylinder hs n) ⊆ piCylinderSet hs := by - intro x hx - rw [mem_iInter] at hx - rw [mem_piCylinderSet] - intro i - specialize hx (indexProj hs i) - rw [mem_projCylinder] at hx - exact ⟨fun i : Js (hs (indexProj hs i)) ↦ x ⟨i, subset_allProj hs _ i.2⟩, hx, rfl⟩ - -theorem nonempty_iInter_projCylinder_inter_piCylinderSet (hs : ∀ n, s n ∈ closedCompactCylinders α) - (hs_nonempty : ∀ i, (s i).Nonempty) - (h_nonempty : ∀ n, (⋂ i ≤ n, projCylinder hs i).Nonempty) (n : ℕ) : - ((⋂ i ≤ n, projCylinder hs i) ∩ piCylinderSet hs).Nonempty := by - obtain ⟨x, hx⟩ := nonempty_piCylinderSet hs hs_nonempty - obtain ⟨y, hy⟩ := h_nonempty n - let z := fun i : allProj hs ↦ if indexProj hs i ≤ n then y i else x i - refine ⟨z, mem_inter ?_ ?_⟩ - · simp only [mem_iInter, mem_projCylinder] - intro i hi - have : (fun j : Js (hs i) ↦ - ite (indexProj hs ⟨j, subset_allProj hs i j.2⟩ ≤ n) (y ⟨j, subset_allProj hs i j.2⟩) - (x ⟨j, subset_allProj hs i j.2⟩)) = - fun j : Js (hs i) ↦ y ⟨j, subset_allProj hs i j.2⟩ := by - ext j - rw [if_pos] - refine le_trans (le_of_eq ?_) ((indexProj_le hs i j).trans hi) - congr - rw [this] - have hyi : y ∈ projCylinder hs i := by - suffices ⋂ j ≤ n, projCylinder hs j ⊆ projCylinder hs i by exact this hy - exact biInter_subset_of_mem hi - rwa [mem_projCylinder] at hyi - · rw [mem_piCylinderSet] - intro i - by_cases hi_le : indexProj hs i ≤ n - · let m := indexProj hs i - have hy' : y ∈ projCylinder hs m := by - suffices ⋂ j ≤ n, projCylinder hs j ⊆ projCylinder hs m by exact this hy - exact biInter_subset_of_mem hi_le - rw [mem_projCylinder] at hy' - refine ⟨fun j ↦ y ⟨j, subset_allProj hs _ j.2⟩, hy', ?_⟩ - simp_rw [z, if_pos hi_le] - · rw [mem_piCylinderSet] at hx - specialize hx i - obtain ⟨x', hx'_mem, hx'_eq⟩ := hx - refine ⟨x', hx'_mem, ?_⟩ - simp_rw [z, if_neg hi_le] - exact hx'_eq - -theorem nonempty_iInter_projCylinder (hs : ∀ n, s n ∈ closedCompactCylinders α) - (hs_nonempty : ∀ i, (s i).Nonempty) - (h_nonempty : ∀ n, (⋂ i ≤ n, projCylinder hs i).Nonempty) : - (⋂ i, projCylinder hs i).Nonempty := by - suffices ((⋂ i, projCylinder hs i) ∩ piCylinderSet hs).Nonempty by - rwa [inter_eq_left.mpr (iInter_subset_piCylinderSet hs)] at this - have : (⋂ n, projCylinder hs n) = (⋂ n, ⋂ i ≤ n, projCylinder hs i) := by - ext x - simp only [mem_iInter] - exact ⟨fun h i j _ ↦ h j, fun h i ↦ h i i le_rfl⟩ - rw [this, iInter_inter] - have h_closed : ∀ n, IsClosed (⋂ i ≤ n, projCylinder hs i) := - fun n ↦ isClosed_biInter (fun i _ ↦ isClosed_projCylinder hs - (fun n ↦ (closedCompactCylinders.isClosed (hs n))) i) - refine IsCompact.nonempty_iInter_of_sequence_nonempty_isCompact_isClosed - (fun n ↦ (⋂ i ≤ n, projCylinder hs i) ∩ piCylinderSet hs) ?_ ?_ ?_ ?_ - · refine fun i ↦ inter_subset_inter ?_ subset_rfl - simp_rw [Set.biInter_le_succ] - exact inter_subset_left - · exact fun n ↦ nonempty_iInter_projCylinder_inter_piCylinderSet hs hs_nonempty h_nonempty n - · exact (isCompact_piCylinderSet hs).inter_left (h_closed _) - · exact fun n ↦ IsClosed.inter (h_closed n) (isClosed_piCylinderSet hs) - -lemma exists_finset_iInter_projCylinder_eq_empty [∀ i, Nonempty (α i)] - (hs : ∀ n, s n ∈ closedCompactCylinders α) (h : ⋂ n, projCylinder hs n = ∅) : - ∃ t : Finset ℕ, (⋂ i ∈ t, projCylinder hs i) = ∅ := by - by_contra! h_nonempty - refine absurd h (Set.Nonempty.ne_empty ?_) - refine nonempty_iInter_projCylinder hs (fun i ↦ ?_) (fun n ↦ ?_) - · specialize h_nonempty {i} - simp only [Finset.mem_singleton, iInter_iInter_eq_left, ne_eq] at h_nonempty - rwa [nonempty_projCylinder_iff] at h_nonempty - · specialize h_nonempty (Finset.range (n + 1)) - simp only [Finset.mem_range, ne_eq, Nat.lt_succ_iff] at h_nonempty - exact h_nonempty - -/-- The `closedCompactCylinders` are a compact system. -/ -theorem isCompactSystem_closedCompactCylinders : IsCompactSystem (closedCompactCylinders α) := by - intro s hs h - by_cases hα : ∀ i, Nonempty (α i) - swap; · exact ⟨∅, by simpa [not_nonempty_iff] using hα⟩ - have h' : ⋂ n, projCylinder hs n = ∅ := by - simp_rw [← preimage_projCylinder hs, ← preimage_iInter] at h - have h_surj : Function.Surjective (fun (f : (∀ i, α i)) (i : allProj hs) ↦ f (i : ι)) := - surjective_proj_allProj hs - rwa [← not_nonempty_iff_eq_empty, ← Function.Surjective.nonempty_preimage h_surj, - not_nonempty_iff_eq_empty] - obtain ⟨t, ht⟩ := exists_finset_iInter_projCylinder_eq_empty hs h' - refine ⟨t, ?_⟩ - simp_rw [← preimage_projCylinder hs, ← preimage_iInter₂, ht, preimage_empty] - -end ClosedCompactCylinders +end ClosedCompactSquareCylinders From b71eb5235af7d412183d3c88a4eb02f120616ece Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sun, 23 Mar 2025 17:48:59 +0100 Subject: [PATCH 086/129] not finished with compactUnion --- .../Topology/Compactness/CompactSystem.lean | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 4d24b7487c7949..38c22363c846a0 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -302,6 +302,108 @@ theorem _of_isCompact_of_T2Space [T2Space α] : end ClosedCompact +section Union + +example (s t : Set α) (hst : s ⊆ t) (ht : Finite t) : Finite s := by + exact Finite.Set.subset t hst + +lemma l1 (p : ℕ → Prop) (hp : ∀ n, p (n+1) → p n) (hi : Infinite (p⁻¹' {True})) (n : ℕ) : p n := by + have hp' (n : ℕ): ¬(p n) → ¬(p (n+1)) := by + exact fun a b ↦ a (hp n b) + by_contra h + have hp'' (m : ℕ) : ¬(p (n + m)) := by + induction m with + | zero => exact (add_zero n) ▸ h + | succ m hm => exact hp' (n+m) hm + rw [← not_finite_iff_infinite] at hi + apply hi + have hf : (p ⁻¹' {True}) ⊆ {k | k ≤ n} := by + intro x hx + simp only [preimage_singleton_true, mem_setOf_eq] at hx + refine mem_setOf.mpr ?_ + by_contra h + simp only [not_le] at h + have h' := hp'' (x - n) + rw [add_sub_of_le h.le] at h' + exact h' hx + apply Finite.Set.subset {k | k ≤ n} hf + +-- theorem fin (p : α → Prop) (s : Set α) (hp : p ⋃₀ s) + +lemma l2 [Fintype α] (p : α → ℕ → Prop) (h : ∀ a, Finite { n | p a n }) : ∃ n, ∀ a, ¬(p a n) := by + by_contra! h₁ + have h' : Finite (⋃ a, {n | p a n}) := by + exact Finite.Set.finite_iUnion (fun (a : α) ↦ {n | p a n}) + obtain ⟨k, hk⟩ := Finite.exists_not_mem h' + obtain ⟨a, ha⟩ := h₁ k + apply hk + simp only [mem_iUnion] + use a + exact ha + + +theorem main (p : Set α → Prop) (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) + (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) + (hc : ∀ (n : ℕ), ⋂ (k ≤ n), (⋃₀ (L k).toSet) ≠ ∅) : + ∃ (K : ℕ → Set α), (∀ n, (K n ∈ L n)) ∧ + (∀ N k, ⋂ (i ≤ N), K i ∩ ⋂ (j ≤ k), ⋃₀ (L (N + j)) ≠ ∅) := by + -- `q K n` is true, if `K ∩ ⋂ (k ≤ n), ⋃₀ (L k) ≠ ∅` + let (q : (L 0) → ℕ → Prop) := fun (K : L 0) (n : ℕ) ↦ (K : Set α) ∩ ⋂ (k ≤ n), (⋃₀ (L k).toSet) ≠ ∅ + have h'' (K : L 0) := Finite.exists_infinite_fiber (fun n ↦ q K n) + have h''' : ∃ (K : L 0), Infinite ((fun n ↦ q K n) ⁻¹' {True}) := by + by_contra! h + simp only [preimage_singleton_true, coe_setOf, not_infinite_iff_finite, Subtype.forall] at h + + + -- apply hc 0 + simp only [nonpos_iff_eq_zero, iInter_iInter_eq_left, sUnion_eq_empty, Finset.mem_coe] + + sorry + + have h : ∃ (K : L 0), ∀ n, q K n:= by + by_contra h' + push_neg at h' + + sorry + + simp_rw [q] at h' + -- Finite.exists_infinite_fiber + sorry + sorry + +open Classical in +example (x : α) (H : Finset (Set α)) : x ∉ ⋃₀ ↑H ↔ ∀ h ∈ H, x ∉ h := by + simp only [mem_sUnion, Finset.mem_coe, not_exists, not_and] + +theorem union (h : IsCompactSystem p) : IsCompactSystem (fun s ↦ ∃ (D : Finset (Set (α))), + (∀ d ∈ D, p d) ∧ s = ⋃₀ (D : Set (Set α))) := by + intro q hq h_empty + simp only at hq + choose f hf1 hf2 using hq + simp_rw [Dissipate, hf2] at h_empty ⊢ + -- simp_rw [sUnion_eq_iUnion, iInter_iUnion_distr] at h_empty + simp_rw [iInter_eq_empty_iff, mem_sUnion, Finset.mem_coe, not_exists, not_and] at h_empty ⊢ + by_contra h + revert h_empty + simp only [imp_false] + push_neg at h ⊢ + + simp only [nonempty_iInter, mem_sUnion, Finset.mem_coe] at h ⊢ + simp_rw [Dissipate, nonempty_iInter] at h + + + + apply exists_mem_of_nonempty + + + + + + + sorry + +end Union + end IsCompactSystem section pi From e4f576721a979716c88fdea0fefeec244c804c4b Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Thu, 27 Mar 2025 07:09:23 +0100 Subject: [PATCH 087/129] small progress --- Mathlib/Topology/Compactness/CompactSystem.lean | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 38c22363c846a0..390a01be1e6d74 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -341,20 +341,27 @@ lemma l2 [Fintype α] (p : α → ℕ → Prop) (h : ∀ a, Finite { n | p a n } use a exact ha - theorem main (p : Set α → Prop) (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) (hc : ∀ (n : ℕ), ⋂ (k ≤ n), (⋃₀ (L k).toSet) ≠ ∅) : - ∃ (K : ℕ → Set α), (∀ n, (K n ∈ L n)) ∧ - (∀ N k, ⋂ (i ≤ N), K i ∩ ⋂ (j ≤ k), ⋃₀ (L (N + j)) ≠ ∅) := by + ∃ (K : (n : ℕ) → (L n)), (∀ N k, ⋂ (j : ℕ) (hj : j ≤ N), (K j) ∩ ⋂ (j ≤ k), ⋃₀ (L (N + j + 1)).toSet ≠ ∅) := by -- `q K n` is true, if `K ∩ ⋂ (k ≤ n), ⋃₀ (L k) ≠ ∅` - let (q : (L 0) → ℕ → Prop) := fun (K : L 0) (n : ℕ) ↦ (K : Set α) ∩ ⋂ (k ≤ n), (⋃₀ (L k).toSet) ≠ ∅ + let (q : (L 0) → ℕ → Prop) := fun (K : (L 0)) n ↦ (K : Set α) ∩ ⋂ (k ≤ n), (⋃₀ (L k).toSet) ≠ ∅ + + let (q' : (n : ℕ) → ((j : ℕ) → (hj : j ≤ n) → (L j)) → ℕ → Prop) := fun n K (N : ℕ) ↦ ⋂ (j : ℕ) (hj : j ≤ n), (K j hj : Set α) ∩ ⋂ (k ≤ N), (⋃₀ (L (n + k)).toSet) ≠ ∅ + + + have hq (K : (L 0)) (n : ℕ) : q K n := by + specialize hc 0 + simp? at hc + sorry have h'' (K : L 0) := Finite.exists_infinite_fiber (fun n ↦ q K n) have h''' : ∃ (K : L 0), Infinite ((fun n ↦ q K n) ⁻¹' {True}) := by by_contra! h simp only [preimage_singleton_true, coe_setOf, not_infinite_iff_finite, Subtype.forall] at h + -- apply hc 0 simp only [nonpos_iff_eq_zero, iInter_iInter_eq_left, sUnion_eq_empty, Finset.mem_coe] From 6f65bff9eb3f51abeff81bc91142fea9c68a7531 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Mon, 7 Apr 2025 10:10:56 +0200 Subject: [PATCH 088/129] improve --- .../Topology/Compactness/CompactSystem.lean | 279 +++++++++++++++++- 1 file changed, 276 insertions(+), 3 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 390a01be1e6d74..9cef20242b6244 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -341,14 +341,287 @@ lemma l2 [Fintype α] (p : α → ℕ → Prop) (h : ∀ a, Finite { n | p a n } use a exact ha +lemma l2a [Fintype α] (q : α → ℕ → Prop) (h₁ : ∀ (n : ℕ), ∃ (K : α), q K n) : + ∃ (K : α), Infinite ((q K)⁻¹' {True}) := by + by_contra! h + simp only [preimage_singleton_true, not_infinite_iff_finite] at h + have h' : Finite (⋃ K, { a | q K a }) := by + apply Finite.Set.finite_iUnion fun i ↦ {a | q i a} + have h₁' : ⋃ K, { a | q K a } = univ:= by + rw [← Set.univ_subset_iff] + intro n hn + simp only [mem_iUnion, mem_setOf_eq] + exact h₁ n + rw [h₁'] at h' + revert h' + simp only [imp_false, not_finite_iff_infinite] + exact infinite_coe_iff.mpr infinite_univ + + +lemma l3 [Fintype α] (q : α → ℕ → Prop) (h₁ : ∀ (n : ℕ), ∃ (K : α), q K n) + (h₂ : ∀ (K : α) (n : ℕ), (q K (n + 1) → q K n)) : ∃ (K : α), ∀ (n : ℕ), q K n := by + have h₃ : ∃ (K : α), Infinite ((q K)⁻¹' {True}) := l2a q h₁ + obtain ⟨K, hK⟩ := h₃ + use K + exact l1 (q K) (h₂ K) hK + +example (K : ℕ → Set α) (s : Set α) : (∀ n, (K n) ∩ s = ∅) ↔ ⋃ n, (K n) ∩ s = ∅ := by + exact Iff.symm iUnion_eq_empty + +example (K : ℕ → Set α) (s : Set α) : ⋃ n, (K n) ∩ s = (⋃ n, (K n)) ∩ s := by + exact Eq.symm (iUnion_inter s K) + +example (s t : Set α) : t ⊆ s → s ∩ t = t := by + exact inter_eq_self_of_subset_right + +example (K : ℕ → Set α) (m : ℕ) : ∀ m, ⋂ n, K n ⊆ K m := by + apply iInter_subset + +example (n : ℕ) : 0 ≤ n := by exact Nat.zero_le n + +example (K : ℕ → Set α) (n : ℕ) : ⋂ (k ≤ n), K k ⊆ K 0 := by + refine biInter_subset_of_mem (Nat.zero_le n) + +example (s : Set (Set α)) : ⋃ (x : s), x = ⋃₀ s := by + exact Eq.symm sUnion_eq_iUnion + +example (n : ℕ) (s : Set α) (K : ℕ → Set α) : + s ∩ ⋂ k, ⋂ (_ : k ≤ n + 1 ), K n ⊆ s ∩ ⋂ k, ⋂ (_ : k ≤ n), K n := by + refine inter_subset_inter_right s ?_ + apply antitone_dissipate (le_succ n) + +example (s : Set α) : s = ∅ ↔ s ⊆ ∅ := by + exact Iff.symm subset_empty_iff + +example : 0 ≤ 0 := by exact Nat.zero_le 0 + +example (s : ℕ → Set α) : ⋂ j, ⋂ (hj : j < 0), s j = univ := by + exact iInter_eq_univ.mpr (fun i ↦ iInter_eq_univ.mpr (fun hi ↦ False.elim + <| not_succ_le_zero i hi)) + +theorem main' (p : Set α → Prop) (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) + (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) + (hc : ∀ (n : ℕ), ⋂ (k ≤ n), (⋃₀ (L k).toSet) ≠ ∅) : + ∃ (K : (j : ℕ) → (L j)), (∀ n N, ⋂ (j ≤ n), (K j) ∩ ⋂ (k ≤ N), + ⋃₀ (L (n + 1 + k)).toSet ≠ ∅) := by + -- `q K n` is true, if `K ∩ ⋂ (k ≤ n), ⋃₀ (L k) ≠ ∅` + let q : (L 0) → ℕ → Prop := fun (K : (L 0)) n ↦ (K : Set α) ∩ ⋂ (k ≤ n), (⋃₀ (L k).toSet) ≠ ∅ + + have hq (n : ℕ) : ∃ (K : (L 0)), q K n := by + by_contra! h + push_neg at h + rw [← iUnion_eq_empty] at h + have f : ⋃ (i : { x // x ∈ L 0 }), ↑i ∩ ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ ↑(L k) = (⋃ (i : { x // x ∈ L 0 }), ↑i) ∩ ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ (L k).toSet := by + rw [iUnion_inter] + rw [f] at h + have g : (⋃ (i : { x // x ∈ L 0 }), ↑i) ∩ ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ (L k).toSet = ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ (L k).toSet := by + apply inter_eq_self_of_subset_right + have f : ⋃ (i : { x // x ∈ (L 0) }), ↑i = ⋃₀ (L 0).toSet := by + rw [sUnion_eq_iUnion] + rfl + rw [f] + refine biInter_subset_of_mem (Nat.zero_le n) + rw [g] at h + apply (hc n) h + have hq' (K : (L 0)) (n : ℕ) : q K (n + 1) → q K n := by + intro c d + apply c + rw [← subset_empty_iff] + apply le_trans _ d.le + refine inter_subset_inter_right (K : Set α) ?_ + apply antitone_dissipate (le_succ n) + obtain ⟨K, hK⟩ := l3 q hq hq' + + + let q' (n : ℕ) (K : ((j : ℕ) → (hj : j ≤ n) → (L j))) (N : ℕ) : Prop := ⋂ (j : ℕ) (hj : j ≤ n), ((K j hj) : Set α) ∩ ⋂ (k ≤ N), (⋃₀ (L (n + 1 + k)).toSet) ≠ ∅ + let a : (j : ℕ) → j < 0 → { x // x ∈ L j } := fun j hj ↦ False.elim <| not_succ_le_zero j hj + have h'q (n : ℕ) (N : ℕ) : ∃ (K : (j : ℕ) → (hj : j ≤ 0) → (L j)), q' 0 K N := by + simp_rw [q'] + have d (j : ℕ) : j ≤ 0 → j = 0 := by exact fun a ↦ eq_zero_of_le_zero a + use fun (j : ℕ) (hj : j ≤ 0) ↦ (eq_zero_of_le_zero hj) ▸ K + have h₃ : ⋂ j, ⋂ (hj : j ≤ 0), ↑((fun j hj ↦ ((eq_zero_of_le_zero hj) ▸ K) j hj) : Set α) = (K : Set α) := by sorry + apply? + + + + + sorry + + + + + -- `q' n K N` is true, if `⋂ (j ≤ n), (K j) ∩ ⋂ (k ≤ N), ⋃₀ (L (n + 1 + k)) ≠ ∅` + let q' : (n : ℕ) → ((j : ℕ) → (L j)) → ℕ → Prop := + fun n K N ↦ ⋂ (j : ℕ) (hj : j ≤ n), (K j : Set α) ∩ ⋂ (k ≤ N), (⋃₀ (L (n + 1 + k)).toSet) ≠ ∅ + + let K : (j : ℕ) → (L j) := match j with + | zero := by sorry + + + + + + + have h_main : ∃ (K : ((j : ℕ) → (L j))), ∀ (n N : ℕ), q' n K N := by sorry + obtain ⟨K, hK⟩ := h_main + use K + + + + + have hq (n : ℕ) : ∃ (K : (L 0)), q K n := by + by_contra! h + push_neg at h + rw [← iUnion_eq_empty] at h + have f : ⋃ (i : { x // x ∈ L 0 }), ↑i ∩ ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ ↑(L k) = (⋃ (i : { x // x ∈ L 0 }), ↑i) ∩ ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ (L k).toSet := by + rw [iUnion_inter] + rw [f] at h + have g : (⋃ (i : { x // x ∈ L 0 }), ↑i) ∩ ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ (L k).toSet = ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ (L k).toSet := by + apply inter_eq_self_of_subset_right + have f : ⋃ (i : { x // x ∈ (L 0) }), ↑i = ⋃₀ (L 0).toSet := by + rw [sUnion_eq_iUnion] + rfl + rw [f] + refine biInter_subset_of_mem (Nat.zero_le n) + rw [g] at h + apply (hc n) h + have hq' (K : (L 0)) (n : ℕ) : q K (n + 1) → q K n := by + intro c d + apply c + rw [← subset_empty_iff] + apply le_trans _ d.le + refine inter_subset_inter_right (K : Set α) ?_ + apply antitone_dissipate (le_succ n) + have hK : ∃ (K : (L 0)), ∀ n, q K n := by + exact l3 q hq hq' + + let q' : (n : ℕ) → ((j : ℕ) → (hj : j ≤ n) → (L j)) → ℕ → Prop := + fun n K N ↦ ⋂ (j : ℕ) (hj : j ≤ n), (K j hj : Set α) ∩ ⋂ (k ≤ N), (⋃₀ (L (n + k + 1)).toSet) ≠ ∅ + have hq'' : q' = fun n K N ↦ ⋂ (j : ℕ) (hj : j ≤ n), (K j hj : Set α) ∩ ⋂ (k ≤ N), + (⋃₀ (L (n + k + 1)).toSet) ≠ ∅ := by + rfl + have hq' (n : ℕ) (K : ((j : ℕ) → (hj : j ≤ n) → (L j))) (N : ℕ) : (q' n K N) ↔ + (⋂ (j : ℕ) (hj : j ≤ n), (K j hj : Set α) ∩ ⋂ (k ≤ N), (⋃₀ (L (n + k + 1)).toSet) ≠ ∅) := by + rfl + + + + sorry + have h'' (K : L 0) := Finite.exists_infinite_fiber (fun n ↦ q K n) + have h''' : ∃ (K : L 0), Infinite ((fun n ↦ q K n) ⁻¹' {True}) := by + by_contra! h + simp only [preimage_singleton_true, coe_setOf, not_infinite_iff_finite, Subtype.forall] at h + + + + + simp_rw [← hq'] + + have h₀ (n : ℕ) : ∃ (K : ((j : ℕ) → (hj : j ≤ n) → (L j))), ∀ N, q' N (fun j hj ↦ K j) k := by sorry + + + + sorry + + + + + + sorry + + rfl + + + + have hq (K : (L 0)) (n : ℕ) : q K n := by + specialize hc 0 + simp? at hc + sorry + have h'' (K : L 0) := Finite.exists_infinite_fiber (fun n ↦ q K n) + have h''' : ∃ (K : L 0), Infinite ((fun n ↦ q K n) ⁻¹' {True}) := by + by_contra! h + simp only [preimage_singleton_true, coe_setOf, not_infinite_iff_finite, Subtype.forall] at h + + + + -- apply hc 0 + simp only [nonpos_iff_eq_zero, iInter_iInter_eq_left, sUnion_eq_empty, Finset.mem_coe] + + sorry + + have h : ∃ (K : L 0), ∀ n, q K n:= by + by_contra h' + push_neg at h' + + sorry + + simp_rw [q] at h' + -- Finite.exists_infinite_fiber + sorry + sorry theorem main (p : Set α → Prop) (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) (hc : ∀ (n : ℕ), ⋂ (k ≤ n), (⋃₀ (L k).toSet) ≠ ∅) : - ∃ (K : (n : ℕ) → (L n)), (∀ N k, ⋂ (j : ℕ) (hj : j ≤ N), (K j) ∩ ⋂ (j ≤ k), ⋃₀ (L (N + j + 1)).toSet ≠ ∅) := by + ∃ (K : (n : ℕ) → (L n)), (∀ N k, ⋂ (j : ℕ) (hj : j ≤ N), (K j) ∩ ⋂ (j ≤ k), + ⋃₀ (L (N + j + 1)).toSet ≠ ∅) := by -- `q K n` is true, if `K ∩ ⋂ (k ≤ n), ⋃₀ (L k) ≠ ∅` - let (q : (L 0) → ℕ → Prop) := fun (K : (L 0)) n ↦ (K : Set α) ∩ ⋂ (k ≤ n), (⋃₀ (L k).toSet) ≠ ∅ + let q : (L 0) → ℕ → Prop := fun (K : (L 0)) n ↦ (K : Set α) ∩ ⋂ (k ≤ n), (⋃₀ (L k).toSet) ≠ ∅ + + have hq (n : ℕ) : ∃ (K : (L 0)), q K n := by + by_contra! h + push_neg at h + rw [← iUnion_eq_empty] at h + have f : ⋃ (i : { x // x ∈ L 0 }), ↑i ∩ ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ ↑(L k) = (⋃ (i : { x // x ∈ L 0 }), ↑i) ∩ ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ (L k).toSet := by + rw [iUnion_inter] + rw [f] at h + have g : (⋃ (i : { x // x ∈ L 0 }), ↑i) ∩ ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ (L k).toSet = ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ (L k).toSet := by + apply inter_eq_self_of_subset_right + have f : ⋃ (i : { x // x ∈ (L 0) }), ↑i = ⋃₀ (L 0).toSet := by + rw [biUnion_eq_iUnion] + simp only [Finset.coe_sort_coe] + sorry + rw [f] + refine biInter_subset_of_mem (Nat.zero_le n) + rw [g] at h + apply (hc n) h + + + sorry + + + sorry + have h'' (K : L 0) := Finite.exists_infinite_fiber (fun n ↦ q K n) + have h''' : ∃ (K : L 0), Infinite ((fun n ↦ q K n) ⁻¹' {True}) := by + by_contra! h + simp only [preimage_singleton_true, coe_setOf, not_infinite_iff_finite, Subtype.forall] at h + + + + + let q' : (n : ℕ) → ((j : ℕ) → (hj : j ≤ n) → (L j)) → ℕ → Prop := + fun n K N ↦ ⋂ (j : ℕ) (hj : j ≤ n), (K j hj : Set α) ∩ ⋂ (k ≤ N), (⋃₀ (L (n + k + 1)).toSet) ≠ ∅ + have hq'' : q' = fun n K N ↦ ⋂ (j : ℕ) (hj : j ≤ n), (K j hj : Set α) ∩ ⋂ (k ≤ N), + (⋃₀ (L (n + k + 1)).toSet) ≠ ∅ := by + rfl + have hq' (n : ℕ) (K : ((j : ℕ) → (hj : j ≤ n) → (L j))) (N : ℕ) : (q' n K N) ↔ + (⋂ (j : ℕ) (hj : j ≤ n), (K j hj : Set α) ∩ ⋂ (k ≤ N), (⋃₀ (L (n + k + 1)).toSet) ≠ ∅) := by + rfl + simp_rw [← hq'] + + have h₀ (n : ℕ) : ∃ (K : ((j : ℕ) → (hj : j ≤ n) → (L j))), ∀ N, q' N (fun j hj ↦ K j) k := by sorry + + + + sorry + + + + + + sorry + + rfl - let (q' : (n : ℕ) → ((j : ℕ) → (hj : j ≤ n) → (L j)) → ℕ → Prop) := fun n K (N : ℕ) ↦ ⋂ (j : ℕ) (hj : j ≤ n), (K j hj : Set α) ∩ ⋂ (k ≤ N), (⋃₀ (L (n + k)).toSet) ≠ ∅ have hq (K : (L 0)) (n : ℕ) : q K n := by From 801128af1e67f16775e478d8cc59efcc8cf2455e Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sun, 20 Apr 2025 20:59:02 +0200 Subject: [PATCH 089/129] transfer --- .../Topology/Compactness/CompactSystem.lean | 124 ++++++++++++++++-- 1 file changed, 111 insertions(+), 13 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 9cef20242b6244..c1a755fbe2cad5 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -395,34 +395,124 @@ example (s : Set α) : s = ∅ ↔ s ⊆ ∅ := by example : 0 ≤ 0 := by exact Nat.zero_le 0 -example (s : ℕ → Set α) : ⋂ j, ⋂ (hj : j < 0), s j = univ := by - exact iInter_eq_univ.mpr (fun i ↦ iInter_eq_univ.mpr (fun hi ↦ False.elim - <| not_succ_le_zero i hi)) +example (s : ℕ → Set α) : ⋂ (j : Fin 0), s j = univ := by + refine iInter_eq_univ.mpr (fun ⟨i, hi⟩ ↦ ?_) + exfalso + exact not_succ_le_zero i hi + + +variable {p : Set α → Prop} (hp : IsCompactSystem p) {L : ℕ → Finset (Set α)} + (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) + (hc : ∀ (n : ℕ), ⋂ (k : Fin (n + 1)), (⋃₀ (L k).toSet) ≠ ∅) + +noncomputable def r {n : ℕ} (K : (k : Fin (n + 1)) → (L k)) := + ∀ N, ⋂ (k : Fin (n + 1)), (K k) ∩ ⋂ (k : Fin N), (⋃₀ (L (n + 1 +k)).toSet) ≠ ∅ + +lemma get_element_0 (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) + (hc : ∀ (N : ℕ), ⋂ (k : Fin (N + 1)), (⋃₀ (L k).toSet) ≠ ∅) : ∃ (K : (k : Fin 1) → (L k)), + r K := by + sorry + +def join {n : ℕ} (K' : (k : Fin (n + 1)) → (L k)) (K : L (n + 1)) : (k : Fin (n + 2)) → (L k) := by + let K'' (k : Fin (n + 2)) (hk : ¬ k.val < n + 1) : L k := by + have h : L k = L (n + 1) := by + congr + apply Nat.eq_of_le_of_lt_succ + simp? at hk + exact hk + exact k.prop + rw [h] + exact K + exact fun k ↦ dite (k.val < n + 1) (fun c ↦ K' ⟨k.val, c⟩) (fun c ↦ K'' k c) + +-- ℳ∀⊢ℍ + +-- ℳ∀⊢ℍ + + +lemma get_element_succ (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) + (hc : ∀ (n : ℕ), ⋂ (k : Fin (n + 1)), (⋃₀ (L k).toSet) ≠ ∅) + (n : ℕ) (K' : (k : Fin (n + 1)) → (L k)) (hK' : r K') : ∃ (K : (L (n + 1))), r (join K' K) := by + sorry + +def su : ℕ → ℕ + | 0 => 1 + | n + 1 => ∑ (k : Fin n), su k +termination_by n => n +decreasing_by + refine Fin.val_lt_of_le k ?_ + exact le_succ n + +noncomputable def main' (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) + (hc : ∀ (n : ℕ), ⋂ (k : Fin (n + 1)), (⋃₀ (L k).toSet) ≠ ∅) : (j : ℕ) → (L j) + | 0 => (get_element_0 hL hc).choose 0 + | n + 1 => by + let K' : (j : Fin (n + 1)) → (L j):= fun j ↦ (main' hL hc j) + have hK' : r K' := by sorry + exact (get_element_succ hL hc n K' hK').choose + + + +noncomputable def main' : (j : ℕ) → (L j) → ∀ (N : ℕ), (main' j) ∩ ⋂ k, ⋂ (_ : k < N), ⋃₀ ↑(L k) ≠ ∅ + | 0 => by + have h : ∃ (K : L 0), ∀ N, (K : Set α) ∩ ⋂ (k < N), (⋃₀ (L k).toSet) ≠ ∅ := by + sorry + exact ⟨h.choose, h.choose_spec⟩ + | succ n => by + have h : ∃ (K : L (n + 1)), ∀ N, ⋂ (j ≤ n), (main' j : Set α) ∩ K ∩ ⋂ (k < N), + (⋃₀ (L (n + 1 + k)).toSet) ≠ ∅ := by + sorry + exact h.choose + + theorem main' (p : Set α → Prop) (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) (hc : ∀ (n : ℕ), ⋂ (k ≤ n), (⋃₀ (L k).toSet) ≠ ∅) : - ∃ (K : (j : ℕ) → (L j)), (∀ n N, ⋂ (j ≤ n), (K j) ∩ ⋂ (k ≤ N), + ∃ (K : (j : ℕ) → (L j)), (∀ n N, ⋂ (j ≤ n), (K j) ∩ ⋂ (k < N), ⋃₀ (L (n + 1 + k)).toSet ≠ ∅) := by - -- `q K n` is true, if `K ∩ ⋂ (k ≤ n), ⋃₀ (L k) ≠ ∅` - let q : (L 0) → ℕ → Prop := fun (K : (L 0)) n ↦ (K : Set α) ∩ ⋂ (k ≤ n), (⋃₀ (L k).toSet) ≠ ∅ + have h : 0 = 0 := by rfl - have hq (n : ℕ) : ∃ (K : (L 0)), q K n := by + + + -- `q K N` is true, if `K ∩ ⋂ (k < N), ⋃₀ (L k) ≠ ∅` + let q : (L 0) → ℕ → Prop := fun (K : (L 0)) n ↦ (K : Set α) ∩ ⋂ (k < n), (⋃₀ (L k).toSet) ≠ ∅ + + have hq (N : ℕ) : ∃ (K : (L 0)), q K N := by by_contra! h push_neg at h rw [← iUnion_eq_empty] at h - have f : ⋃ (i : { x // x ∈ L 0 }), ↑i ∩ ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ ↑(L k) = (⋃ (i : { x // x ∈ L 0 }), ↑i) ∩ ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ (L k).toSet := by + have f : ⋃ (i : { x // x ∈ L 0 }), ↑i ∩ ⋂ k, ⋂ (_ : k < N), ⋃₀ ↑(L k) = (⋃ (i : { x // x ∈ L 0 }), ↑i) ∩ ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet := by rw [iUnion_inter] rw [f] at h - have g : (⋃ (i : { x // x ∈ L 0 }), ↑i) ∩ ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ (L k).toSet = ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ (L k).toSet := by + have g : (⋃ (i : { x // x ∈ L 0 }), ↑i) ∩ ⋂ k, ⋂ (_ : k ≤ N), ⋃₀ (L k).toSet = ⋂ k, ⋂ (_ : k ≤ N), ⋃₀ (L k).toSet := by apply inter_eq_self_of_subset_right have f : ⋃ (i : { x // x ∈ (L 0) }), ↑i = ⋃₀ (L 0).toSet := by rw [sUnion_eq_iUnion] rfl rw [f] - refine biInter_subset_of_mem (Nat.zero_le n) + refine biInter_subset_of_mem (Nat.zero_le N) rw [g] at h - apply (hc n) h + apply (hc N) h + + + + + + -- `r K n` is true, if `∀ N, ⋂ (j ≤ n), (K j) ∩ ⋂ (k < N), ⋃₀ (L (n + 1 + k)) ≠ ∅`. + let r : ((n : ℕ) → (k : ℕ) → (hk : k ≤ n) → (L k)) → ℕ → Prop := fun K n ↦ ∀ N, ⋂ (j ≤ n), (K j) ∩ ⋂ (k < N), ⋃₀ (L (n + 1 + k)).toSet ≠ ∅ + + have hr0 (n : ℕ) : ∃ (K : (n : ℕ) → (L n)), r K 0 := by + sorry + + have hrn (n : ℕ) : ∃ (K : (n : ℕ) → (L n)), ∀ n, r K n → ∃ (K' : (n : ℕ) → (L n)), (∀ k ≤ n, K' k = K k) ∧ r K' (n + 1) := by + sorry + + have hrn' (n : ℕ) (k : ℕ) (hk : k ≤ n) : ∃ (K : (L (n + 1))), ∀ n, r K n → ∃ (K' : (n : ℕ) → (L n)), (∀ k ≤ n, K' k = K k) ∧ r K' (n + 1) := by + sorry + + + have hq' (K : (L 0)) (n : ℕ) : q K (n + 1) → q K n := by intro c d apply c @@ -524,12 +614,20 @@ theorem main' (p : Set α → Prop) (hp : IsCompactSystem p) (L : ℕ → Finset sorry +def ack : Nat → Nat → Nat + | 0, n => n + 1 + | m + 1, 0 => ack m 1 + | m + 1, n + 1 => ack m (ack (m + 1) n) + + +def myMax (a b : Nat) : Nat := + if a < b then myMax b a else a + + - sorry - rfl From 8e341046143b4d154d5c083468b48ee79cef23e2 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Mon, 21 Apr 2025 23:41:00 +0200 Subject: [PATCH 090/129] finished zero case --- .../Topology/Compactness/CompactSystem.lean | 382 +++++++++--------- 1 file changed, 201 insertions(+), 181 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index c1a755fbe2cad5..c813b4f1c79379 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -374,7 +374,7 @@ example (K : ℕ → Set α) (s : Set α) : ⋃ n, (K n) ∩ s = (⋃ n, (K n)) example (s t : Set α) : t ⊆ s → s ∩ t = t := by exact inter_eq_self_of_subset_right -example (K : ℕ → Set α) (m : ℕ) : ∀ m, ⋂ n, K n ⊆ K m := by +example (K : ℕ → Set α) : ∀ m, ⋂ n, K n ⊆ K m := by apply iInter_subset example (n : ℕ) : 0 ≤ n := by exact Nat.zero_le n @@ -405,215 +405,207 @@ variable {p : Set α → Prop} (hp : IsCompactSystem p) {L : ℕ → Finset (Set (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) (hc : ∀ (n : ℕ), ⋂ (k : Fin (n + 1)), (⋃₀ (L k).toSet) ≠ ∅) +-- variable (p : {n : ℕ} → ((k : Fin (n + 1)) → (β k)) → Prop) + noncomputable def r {n : ℕ} (K : (k : Fin (n + 1)) → (L k)) := - ∀ N, ⋂ (k : Fin (n + 1)), (K k) ∩ ⋂ (k : Fin N), (⋃₀ (L (n + 1 +k)).toSet) ≠ ∅ + ∀ N, ⋂ (k : Fin (n + 1)), (K k) ∩ ⋂ (k : Fin N), (⋃₀ (L (n + 1 + k)).toSet) ≠ ∅ -lemma get_element_0 (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) - (hc : ∀ (N : ℕ), ⋂ (k : Fin (N + 1)), (⋃₀ (L k).toSet) ≠ ∅) : ∃ (K : (k : Fin 1) → (L k)), - r K := by - sorry +-- variable (h0 : ∃ x : (k : Fin 1) → (β k), p x) +-- h0 -> (get_element_zero hL hc) -def join {n : ℕ} (K' : (k : Fin (n + 1)) → (L k)) (K : L (n + 1)) : (k : Fin (n + 2)) → (L k) := by +lemma nonempty (k : ℕ) (hc : ∀ (N : ℕ), ⋂ (k : Fin (N + 1)), (⋃₀ (L k).toSet) ≠ ∅) : + (L k).Nonempty := by + by_contra! h + simp only [Finset.not_nonempty_iff_eq_empty] at h + have hg : ⋃₀ (L k).toSet = ∅ := by + rw [h] + simp only [Finset.coe_empty, sUnion_empty] + apply (hc k) + apply iInter_eq_empty_iff.mpr + exact fun x ↦ ⟨k, by simp [h]⟩ + +example (s : Set α) (hs : s ⊆ ∅) : s = ∅ := by + exact subset_eq_empty hs rfl + +example (x : α) (s : Set α) (hx : x ∈ s) (hs : s = ∅) : False := by + revert hs + change s ≠ ∅ + exact ne_of_mem_of_not_mem' hx fun a ↦ a + + +example (s : Set α) : (s ≠ ∅) ↔ ∃ x, x ∈ s := by + rw [← nonempty_iff_ne_empty, nonempty_def] + +lemma get_element_zero (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) + (hc : ∀ (N : ℕ), ⋂ (k : Fin (N + 1)), (⋃₀ (L k).toSet) ≠ ∅) : + ∃ (K : (k : Fin 1) → (L k)), r K := by + have h1 : ∀ k : Fin 1, L k = L 0 := by + intro k + rw [Fin.val_eq_zero] + simp [r] + have g : ∀ (K : (L 0)), (r (fun (k : Fin 1) ↦ (h1 k) ▸ K)) ↔ + (∀ N, (K : Set α) ∩ ⋂ (k : Fin N), (⋃₀ (L (0 + 1 + k)).toSet) ≠ ∅) := by + intro K + simp [r] + refine ⟨fun h N ↦ ?_, fun h N ↦ ?_⟩ <;> + specialize h N <;> change _ ≠ ∅ at h ⊢ <;> + rw [← nonempty_iff_ne_empty, nonempty_def] at h ⊢ <;> + obtain ⟨x, hx⟩ := h <;> use x <;> + simp only [mem_inter_iff, mem_iInter, mem_sUnion, Finset.mem_coe] at hx ⊢ + · exact hx 0 + · refine fun i ↦ ⟨(Fin.fin_one_eq_zero i) ▸ hx.1, hx.2⟩ + have d : ∃ (K : (L 0)), r (fun (k : Fin 1) ↦ (h1 k) ▸ K) := by + simp_rw [g] + by_contra! h + simp only [zero_add, Subtype.forall] at h + choose! b ha using h + classical + obtain ⟨aMax, ⟨ha1, ha2⟩⟩ := Finset.exists_max_image (L 0) b (nonempty 0 hc) + have h' : ∀ a ∈ L 0, a ∩ ⋂ (k : Fin ((b aMax))), ⋃₀ ↑(L (1 + ↑k)) = ∅ := by + intro a' h' + refine subset_eq_empty (inter_subset_inter (fun ⦃a⦄ a ↦ a) + (iInter_mono' (fun j ↦ ?_))) (ha a' h') + use ⟨j.val, le_trans j.prop (ha2 a' h')⟩ + apply hc (b aMax) + rw [Set.iInter_eq_empty_iff] + intro x + by_cases h : x ∈ ⋃₀ (L 0) + · simp only [mem_sUnion, Finset.mem_coe] at h + obtain ⟨t, ⟨ht1, ht2⟩⟩ := h + specialize h' t ht1 + rw [← not_forall, ← mem_iInter] + have d : x ∉ ⋂ (k : Fin (b aMax)), ⋃₀ ↑(L (1 + ↑k)) := by + intro e + obtain v : x ∈ t ∩ ⋂ (k : Fin (b aMax)), ⋃₀ ↑(L (1 + ↑k)) := by + exact (mem_inter ht2 e) + revert h' + change _ ≠ ∅ + exact ne_of_mem_of_not_mem' v fun a ↦ a + intro hd + apply d + simp only [mem_iInter, mem_sUnion, Finset.mem_coe] at hd ⊢ + intro i + obtain ⟨t, ⟨ht₁, ht₂⟩⟩ := hd (i + 1) + refine ⟨t, ⟨?_, ht₂⟩⟩ + rw [add_comm] + have r : (((i : Fin (b aMax)) + 1 : Fin ((b aMax) + 1)) : ℕ) = + ((i : Fin (b aMax)) + 1: ℕ) := by + simp only [Fin.coe_eq_castSucc, Fin.coeSucc_eq_succ, Fin.val_succ] + exact r ▸ ht₁ + · exact ⟨0, h⟩ + obtain ⟨K, hK⟩ := d + use (fun (k : Fin 1) ↦ (h1 k) ▸ K) + exact hK + +lemma element_0_has_r (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) + (hc : ∀ (N : ℕ), ⋂ (k : Fin (N + 1)), (⋃₀ (L k).toSet) ≠ ∅) (K : (k : Fin 1) → (L k)) + (hK : K = (get_element_zero hL hc).choose) : r K := by + exact hK ▸ (get_element_zero hL hc).choose_spec + +def join {n : ℕ} (K' : (k : Fin (n + 1)) → (L k)) (K : L (n + 1)) : + (k : Fin (n + 2)) → (L k) := by let K'' (k : Fin (n + 2)) (hk : ¬ k.val < n + 1) : L k := by + simp only [not_lt] at hk have h : L k = L (n + 1) := by congr - apply Nat.eq_of_le_of_lt_succ - simp? at hk - exact hk - exact k.prop - rw [h] - exact K + exact Nat.eq_of_le_of_lt_succ hk k.prop + exact h ▸ K exact fun k ↦ dite (k.val < n + 1) (fun c ↦ K' ⟨k.val, c⟩) (fun c ↦ K'' k c) --- ℳ∀⊢ℍ - --- ℳ∀⊢ℍ - - -lemma get_element_succ (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) - (hc : ∀ (n : ℕ), ⋂ (k : Fin (n + 1)), (⋃₀ (L k).toSet) ≠ ∅) - (n : ℕ) (K' : (k : Fin (n + 1)) → (L k)) (hK' : r K') : ∃ (K : (L (n + 1))), r (join K' K) := by - sorry -def su : ℕ → ℕ - | 0 => 1 - | n + 1 => ∑ (k : Fin n), su k -termination_by n => n -decreasing_by - refine Fin.val_lt_of_le k ?_ - exact le_succ n - -noncomputable def main' (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) - (hc : ∀ (n : ℕ), ⋂ (k : Fin (n + 1)), (⋃₀ (L k).toSet) ≠ ∅) : (j : ℕ) → (L j) - | 0 => (get_element_0 hL hc).choose 0 - | n + 1 => by - let K' : (j : Fin (n + 1)) → (L j):= fun j ↦ (main' hL hc j) - have hK' : r K' := by sorry - exact (get_element_succ hL hc n K' hK').choose +-- (h : ∀ {n : ℕ} (x : (k : Fin (n + 1)) → (β k)), p x → ∃ y : (β (n + 1)), p (joi x y)) +-- h → (get_element_succ hL hd hc) +example (s : ℕ → (Set α)) (b : Set α) : ⋂ k, (s k) ∩ b = (⋂ k, (s k)) ∩ b := by + exact Eq.symm (iInter_inter b s) -noncomputable def main' : (j : ℕ) → (L j) → ∀ (N : ℕ), (main' j) ∩ ⋂ k, ⋂ (_ : k < N), ⋃₀ ↑(L k) ≠ ∅ - | 0 => by - have h : ∃ (K : L 0), ∀ N, (K : Set α) ∩ ⋂ (k < N), (⋃₀ (L k).toSet) ≠ ∅ := by +lemma get_element_succ (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) + (hc : ∀ (n : ℕ), ⋂ (k : Fin (n + 1)), (⋃₀ (L k).toSet) ≠ ∅) : ∀ + (n : ℕ) (K' : (k : Fin (n + 1)) → (L k)), r K' → + ∃ (K : (L (n + 1))), r (join K' K) := by + intro n K' hK' + have d : ∃ (K : (L (n + 1))), r (join K' K) := by + simp [r] + by_contra! h + choose! b ha using h + classical + obtain ⟨aMax, ⟨ha1, ha2⟩⟩ := Finset.exists_max_image (L (n + 1)) b (nonempty (n + 1) hc) + have h' : ∀ (a : Set α) (b_1 : a ∈ L (n + 1)), ⋂ k, ↑(join K' ⟨a, b_1⟩ k) ∩ + ⋂ (k : Fin (b aMax)), ⋃₀ (L (n + 1 + 1 + ↑k) : Set (Set α)) = ∅ := by + intro a' h' + refine subset_eq_empty ?_ (ha a' h') + rw [← iInter_inter, ← iInter_inter] + apply (inter_subset_inter (fun ⦃a⦄ a ↦ a) (iInter_mono' (fun j ↦ ?_))) + use ⟨j.val, le_trans j.prop (ha2 a' h')⟩ + apply hc (b aMax) + rw [Set.iInter_eq_empty_iff] + intro x + by_cases h : x ∈ ⋃₀ (L (n + 1)) + · simp only [mem_sUnion, Finset.mem_coe] at h + obtain ⟨t, ⟨ht1, ht2⟩⟩ := h + specialize h' t ht1 + rw [← not_forall, ← mem_iInter] + have d : x ∉ ⋂ (k : Fin (b aMax)), ⋃₀ ↑(L (1 + ↑k)) := by + intro e + obtain v := (mem_inter ht2 e) + revert h' + change _ ≠ ∅ sorry - exact ⟨h.choose, h.choose_spec⟩ - | succ n => by - have h : ∃ (K : L (n + 1)), ∀ N, ⋂ (j ≤ n), (main' j : Set α) ∩ K ∩ ⋂ (k < N), - (⋃₀ (L (n + 1 + k)).toSet) ≠ ∅ := by + -- exact ne_of_mem_of_not_mem' v fun a ↦ a + intro hd + apply d + simp only [mem_iInter, mem_sUnion, Finset.mem_coe] at hd ⊢ + intro i + obtain ⟨t, ⟨ht₁, ht₂⟩⟩ := hd (i + 1) + refine ⟨t, ⟨?_, ht₂⟩⟩ + rw [add_comm] + have r : (((i : Fin (b aMax)) + 1 : Fin ((b aMax) + 1)) : ℕ) = + ((i : Fin (b aMax)) + 1: ℕ) := by + simp only [Fin.coe_eq_castSucc, Fin.coeSucc_eq_succ, Fin.val_succ] + exact r ▸ ht₁ + · use n + 1 + have d : n + 1 = ((((n : ℕ) : Fin (b aMax + 1)) + 1 : Fin (b aMax + 1)) : ℕ) := by + norm_cast sorry - exact h.choose - - - -theorem main' (p : Set α → Prop) (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) - (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) - (hc : ∀ (n : ℕ), ⋂ (k ≤ n), (⋃₀ (L k).toSet) ≠ ∅) : - ∃ (K : (j : ℕ) → (L j)), (∀ n N, ⋂ (j ≤ n), (K j) ∩ ⋂ (k < N), - ⋃₀ (L (n + 1 + k)).toSet ≠ ∅) := by - have h : 0 = 0 := by rfl - - - - -- `q K N` is true, if `K ∩ ⋂ (k < N), ⋃₀ (L k) ≠ ∅` - let q : (L 0) → ℕ → Prop := fun (K : (L 0)) n ↦ (K : Set α) ∩ ⋂ (k < n), (⋃₀ (L k).toSet) ≠ ∅ - - have hq (N : ℕ) : ∃ (K : (L 0)), q K N := by - by_contra! h - push_neg at h - rw [← iUnion_eq_empty] at h - have f : ⋃ (i : { x // x ∈ L 0 }), ↑i ∩ ⋂ k, ⋂ (_ : k < N), ⋃₀ ↑(L k) = (⋃ (i : { x // x ∈ L 0 }), ↑i) ∩ ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet := by - rw [iUnion_inter] - rw [f] at h - have g : (⋃ (i : { x // x ∈ L 0 }), ↑i) ∩ ⋂ k, ⋂ (_ : k ≤ N), ⋃₀ (L k).toSet = ⋂ k, ⋂ (_ : k ≤ N), ⋃₀ (L k).toSet := by - apply inter_eq_self_of_subset_right - have f : ⋃ (i : { x // x ∈ (L 0) }), ↑i = ⋃₀ (L 0).toSet := by - rw [sUnion_eq_iUnion] - rfl - rw [f] - refine biInter_subset_of_mem (Nat.zero_le N) - rw [g] at h - apply (hc N) h - - - - - - -- `r K n` is true, if `∀ N, ⋂ (j ≤ n), (K j) ∩ ⋂ (k < N), ⋃₀ (L (n + 1 + k)) ≠ ∅`. - let r : ((n : ℕ) → (k : ℕ) → (hk : k ≤ n) → (L k)) → ℕ → Prop := fun K n ↦ ∀ N, ⋂ (j ≤ n), (K j) ∩ ⋂ (k < N), ⋃₀ (L (n + 1 + k)).toSet ≠ ∅ - - have hr0 (n : ℕ) : ∃ (K : (n : ℕ) → (L n)), r K 0 := by - sorry - - have hrn (n : ℕ) : ∃ (K : (n : ℕ) → (L n)), ∀ n, r K n → ∃ (K' : (n : ℕ) → (L n)), (∀ k ≤ n, K' k = K k) ∧ r K' (n + 1) := by - sorry - - have hrn' (n : ℕ) (k : ℕ) (hk : k ≤ n) : ∃ (K : (L (n + 1))), ∀ n, r K n → ∃ (K' : (n : ℕ) → (L n)), (∀ k ≤ n, K' k = K k) ∧ r K' (n + 1) := by - sorry - - - - have hq' (K : (L 0)) (n : ℕ) : q K (n + 1) → q K n := by - intro c d - apply c - rw [← subset_empty_iff] - apply le_trans _ d.le - refine inter_subset_inter_right (K : Set α) ?_ - apply antitone_dissipate (le_succ n) - obtain ⟨K, hK⟩ := l3 q hq hq' - - - let q' (n : ℕ) (K : ((j : ℕ) → (hj : j ≤ n) → (L j))) (N : ℕ) : Prop := ⋂ (j : ℕ) (hj : j ≤ n), ((K j hj) : Set α) ∩ ⋂ (k ≤ N), (⋃₀ (L (n + 1 + k)).toSet) ≠ ∅ - let a : (j : ℕ) → j < 0 → { x // x ∈ L j } := fun j hj ↦ False.elim <| not_succ_le_zero j hj - have h'q (n : ℕ) (N : ℕ) : ∃ (K : (j : ℕ) → (hj : j ≤ 0) → (L j)), q' 0 K N := by - simp_rw [q'] - have d (j : ℕ) : j ≤ 0 → j = 0 := by exact fun a ↦ eq_zero_of_le_zero a - use fun (j : ℕ) (hj : j ≤ 0) ↦ (eq_zero_of_le_zero hj) ▸ K - have h₃ : ⋂ j, ⋂ (hj : j ≤ 0), ↑((fun j hj ↦ ((eq_zero_of_le_zero hj) ▸ K) j hj) : Set α) = (K : Set α) := by sorry - apply? - - - - - sorry - - - - - -- `q' n K N` is true, if `⋂ (j ≤ n), (K j) ∩ ⋂ (k ≤ N), ⋃₀ (L (n + 1 + k)) ≠ ∅` - let q' : (n : ℕ) → ((j : ℕ) → (L j)) → ℕ → Prop := - fun n K N ↦ ⋂ (j : ℕ) (hj : j ≤ n), (K j : Set α) ∩ ⋂ (k ≤ N), (⋃₀ (L (n + 1 + k)).toSet) ≠ ∅ - - let K : (j : ℕ) → (L j) := match j with - | zero := by sorry - - + rw [d] at h + exact h - - - have h_main : ∃ (K : ((j : ℕ) → (L j))), ∀ (n N : ℕ), q' n K N := by sorry - obtain ⟨K, hK⟩ := h_main + obtain ⟨K, hK⟩ := d use K +noncomputable def main : (n : ℕ) → ((K' : (k : Fin (n + 1)) → (L k)) ×' (r K')) + | 0 => ⟨(get_element_zero hL hc).choose, (get_element_zero hL hc).choose_spec⟩ + | n + 1 => by + let g := ((get_element_succ hL hc) n (main n).1 (main n).2) + exact ⟨join (main n).1 g.choose, g.choose_spec⟩ - have hq (n : ℕ) : ∃ (K : (L 0)), q K n := by - by_contra! h - push_neg at h - rw [← iUnion_eq_empty] at h - have f : ⋃ (i : { x // x ∈ L 0 }), ↑i ∩ ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ ↑(L k) = (⋃ (i : { x // x ∈ L 0 }), ↑i) ∩ ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ (L k).toSet := by - rw [iUnion_inter] - rw [f] at h - have g : (⋃ (i : { x // x ∈ L 0 }), ↑i) ∩ ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ (L k).toSet = ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ (L k).toSet := by - apply inter_eq_self_of_subset_right - have f : ⋃ (i : { x // x ∈ (L 0) }), ↑i = ⋃₀ (L 0).toSet := by - rw [sUnion_eq_iUnion] - rfl - rw [f] - refine biInter_subset_of_mem (Nat.zero_le n) - rw [g] at h - apply (hc n) h - have hq' (K : (L 0)) (n : ℕ) : q K (n + 1) → q K n := by - intro c d - apply c - rw [← subset_empty_iff] - apply le_trans _ d.le - refine inter_subset_inter_right (K : Set α) ?_ - apply antitone_dissipate (le_succ n) - have hK : ∃ (K : (L 0)), ∀ n, q K n := by - exact l3 q hq hq' - - let q' : (n : ℕ) → ((j : ℕ) → (hj : j ≤ n) → (L j)) → ℕ → Prop := - fun n K N ↦ ⋂ (j : ℕ) (hj : j ≤ n), (K j hj : Set α) ∩ ⋂ (k ≤ N), (⋃₀ (L (n + k + 1)).toSet) ≠ ∅ - have hq'' : q' = fun n K N ↦ ⋂ (j : ℕ) (hj : j ≤ n), (K j hj : Set α) ∩ ⋂ (k ≤ N), - (⋃₀ (L (n + k + 1)).toSet) ≠ ∅ := by - rfl - have hq' (n : ℕ) (K : ((j : ℕ) → (hj : j ≤ n) → (L j))) (N : ℕ) : (q' n K N) ↔ - (⋂ (j : ℕ) (hj : j ≤ n), (K j hj : Set α) ∩ ⋂ (k ≤ N), (⋃₀ (L (n + k + 1)).toSet) ≠ ∅) := by - rfl - - - - sorry - have h'' (K : L 0) := Finite.exists_infinite_fiber (fun n ↦ q K n) - have h''' : ∃ (K : L 0), Infinite ((fun n ↦ q K n) ⁻¹' {True}) := by - by_contra! h - simp only [preimage_singleton_true, coe_setOf, not_infinite_iff_finite, Subtype.forall] at h - - +noncomputable def main' : (j : ℕ) → (L j) := by + have hj (j : ℕ) : j = ((j : Fin (j + 1)) : ℕ) := by + simp only [Fin.natCast_eq_last, Fin.val_last] + exact fun j ↦ (hj j).symm ▸ (main hL hc j).1 j +lemma has_r (n : ℕ) : r (main hL hc n).1 := by + exact (main hL hc n).2 - simp_rw [← hq'] +lemma has_r' (n : ℕ) : r (main' hL hc n).1 := by + exact (main hL hc n).2 - have h₀ (n : ℕ) : ∃ (K : ((j : ℕ) → (hj : j ≤ n) → (L j))), ∀ N, q' N (fun j hj ↦ K j) k := by sorry +theorem main' (p : Set α → Prop) (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) + (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) + (hc : ∀ (n : ℕ), ⋂ (k : Fin (n + 1)), (⋃₀ (L k).toSet) ≠ ∅) : + ∃ (K : (j : ℕ) → (L j)), (∀ n N, ⋂ (j : Fin (n + 1)), (K j) ∩ ⋂ (k < N), + ⋃₀ (L (n + 1 + k)).toSet ≠ ∅) := by + use (main' hL hc n).1 + exact has_r hL hc sorry - def ack : Nat → Nat → Nat | 0, n => n + 1 | m + 1, 0 => ack m 1 @@ -946,3 +938,31 @@ theorem IsCompactSystem.closedCompactSquareCylinders : closedCompactSquareCylinders_supset end ClosedCompactSquareCylinders + + +variable {β : (n : ℕ) → Type*} + +variable (p : {n : ℕ} → ((k : Fin (n + 1)) → (β k)) → Prop) + +def joi {n : ℕ} (x : (k : Fin (n + 1)) → (β k)) (y : β (n + 1)) : (k : Fin (n + 2)) → (β k) := by + let z (k : Fin (n + 2)) (hk : ¬ k.val < n + 1) : β k := by + simp only [not_lt] at hk + have h : β k = β (n + 1) := by + congr + exact Nat.eq_of_le_of_lt_succ hk k.prop + exact h ▸ y + exact fun k ↦ dite (k.val < n + 1) (fun c ↦ x ⟨k.val, c⟩) (z k) + +variable (h0 : ∃ x : (k : Fin 1) → (β k), p x) + (h : ∀ (n : ℕ) (x : (k : Fin (n + 1)) → (β k)), p x → ∃ y : (β (n + 1)), + p (joi x y)) + + +noncomputable def m : (n : ℕ) → ((x : (k : Fin (n + 1)) → (β k)) ×' (p x)) + | 0 => ⟨h0.choose, h0.choose_spec⟩ + | n + 1 => by + let g := (h n (m n).1 (m n).2) + exact ⟨joi (m n).1 g.choose, g.choose_spec⟩ + +example (n : ℕ) : p (m p h0 h n).1 := by + exact (m p h0 h n).2 From 86faad8027667766cc1363e874292fcd15ccb0a8 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 25 Apr 2025 19:55:35 +0200 Subject: [PATCH 091/129] transfer2 --- .../Topology/Compactness/CompactSystem.lean | 419 ++++++++++++------ .../Compactness/CompactSystemcopy.lean | 125 ++++++ 2 files changed, 407 insertions(+), 137 deletions(-) create mode 100644 Mathlib/Topology/Compactness/CompactSystemcopy.lean diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index c813b4f1c79379..33561cea043783 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -401,180 +401,300 @@ example (s : ℕ → Set α) : ⋂ (j : Fin 0), s j = univ := by exact not_succ_le_zero i hi -variable {p : Set α → Prop} (hp : IsCompactSystem p) {L : ℕ → Finset (Set α)} +variable {p : Set α → Prop} (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) (hc : ∀ (n : ℕ), ⋂ (k : Fin (n + 1)), (⋃₀ (L k).toSet) ≠ ∅) -- variable (p : {n : ℕ} → ((k : Fin (n + 1)) → (β k)) → Prop) -noncomputable def r {n : ℕ} (K : (k : Fin (n + 1)) → (L k)) := - ∀ N, ⋂ (k : Fin (n + 1)), (K k) ∩ ⋂ (k : Fin N), (⋃₀ (L (n + 1 + k)).toSet) ≠ ∅ +variable [Nonempty α] + +noncomputable def r (n : ℕ) (K : ℕ → Set α) : Prop := + ∀ N, ⋂ (j < n), (K j) ∩ ⋂ (k < N), (⋃₀ (L (n + k)).toSet) ≠ ∅ + +example (p : ℕ → Prop) : ∀ k < 0, p k := by + exact fun k hk ↦ (by cases hk) + + +lemma l5 (K : ℕ → Set α) : r L 0 K := by + simp [r] + --- variable (h0 : ∃ x : (k : Fin 1) → (β k), p x) -- h0 -> (get_element_zero hL hc) +-- (h0 : ∃ x : (ℕ → α), x 0 ∈ β 0 ∧ p 0 x) -lemma nonempty (k : ℕ) (hc : ∀ (N : ℕ), ⋂ (k : Fin (N + 1)), (⋃₀ (L k).toSet) ≠ ∅) : - (L k).Nonempty := by +lemma nonempty (k : ℕ) (hc : ∀ N, ⋂ k < N, ⋃₀ (L k : Set (Set α)) ≠ ∅) : (L k).Nonempty := by + specialize hc (k + 1) by_contra! h simp only [Finset.not_nonempty_iff_eq_empty] at h - have hg : ⋃₀ (L k).toSet = ∅ := by + apply hc + apply iInter_eq_empty_iff.mpr fun x ↦ ⟨k, ?_⟩ + simp only [lt_add_iff_pos_right, lt_one_iff, pos_of_gt, iInter_true] + have hg : ⋃₀ (L k : Set (Set α)) = ∅ := by rw [h] simp only [Finset.coe_empty, sUnion_empty] - apply (hc k) - apply iInter_eq_empty_iff.mpr - exact fun x ↦ ⟨k, by simp [h]⟩ + exact of_eq_false (congrFun hg x) -example (s : Set α) (hs : s ⊆ ∅) : s = ∅ := by - exact subset_eq_empty hs rfl +-- (h0 : ∃ x : (ℕ → α), x 0 ∈ β 0 ∧ p 0 x) +-- (h0 : ∃ x : (ℕ → α), x 0 ∈ β 0 ∧ p 0 x) -example (x : α) (s : Set α) (hx : x ∈ s) (hs : s = ∅) : False := by - revert hs - change s ≠ ∅ - exact ne_of_mem_of_not_mem' hx fun a ↦ a +private lemma l (n : ℕ) : (⋃₀ L 0) ∩ ⋂ (k < n), ⋃₀ L (1 + k) = ⋂ (k < n + 1), ⋃₀ (L k).toSet := by + ext x + rw [mem_inter_iff, mem_iInter₂, mem_iInter₂] + refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ + · intro i hi + by_cases h' : i = 0 + · rw [h'] + exact h.1 + · let j := i - 1 + have h₁ : j < n := Nat.sub_lt_right_of_lt_add (one_le_iff_ne_zero.mpr h') hi + have h₂ : 1 + j = i := (add_comm 1 j) ▸ succ_pred_eq_of_ne_zero h' + exact h₂ ▸ h.2 j h₁ + · refine ⟨h 0 (zero_lt_succ n), fun i hi ↦ ?_⟩ + exact (add_comm 1 i) ▸ h (i + 1) (Nat.add_lt_add_right hi 1) + +example (j m n : ℕ) (hj : j < m) : j < m + n:= by + exact Nat.lt_add_right n hj + +private lemma l6 (m n : ℕ) : (⋂ k < m, (⋃₀ L k)) ∩ ⋂ (k < n), ⋃₀ L (m + k) = + ⋂ (k < m + n), ⋃₀ (L k).toSet := by + ext x + rw [mem_inter_iff, mem_iInter₂, mem_iInter₂, mem_iInter₂] + refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ + · intro i hi + by_cases h' : i < m + · exact h.1 i h' + · have hj : ∃ j, j < n ∧ i = m + j := by + use i - m + refine ⟨Nat.sub_lt_left_of_lt_add (not_lt.mp h') hi, Eq.symm (add_sub_of_le (not_lt.mp h'))⟩ + obtain ⟨j, hj₁, hj₂⟩ := hj + rw [hj₂] + exact h.2 j hj₁ + · refine ⟨fun i hi ↦ ?_, fun i hi ↦ ?_⟩ + · have h' (j m n : ℕ) (hj : j < m) : j < m + n := by + exact Nat.lt_add_right n hj + exact h i (h' i m n hi) + · have h' (j m n : ℕ) : j < n → ((m + j) < m + n) := by + exact fun a ↦ Nat.add_lt_add_left a m + exact h (m + i) (h' i m n hi) -example (s : Set α) : (s ≠ ∅) ↔ ∃ x, x ∈ s := by - rw [← nonempty_iff_ne_empty, nonempty_def] -lemma get_element_zero (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) - (hc : ∀ (N : ℕ), ⋂ (k : Fin (N + 1)), (⋃₀ (L k).toSet) ≠ ∅) : - ∃ (K : (k : Fin 1) → (L k)), r K := by - have h1 : ∀ k : Fin 1, L k = L 0 := by - intro k - rw [Fin.val_eq_zero] - simp [r] - have g : ∀ (K : (L 0)), (r (fun (k : Fin 1) ↦ (h1 k) ▸ K)) ↔ - (∀ N, (K : Set α) ∩ ⋂ (k : Fin N), (⋃₀ (L (0 + 1 + k)).toSet) ≠ ∅) := by - intro K - simp [r] - refine ⟨fun h N ↦ ?_, fun h N ↦ ?_⟩ <;> - specialize h N <;> change _ ≠ ∅ at h ⊢ <;> - rw [← nonempty_iff_ne_empty, nonempty_def] at h ⊢ <;> - obtain ⟨x, hx⟩ := h <;> use x <;> - simp only [mem_inter_iff, mem_iInter, mem_sUnion, Finset.mem_coe] at hx ⊢ - · exact hx 0 - · refine fun i ↦ ⟨(Fin.fin_one_eq_zero i) ▸ hx.1, hx.2⟩ - have d : ∃ (K : (L 0)), r (fun (k : Fin 1) ↦ (h1 k) ▸ K) := by - simp_rw [g] +-- (h0 : ∃ x : (ℕ → α), p 0 x) + +def q : ℕ → (ℕ → Set α) → Prop := fun n K ↦ (∀ k < n, K k ∈ L k) ∧ (r L n K) + +lemma get_element_zero : ∃ (K : ℕ → Set α), q L 0 K := by + simp [q, r] + +-- (h : ∀ (n : ℕ) (x : (ℕ → α)) (hx : p n x), ∃ y, p (n + 1) (Function.update x n y)) + +-- p n x ↔ (∀ k < n, K k ∈ β k) ∧ (r n K) + + +lemma get_element_succ' (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) (n : ℕ) + (K : ℕ → Set α) (hK : q L n K) : ∃ y, q L (n + 1) (Function.update K n y) := by + sorry + +noncomputable def m' : (n : ℕ) → ((K : ℕ → Set α) ×' (q L n K)) + | 0 => ⟨(get_element_zero L).choose, (get_element_zero L).choose_spec⟩ + | n + 1 => by + have g := (get_element_succ' L hL) n (m' n).1 (m' n).2 + refine ⟨Function.update (m' n).1 n g.choose, g.choose_spec⟩ + + + + +lemma get_element_zero' (hL : ∀ n d (hd : d ∈ (L n : Set (Set α))), p d) + (hc : ∀ N, ⋂ k < N, ⋃₀ ((L k) : Set (Set α)) ≠ ∅) : + ∃ (K : ℕ → Set α) (hK : ∀ k < 1, K k ∈ L k), r 1 K := by + have hKfun {K : Set α} (hK' : K ∈ L 0) (k : ℕ) (hk : k < 1) : (fun _ ↦ K) k ∈ L k := + (lt_one_iff.mp hk) ▸ hK' + simp_rw [r] + have d : ∃ (K : Set α) (hK' : K ∈ L 0), r 1 (fun _ ↦ K) (hKfun hK') := by + simp_rw [r] by_contra! h - simp only [zero_add, Subtype.forall] at h choose! b ha using h - classical - obtain ⟨aMax, ⟨ha1, ha2⟩⟩ := Finset.exists_max_image (L 0) b (nonempty 0 hc) - have h' : ∀ a ∈ L 0, a ∩ ⋂ (k : Fin ((b aMax))), ⋃₀ ↑(L (1 + ↑k)) = ∅ := by + obtain ⟨K0Max, ⟨hK0₁, hK0₂⟩⟩ := Finset.exists_max_image (L 0) b (nonempty 0 hc) + apply hc (b K0Max + 1 + 1) + -- refine Set.iInter_eq_empty_iff.mpr fun x ↦ ?_ + have h' : ∀ a ∈ L 0, a ∩ ⋂ k < 1, ⋂ (k < b K0Max + 1), ⋃₀ ↑(L (1 + k)) = ∅ := by intro a' h' - refine subset_eq_empty (inter_subset_inter (fun ⦃a⦄ a ↦ a) - (iInter_mono' (fun j ↦ ?_))) (ha a' h') - use ⟨j.val, le_trans j.prop (ha2 a' h')⟩ - apply hc (b aMax) - rw [Set.iInter_eq_empty_iff] - intro x - by_cases h : x ∈ ⋃₀ (L 0) - · simp only [mem_sUnion, Finset.mem_coe] at h - obtain ⟨t, ⟨ht1, ht2⟩⟩ := h - specialize h' t ht1 - rw [← not_forall, ← mem_iInter] - have d : x ∉ ⋂ (k : Fin (b aMax)), ⋃₀ ↑(L (1 + ↑k)) := by - intro e - obtain v : x ∈ t ∩ ⋂ (k : Fin (b aMax)), ⋃₀ ↑(L (1 + ↑k)) := by - exact (mem_inter ht2 e) - revert h' - change _ ≠ ∅ - exact ne_of_mem_of_not_mem' v fun a ↦ a - intro hd - apply d - simp only [mem_iInter, mem_sUnion, Finset.mem_coe] at hd ⊢ - intro i - obtain ⟨t, ⟨ht₁, ht₂⟩⟩ := hd (i + 1) - refine ⟨t, ⟨?_, ht₂⟩⟩ - rw [add_comm] - have r : (((i : Fin (b aMax)) + 1 : Fin ((b aMax) + 1)) : ℕ) = - ((i : Fin (b aMax)) + 1: ℕ) := by - simp only [Fin.coe_eq_castSucc, Fin.coeSucc_eq_succ, Fin.val_succ] - exact r ▸ ht₁ - · exact ⟨0, h⟩ - obtain ⟨K, hK⟩ := d - use (fun (k : Fin 1) ↦ (h1 k) ▸ K) - exact hK + have f := (ha a' h') + simp only [lt_one_iff, iInter_iInter_eq_left] at f + refine subset_eq_empty (inter_subset_inter (fun ⦃a⦄ a ↦ a) (iInter_mono' (fun j ↦ ?_))) f + use 0 + intro k + simp only [lt_one_iff, pos_of_gt, iInter_true, mem_iInter, mem_sUnion, Finset.mem_coe] + intro hk hj + exact hk j (le_trans hj (le_trans (hK0₂ a' h') (le_succ (b K0Max)))) + simp only [lt_one_iff, iInter_iInter_eq_left] at h' + have h'' : ∀ (a : L 0), a.val ∩ ⋂ k, ⋂ (_ : k < b K0Max + 1), ⋃₀ (L (1 + k) : Set (Set α)) = ∅ := by + rw [Subtype.forall] + simp only + exact h' + rw [← iUnion_eq_empty] at h'' + have h''' : (⋃ a : L 0, a.val) ∩ (⋂ k, ⋂ (_ : k < b K0Max + 1), ⋃₀ (L (1 + k) : Set (Set α))) = ∅ := by + rw [iUnion_inter] + exact h'' + have h'''': ⋃₀ L 0 ∩ ⋂ k, ⋂ (_ : k < b K0Max + 1), ⋃₀ (L (1 + k) : Set (Set α)) = ∅ := by + rw [sUnion_eq_iUnion] + exact h''' + rw [l] at h'''' + exact h'''' + obtain ⟨K, ⟨hK₁, hK₂⟩⟩ := d + refine ⟨fun _ ↦ K, hKfun hK₁, hK₂⟩ + lemma element_0_has_r (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) (hc : ∀ (N : ℕ), ⋂ (k : Fin (N + 1)), (⋃₀ (L k).toSet) ≠ ∅) (K : (k : Fin 1) → (L k)) (hK : K = (get_element_zero hL hc).choose) : r K := by exact hK ▸ (get_element_zero hL hc).choose_spec -def join {n : ℕ} (K' : (k : Fin (n + 1)) → (L k)) (K : L (n + 1)) : - (k : Fin (n + 2)) → (L k) := by - let K'' (k : Fin (n + 2)) (hk : ¬ k.val < n + 1) : L k := by - simp only [not_lt] at hk - have h : L k = L (n + 1) := by - congr - exact Nat.eq_of_le_of_lt_succ hk k.prop - exact h ▸ K - exact fun k ↦ dite (k.val < n + 1) (fun c ↦ K' ⟨k.val, c⟩) (fun c ↦ K'' k c) - +example (n : ℕ) : n < n.succ := by exact lt_add_one n --- (h : ∀ {n : ℕ} (x : (k : Fin (n + 1)) → (β k)), p x → ∃ y : (β (n + 1)), p (joi x y)) --- h → (get_element_succ hL hd hc) +def join {n : ℕ} (K' : (k : ℕ) → (L k)) (K : L (n + 1)) {k : ℕ} (hk : k < n + 2) : + (L k) := by + let K'' (k : ℕ) (hk₁ : k < n + 2) (hk₂ : ¬ k < n + 1) : L k := by + have h : k = n + 1 := by linarith + exact h ▸ K + exact dite (k < n + 1) (fun c ↦ K' k) (fun c ↦ K'' k hk c) + +lemma join_of_lt_succ {n : ℕ} (K' : (k : ℕ) → (L k)) (K : L (n + 1)) {j : ℕ} (hj : j < n + 1) : + join K' K (lt_trans hj (lt_add_one (n + 1))) = K' j := by + simp only [join, dite_eq_left_iff, not_lt] + intro h + linarith + +lemma join_of_eq_succ {n : ℕ} (K' : (k : ℕ) → (L k)) (K : L (n + 1)) : + join K' K (lt_add_one (n + 1)) = K := by + simp [join] + +example (K : ℕ → Set α) (s : Set α) : ⋂ k, (K k) ∩ s = (⋂ k, (K k)) ∩ s := by + exact Eq.symm (iInter_inter s K) +example (n : ℕ) : 0 < n + 1 := by exact zero_lt_succ n + +example (x : α) (n : ℕ) (s : ℕ → Finset (Set α)) (u : (n : ℕ) → (s n)) (hs : ∀ i < n + 1, (x ∈ ((u i) : Set α) ∧ ∃ t ∈ s n, x ∈ t)) : + ∃ t ∈ s (n + 1), x ∈ t := by + obtain h₂ := (hs 0 (zero_lt_succ n)).2 + rcases h₂ with ⟨t, ht, h⟩ + use t, ht, h + +lemma iUnion_join {n : ℕ} (K' : (k : ℕ) → (L k)) (s : Set α) : + ⋃ (a : L (n + 1)), ⋂ (k : ℕ) (hk : k < n + 2), (join K' a hk) ∩ s = + ⋂ (k : ℕ) (hk : k < n + 1), (K' k) ∩ ⋃₀ (L (n + 1)) ∩ s := by + ext x + simp only [mem_iUnion, mem_iInter, mem_inter_iff, Subtype.exists, mem_sUnion, Finset.mem_coe] + refine ⟨fun h i hi ↦ ⟨⟨?_, ?_⟩, ?_⟩ , fun h ↦ ⟨?_, ?_, ?_⟩⟩ + · obtain ⟨K, ⟨hK, h'⟩⟩ := h + specialize h' i (lt_trans hi <| lt_add_one (n + 1)) + rw [join_of_lt_succ K' ⟨K, hK⟩ hi] at h' + exact h'.1 + · obtain ⟨K, ⟨hK, h'⟩⟩ := h + specialize h' (n + 1) (lt_add_one (n + 1)) + rw [join_of_eq_succ] at h' + use K + exact ⟨hK, h'.1⟩ + · obtain ⟨K, ⟨hK, h'⟩⟩ := h + refine (h' 0 (zero_lt_succ (n + 1))).2 + · obtain h₁ : ∀ i < n + 1, (x ∈ ((K' i) : Set α)) := by exact fun i hi ↦ (h i hi).1.1 + obtain h₂ : ∃ t ∈ (L (n + 1) : Set (Set α)), x ∈ t:= (h 0 (zero_lt_succ n)).1.2 + rcases h₂ with ⟨t, ht, j⟩ + sorry + · sorry + · sorry example (s : ℕ → (Set α)) (b : Set α) : ⋂ k, (s k) ∩ b = (⋂ k, (s k)) ∩ b := by exact Eq.symm (iInter_inter b s) +example (s : ℕ → Set α) : (∀ n, s n = ∅) ↔ (⋃ n, s n = ∅) := by + exact iUnion_eq_empty.symm + +example {s t u : Set α} (htu : t = u) : t ∩ s = u ∩ s := by + exact congrFun (congrArg Inter.inter htu) s + +example (i : ℕ) (hi : i ≠ 0) : ∃ j, i = j + 1 := by + exact exists_eq_succ_of_ne_zero hi + +example (i : ℕ) : (¬i = 0) ↔ i ≠ 0 := by + exact Eq.to_iff rfl + + +private lemma l4 {n : ℕ} (L : Fin (n + 1) → Set (Set α)) : ⋂ (k : Fin (n + 1)), ⋃₀ (L k) = + ⋃₀ (L 0) ∩ ⋂ (k : Fin n), ⋃₀ (L ((k + 1) : Fin (n + 1))) := by + refine Eq.symm (ext fun x ↦ ⟨fun h ↦ ?_, fun h ↦ ?_⟩) <;> + simp only [mem_inter_iff, mem_sUnion, mem_iInter] at h ⊢ + · intro i + by_cases g : i = 0 + · obtain ⟨t, ht⟩ := h.1 + use t + exact g.symm ▸ ht + · have h' : ∃ (j : ℕ), j < n ∧ i = j + 1 := by + have g' : i.val ≠ 0 := by + exact Fin.val_ne_zero_iff.mpr g + obtain ⟨j, hj⟩ := exists_eq_succ_of_ne_zero g' + use j + refine ⟨?_, ?_⟩ + · sorry + · simp [hj] + + + + + sorry + obtain ⟨j, ⟨hj1, hj2⟩⟩ := h' + obtain ⟨t, ⟨ht1, ht2⟩⟩ := h.2 ⟨j, hj1⟩ + use t + simp only at ht1 + rw [← hj2] at ht1 + exact ⟨ht1, ht2⟩ + · sorry + +-- h : ∀ (n : ℕ) (x : (ℕ → α)) (hx : x n ∈ β n ∧ p n x), ∃ y ∈ β (n + 1), p (n + 1) (Function.update x (n + 1) y) + +lemma get_element_succ' (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) (n : ℕ) (K : ℕ → Set α) (hK : K n ∈ L n ∧ r n K) : ∃ K' ∈ L (n + 1), r (n + 1) (Function.update K (n + 1) K') := by + sorry + + lemma get_element_succ (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) (hc : ∀ (n : ℕ), ⋂ (k : Fin (n + 1)), (⋃₀ (L k).toSet) ≠ ∅) : ∀ (n : ℕ) (K' : (k : Fin (n + 1)) → (L k)), r K' → ∃ (K : (L (n + 1))), r (join K' K) := by intro n K' hK' - have d : ∃ (K : (L (n + 1))), r (join K' K) := by - simp [r] - by_contra! h - choose! b ha using h - classical - obtain ⟨aMax, ⟨ha1, ha2⟩⟩ := Finset.exists_max_image (L (n + 1)) b (nonempty (n + 1) hc) - have h' : ∀ (a : Set α) (b_1 : a ∈ L (n + 1)), ⋂ k, ↑(join K' ⟨a, b_1⟩ k) ∩ - ⋂ (k : Fin (b aMax)), ⋃₀ (L (n + 1 + 1 + ↑k) : Set (Set α)) = ∅ := by - intro a' h' - refine subset_eq_empty ?_ (ha a' h') - rw [← iInter_inter, ← iInter_inter] - apply (inter_subset_inter (fun ⦃a⦄ a ↦ a) (iInter_mono' (fun j ↦ ?_))) - use ⟨j.val, le_trans j.prop (ha2 a' h')⟩ - apply hc (b aMax) - rw [Set.iInter_eq_empty_iff] - intro x - by_cases h : x ∈ ⋃₀ (L (n + 1)) - · simp only [mem_sUnion, Finset.mem_coe] at h - obtain ⟨t, ⟨ht1, ht2⟩⟩ := h - specialize h' t ht1 - rw [← not_forall, ← mem_iInter] - have d : x ∉ ⋂ (k : Fin (b aMax)), ⋃₀ ↑(L (1 + ↑k)) := by - intro e - obtain v := (mem_inter ht2 e) - revert h' - change _ ≠ ∅ - sorry - -- exact ne_of_mem_of_not_mem' v fun a ↦ a - intro hd - apply d - simp only [mem_iInter, mem_sUnion, Finset.mem_coe] at hd ⊢ - intro i - obtain ⟨t, ⟨ht₁, ht₂⟩⟩ := hd (i + 1) - refine ⟨t, ⟨?_, ht₂⟩⟩ - rw [add_comm] - have r : (((i : Fin (b aMax)) + 1 : Fin ((b aMax) + 1)) : ℕ) = - ((i : Fin (b aMax)) + 1: ℕ) := by - simp only [Fin.coe_eq_castSucc, Fin.coeSucc_eq_succ, Fin.val_succ] - exact r ▸ ht₁ - · use n + 1 - have d : n + 1 = ((((n : ℕ) : Fin (b aMax + 1)) + 1 : Fin (b aMax + 1)) : ℕ) := by - norm_cast - sorry - rw [d] at h - exact h - - - obtain ⟨K, hK⟩ := d - use K - + simp only [r, ne_eq, Subtype.exists] + by_contra! h + choose! b ha using h + classical + obtain ⟨aMax, ⟨ha1, ha2⟩⟩ := Finset.exists_max_image (L (n + 1)) b (nonempty (n + 1) hc) + have h' : ∀ (a : L (n + 1)), ⋂ k, ↑(join K' a k) ∩ + ⋂ (k : Fin (b aMax)), ⋃₀ (L (n + 1 + 1 + ↑k) : Set (Set α)) = ∅ := by + intro a' + refine subset_eq_empty ?_ (ha a'.val a'.prop) + rw [← iInter_inter, ← iInter_inter] + apply (inter_subset_inter (fun ⦃a⦄ a ↦ a) (iInter_mono' (fun j ↦ ?_))) + use ⟨j.val, le_trans j.prop (ha2 a'.val a'.prop)⟩ + simp only [r] at hK' + apply hK' (b aMax + 1) + rw [← iUnion_eq_empty] at h' + rw [iUnion_join] at h' + rw [← h'] + refine iInter_congr fun i ↦ ?_ + rw [inter_assoc] + refine congrArg (Inter.inter _) ?_ + rw [l4] + simp only [Fin.val_zero, add_zero, Fin.coe_eq_castSucc] + apply congrArg (Inter.inter _) + refine iInter_congr fun i ↦ ?_ + ext x + simp only [Fin.coeSucc_eq_succ, Fin.val_succ, mem_sUnion, Finset.mem_coe] + refine ⟨fun ⟨t, ⟨ht1, ht2⟩⟩ ↦ ⟨t, ⟨?_, ht2⟩⟩, fun ⟨t, ⟨ht1, ht2⟩⟩ ↦ ⟨t, ⟨?_, ht2⟩⟩⟩ + · rw [add_assoc] + nth_rewrite 3 [add_comm] + exact ht1 + · rw [add_assoc] at ht1 + nth_rewrite 3 [add_comm] at ht1 + exact ht1 noncomputable def main : (n : ℕ) → ((K' : (k : Fin (n + 1)) → (L k)) ×' (r K')) @@ -966,3 +1086,28 @@ noncomputable def m : (n : ℕ) → ((x : (k : Fin (n + 1)) → (β k)) ×' (p x example (n : ℕ) : p (m p h0 h n).1 := by exact (m p h0 h n).2 + + + + + +variable {β : (n : ℕ) → (Set α)} (p : ℕ → (ℕ → α) → Prop) + +variable (h0 : ∃ x : (ℕ → α), p 0 x) + (h : ∀ (n : ℕ) (x : (ℕ → α)) (hx₁ : ∀ k < n, x k ∈ β k) (hx₂ : p n x) , + ∃ y ∈ β n, p (n + 1) (Function.update x n y)) + +noncomputable def m' : (n : ℕ) → ((x : ℕ → α) ×' (∀ k < n, x k ∈ β k) ∧ (p n x)) + | 0 => ⟨h0.choose, ⟨by simp, h0.choose_spec⟩⟩ + | n + 1 => by + have g : ∃ y ∈ β n, p (n + 1) (Function.update (m' n).fst n y) := (h n (m' n).1 (m' n).2.1 (m' n).2.2) + obtain ⟨y, hy⟩ := g + have g' : Function.update (m' n).1 n g.choose n ∈ β n := by + simp only [ne_eq, left_eq_add, one_ne_zero, not_false_eq_true, Function.update_of_ne] + + simp only [Function.update_self] + exact g.choose_spec.1 + exact ⟨Function.update (m' n).1 (n + 1) g.choose, fun g' ↦ g.choose_spec.2⟩ + +lemma e (n : ℕ) : (((m' p h0 h n).1 n) ∈ β n) ∧ (p n (m' p h0 h n).1) := by + exact (m' p h0 h n).2 diff --git a/Mathlib/Topology/Compactness/CompactSystemcopy.lean b/Mathlib/Topology/Compactness/CompactSystemcopy.lean new file mode 100644 index 00000000000000..c9c1c7af694d49 --- /dev/null +++ b/Mathlib/Topology/Compactness/CompactSystemcopy.lean @@ -0,0 +1,125 @@ +/- +Copyright (c) 2023 Rémy Degenne. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Rémy Degenne, Peter Pfaffelhuber +-/ +import Mathlib.Data.Set.Dissipate + +variable {α : Type*} (p : ℕ → (ℕ → α) → Prop) + +variable (h0 : ∃ x : (ℕ → α), p 0 x) + (h : ∀ (n : ℕ) (x : (ℕ → α)) (hx : p n x), + ∃ y, p (n + 1) (Function.update x n y)) + +-- p n x ↔ (∀ k < n, K k ∈ β k) ∧ (r n K) + +noncomputable def m' : (n : ℕ) → ((x : ℕ → α) ×' (p n x)) + | 0 => ⟨h0.choose, h0.choose_spec⟩ + | n + 1 => by + have g := h n (m' n).1 (m' n).2 + refine ⟨Function.update (m' n).1 n g.choose, g.choose_spec⟩ + + + + + + +def join {n : ℕ} (K' : (k : ℕ) → Set α) (hK' : ∀ k, K' k ∈ L k) (K : Set α) (hK : K ∈ L (n + 1)) + (k : ℕ) : Set α := dite (k < n + 1) (fun c ↦ K' k) (fun c ↦ K) + +lemma join_of_lt_succ {n : ℕ} (K' : (k : ℕ) → (L k)) (K : L (n + 1)) {j : ℕ} (hj : j < n + 1) : + join K' K j (lt_trans hj (lt_add_one (n + 1))) = K' j := by + simp only [join, dite_eq_left_iff, not_lt] + intro h + linarith + +lemma join_of_eq_succ {n : ℕ} (K' : (k : ℕ) → (L k)) (K : L (n + 1)) : + join K' K (n + 1) (lt_add_one (n + 1)) = K := by + simp [join] + +lemma l {n : ℕ} (K' : (k : ℕ) → (L k)) (s : Set α) : + ⋂ (k : ℕ) (hk : k < n + 1), (K' k) ∩ ⋃₀ (L (n + 1)) ∩ s ⊆ + ⋃ (a : L (n + 1)), ⋂ (k : ℕ) (hk : k < n + 2), (join K' a k hk) ∩ s + := by + intro x + simp only [mem_iInter, mem_inter_iff, mem_sUnion, Finset.mem_coe, mem_iUnion, Subtype.exists] + intro h + obtain h₁ : ∀ i < n + 1, (x ∈ ((K' i) : Set α)) := by exact fun i hi ↦ (h i hi).1.1 + obtain h₂ : ∃ t ∈ (L (n + 1) : Set (Set α)), x ∈ t:= (h 0 (zero_lt_succ n)).1.2 + rcases h₂ with ⟨t, ht, j⟩ + + sorry + +example (s t : Set α) : s = t ↔ s ⊆ t ∧ t ⊆ s := by exact Subset.antisymm_iff + +lemma iUnion_join {n : ℕ} (K' : (k : ℕ) → (L k)) (s : Set α) : + ⋃ (a : L (n + 1)), ⋂ (k : ℕ) (hk : k < n + 2), (join K' a k hk) ∩ s = + ⋂ (k : ℕ) (hk : k < n + 1), (K' k) ∩ ⋃₀ (L (n + 1)) ∩ s := by + apply Subset.antisymm_iff.mpr + simp only [subset_iInter_iff, subset_inter_iff, iUnion_subset_iff, Subtype.forall] + refine ⟨fun i hi ↦ ⟨⟨?_, ?_⟩, ?_⟩, fun x hx ↦ ?_⟩ + · intro K hK + intro x hx + simp only [mem_iInter, mem_inter_iff] at * + specialize hx i (lt_trans hi <| lt_add_one (n + 1)) + rw [join_of_lt_succ K' ⟨K, hK⟩ hi] at hx + exact hx.1 + · intro K hK + intro x hx + simp only [mem_iInter, mem_inter_iff, mem_sUnion, Finset.mem_coe] at * + specialize hx (n + 1) (lt_add_one (n + 1)) + rw [join_of_eq_succ] at hx + use K + exact ⟨hK, hx.1⟩ + · intro K hK x h + simp? at h + refine (h 0 (zero_lt_succ (n + 1))).2 + · simp only [mem_iInter, mem_inter_iff, mem_sUnion, Finset.mem_coe, mem_iUnion, + Subtype.exists] at * + obtain h₁ : ∀ i < n + 1, (x ∈ ((K' i) : Set α)) := by exact fun i hi ↦ (hx i hi).1.1 + obtain h₂ := (hx 0 (zero_lt_succ n)).1.2 + obtain h₃ := (hx 0 (zero_lt_succ n)).2 + rcases h₂ with ⟨t, ht, j⟩ + use t, ht + intro i hi + by_cases g : i < n + 1 + · rw [join_of_lt_succ K' ⟨t, ht⟩ g] + exact ⟨(hx i g).1.1, (hx i g).2⟩ + · have g' : i = n + 1 := by linarith + obtain h₄ := join_of_eq_succ K' ⟨t, ht⟩ + have h₅ : (join K' ⟨t, ht⟩ i hi) = g'.symm ▸ join K' ⟨t, ht⟩ (n + 1) (lt_add_one (n + 1)) := by sorry + rw [h₅] + + rw [join_of_eq_succ K' ⟨t, ht⟩] + refine ⟨?_, h₃⟩ + + + sorry + + + + + simp only [mem_iInter, mem_inter_iff] at * + + sorry + + simp only [mem_iUnion, mem_iInter, mem_inter_iff, Subtype.exists, mem_sUnion, Finset.mem_coe] + refine ⟨fun h i hi ↦ ⟨⟨?_, ?_⟩, ?_⟩ , fun h ↦ ⟨?_, ?_, ?_⟩⟩ + · obtain ⟨K, ⟨hK, h'⟩⟩ := h + specialize h' i (lt_trans hi <| lt_add_one (n + 1)) + rw [join_of_lt_succ K' ⟨K, hK⟩ hi] at h' + exact h'.1 + · obtain ⟨K, ⟨hK, h'⟩⟩ := h + specialize h' (n + 1) (lt_add_one (n + 1)) + rw [join_of_eq_succ] at h' + use K + exact ⟨hK, h'.1⟩ + · obtain ⟨K, ⟨hK, h'⟩⟩ := h + refine (h' 0 (zero_lt_succ (n + 1))).2 + · obtain h₁ : ∀ i < n + 1, (x ∈ ((K' i) : Set α)) := by exact fun i hi ↦ (h i hi).1.1 + obtain h₂ : ∃ t ∈ (L (n + 1) : Set (Set α)), x ∈ t:= (h 0 (zero_lt_succ n)).1.2 + change ∃ t, t ∈ (L (n + 1) : Set (Set α)) ∧ x ∈ t at h₂ + rcases h₂ with ⟨t, ht, j⟩ + sorry + · sorry + · sorry From b5542b35a47853d1c4969392d0a2ee42b93b309b Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 25 Apr 2025 21:42:47 +0200 Subject: [PATCH 092/129] deleted several examples --- .../Topology/Compactness/CompactSystem.lean | 438 ++---------------- 1 file changed, 30 insertions(+), 408 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 33561cea043783..fe543464307ff7 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -304,122 +304,14 @@ end ClosedCompact section Union -example (s t : Set α) (hst : s ⊆ t) (ht : Finite t) : Finite s := by - exact Finite.Set.subset t hst - -lemma l1 (p : ℕ → Prop) (hp : ∀ n, p (n+1) → p n) (hi : Infinite (p⁻¹' {True})) (n : ℕ) : p n := by - have hp' (n : ℕ): ¬(p n) → ¬(p (n+1)) := by - exact fun a b ↦ a (hp n b) - by_contra h - have hp'' (m : ℕ) : ¬(p (n + m)) := by - induction m with - | zero => exact (add_zero n) ▸ h - | succ m hm => exact hp' (n+m) hm - rw [← not_finite_iff_infinite] at hi - apply hi - have hf : (p ⁻¹' {True}) ⊆ {k | k ≤ n} := by - intro x hx - simp only [preimage_singleton_true, mem_setOf_eq] at hx - refine mem_setOf.mpr ?_ - by_contra h - simp only [not_le] at h - have h' := hp'' (x - n) - rw [add_sub_of_le h.le] at h' - exact h' hx - apply Finite.Set.subset {k | k ≤ n} hf - --- theorem fin (p : α → Prop) (s : Set α) (hp : p ⋃₀ s) - -lemma l2 [Fintype α] (p : α → ℕ → Prop) (h : ∀ a, Finite { n | p a n }) : ∃ n, ∀ a, ¬(p a n) := by - by_contra! h₁ - have h' : Finite (⋃ a, {n | p a n}) := by - exact Finite.Set.finite_iUnion (fun (a : α) ↦ {n | p a n}) - obtain ⟨k, hk⟩ := Finite.exists_not_mem h' - obtain ⟨a, ha⟩ := h₁ k - apply hk - simp only [mem_iUnion] - use a - exact ha - -lemma l2a [Fintype α] (q : α → ℕ → Prop) (h₁ : ∀ (n : ℕ), ∃ (K : α), q K n) : - ∃ (K : α), Infinite ((q K)⁻¹' {True}) := by - by_contra! h - simp only [preimage_singleton_true, not_infinite_iff_finite] at h - have h' : Finite (⋃ K, { a | q K a }) := by - apply Finite.Set.finite_iUnion fun i ↦ {a | q i a} - have h₁' : ⋃ K, { a | q K a } = univ:= by - rw [← Set.univ_subset_iff] - intro n hn - simp only [mem_iUnion, mem_setOf_eq] - exact h₁ n - rw [h₁'] at h' - revert h' - simp only [imp_false, not_finite_iff_infinite] - exact infinite_coe_iff.mpr infinite_univ - - -lemma l3 [Fintype α] (q : α → ℕ → Prop) (h₁ : ∀ (n : ℕ), ∃ (K : α), q K n) - (h₂ : ∀ (K : α) (n : ℕ), (q K (n + 1) → q K n)) : ∃ (K : α), ∀ (n : ℕ), q K n := by - have h₃ : ∃ (K : α), Infinite ((q K)⁻¹' {True}) := l2a q h₁ - obtain ⟨K, hK⟩ := h₃ - use K - exact l1 (q K) (h₂ K) hK - -example (K : ℕ → Set α) (s : Set α) : (∀ n, (K n) ∩ s = ∅) ↔ ⋃ n, (K n) ∩ s = ∅ := by - exact Iff.symm iUnion_eq_empty - -example (K : ℕ → Set α) (s : Set α) : ⋃ n, (K n) ∩ s = (⋃ n, (K n)) ∩ s := by - exact Eq.symm (iUnion_inter s K) - -example (s t : Set α) : t ⊆ s → s ∩ t = t := by - exact inter_eq_self_of_subset_right - -example (K : ℕ → Set α) : ∀ m, ⋂ n, K n ⊆ K m := by - apply iInter_subset - -example (n : ℕ) : 0 ≤ n := by exact Nat.zero_le n - -example (K : ℕ → Set α) (n : ℕ) : ⋂ (k ≤ n), K k ⊆ K 0 := by - refine biInter_subset_of_mem (Nat.zero_le n) - -example (s : Set (Set α)) : ⋃ (x : s), x = ⋃₀ s := by - exact Eq.symm sUnion_eq_iUnion - -example (n : ℕ) (s : Set α) (K : ℕ → Set α) : - s ∩ ⋂ k, ⋂ (_ : k ≤ n + 1 ), K n ⊆ s ∩ ⋂ k, ⋂ (_ : k ≤ n), K n := by - refine inter_subset_inter_right s ?_ - apply antitone_dissipate (le_succ n) - -example (s : Set α) : s = ∅ ↔ s ⊆ ∅ := by - exact Iff.symm subset_empty_iff - -example : 0 ≤ 0 := by exact Nat.zero_le 0 - -example (s : ℕ → Set α) : ⋂ (j : Fin 0), s j = univ := by - refine iInter_eq_univ.mpr (fun ⟨i, hi⟩ ↦ ?_) - exfalso - exact not_succ_le_zero i hi - - variable {p : Set α → Prop} (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) - (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) - (hc : ∀ (n : ℕ), ⋂ (k : Fin (n + 1)), (⋃₀ (L k).toSet) ≠ ∅) + (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n : Set (Set α))), p d) -- variable (p : {n : ℕ} → ((k : Fin (n + 1)) → (β k)) → Prop) -variable [Nonempty α] - noncomputable def r (n : ℕ) (K : ℕ → Set α) : Prop := ∀ N, ⋂ (j < n), (K j) ∩ ⋂ (k < N), (⋃₀ (L (n + k)).toSet) ≠ ∅ -example (p : ℕ → Prop) : ∀ k < 0, p k := by - exact fun k hk ↦ (by cases hk) - - -lemma l5 (K : ℕ → Set α) : r L 0 K := by - simp [r] - - -- h0 -> (get_element_zero hL hc) -- (h0 : ∃ x : (ℕ → α), x 0 ∈ β 0 ∧ p 0 x) @@ -435,35 +327,12 @@ lemma nonempty (k : ℕ) (hc : ∀ N, ⋂ k < N, ⋃₀ (L k : Set (Set α)) ≠ simp only [Finset.coe_empty, sUnion_empty] exact of_eq_false (congrFun hg x) --- (h0 : ∃ x : (ℕ → α), x 0 ∈ β 0 ∧ p 0 x) --- (h0 : ∃ x : (ℕ → α), x 0 ∈ β 0 ∧ p 0 x) - - -private lemma l (n : ℕ) : (⋃₀ L 0) ∩ ⋂ (k < n), ⋃₀ L (1 + k) = ⋂ (k < n + 1), ⋃₀ (L k).toSet := by - ext x - rw [mem_inter_iff, mem_iInter₂, mem_iInter₂] - refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ - · intro i hi - by_cases h' : i = 0 - · rw [h'] - exact h.1 - · let j := i - 1 - have h₁ : j < n := Nat.sub_lt_right_of_lt_add (one_le_iff_ne_zero.mpr h') hi - have h₂ : 1 + j = i := (add_comm 1 j) ▸ succ_pred_eq_of_ne_zero h' - exact h₂ ▸ h.2 j h₁ - · refine ⟨h 0 (zero_lt_succ n), fun i hi ↦ ?_⟩ - exact (add_comm 1 i) ▸ h (i + 1) (Nat.add_lt_add_right hi 1) - -example (j m n : ℕ) (hj : j < m) : j < m + n:= by - exact Nat.lt_add_right n hj - -private lemma l6 (m n : ℕ) : (⋂ k < m, (⋃₀ L k)) ∩ ⋂ (k < n), ⋃₀ L (m + k) = +private lemma inter_sUnion_sUnion (m n : ℕ) : (⋂ k < m, (⋃₀ L k)) ∩ ⋂ (k < n), ⋃₀ L (m + k) = ⋂ (k < m + n), ⋃₀ (L k).toSet := by ext x rw [mem_inter_iff, mem_iInter₂, mem_iInter₂, mem_iInter₂] - refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ - · intro i hi - by_cases h' : i < m + refine ⟨fun h i hi ↦ ?_, fun h ↦ ?_⟩ + · by_cases h' : i < m · exact h.1 i h' · have hj : ∃ j, j < n ∧ i = m + j := by use i - m @@ -484,16 +353,38 @@ private lemma l6 (m n : ℕ) : (⋂ k < m, (⋃₀ L k)) ∩ ⋂ (k < n), ⋃₀ def q : ℕ → (ℕ → Set α) → Prop := fun n K ↦ (∀ k < n, K k ∈ L k) ∧ (r L n K) +variable [Nonempty α] + lemma get_element_zero : ∃ (K : ℕ → Set α), q L 0 K := by simp [q, r] + -- (h : ∀ (n : ℕ) (x : (ℕ → α)) (hx : p n x), ∃ y, p (n + 1) (Function.update x n y)) -- p n x ↔ (∀ k < n, K k ∈ β k) ∧ (r n K) - lemma get_element_succ' (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) (n : ℕ) (K : ℕ → Set α) (hK : q L n K) : ∃ y, q L (n + 1) (Function.update K n y) := by + simp_rw [q, r] at hK ⊢ + by_contra! h + choose b hb using h + have hn (a : Set α) (ha : a ∈ L n) : (∀ k < n + 1, Function.update K n a k ∈ L k) := by + sorry + classical + let b' : Set α → ℕ := fun y ↦ dite (y ∈ L n) (fun h ↦ b y (hn y h)) (fun _ ↦ 0) + have hc : ∀ N, ⋂ k < N, ⋃₀ (L k : Set (Set α)) ≠ ∅ := by sorry + obtain ⟨K0Max, ⟨hK0₁, hK0₂⟩⟩ := Finset.exists_max_image (L n) b' (nonempty L n hc) + apply hc (b' K0Max + 1 + 1) + + have h' : ∀ a ∈ L n, ⋂ (k < n), ⋃₀ ↑(L k) ∩ a ∩ ⋂ (k < b' K0Max + 1), ⋃₀ ↑(L (n + k)) = ∅ := by + sorry + + + + + + + sorry noncomputable def m' : (n : ℕ) → ((K : ℕ → Set α) ×' (q L n K)) @@ -507,15 +398,15 @@ noncomputable def m' : (n : ℕ) → ((K : ℕ → Set α) ×' (q L n K)) lemma get_element_zero' (hL : ∀ n d (hd : d ∈ (L n : Set (Set α))), p d) (hc : ∀ N, ⋂ k < N, ⋃₀ ((L k) : Set (Set α)) ≠ ∅) : - ∃ (K : ℕ → Set α) (hK : ∀ k < 1, K k ∈ L k), r 1 K := by + ∃ (K : ℕ → Set α) (hK : ∀ k < 1, K k ∈ L k), r L 1 K := by have hKfun {K : Set α} (hK' : K ∈ L 0) (k : ℕ) (hk : k < 1) : (fun _ ↦ K) k ∈ L k := (lt_one_iff.mp hk) ▸ hK' simp_rw [r] - have d : ∃ (K : Set α) (hK' : K ∈ L 0), r 1 (fun _ ↦ K) (hKfun hK') := by + have d : ∃ (K : Set α) (hK' : K ∈ L 0), r L 1 (fun _ ↦ K) := by simp_rw [r] by_contra! h choose! b ha using h - obtain ⟨K0Max, ⟨hK0₁, hK0₂⟩⟩ := Finset.exists_max_image (L 0) b (nonempty 0 hc) + obtain ⟨K0Max, ⟨hK0₁, hK0₂⟩⟩ := Finset.exists_max_image (L 0) b (nonempty L 0 hc) apply hc (b K0Max + 1 + 1) -- refine Set.iInter_eq_empty_iff.mpr fun x ↦ ?_ have h' : ∀ a ∈ L 0, a ∩ ⋂ k < 1, ⋂ (k < b K0Max + 1), ⋃₀ ↑(L (1 + k)) = ∅ := by @@ -546,116 +437,6 @@ lemma get_element_zero' (hL : ∀ n d (hd : d ∈ (L n : Set (Set α))), p d) refine ⟨fun _ ↦ K, hKfun hK₁, hK₂⟩ -lemma element_0_has_r (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) - (hc : ∀ (N : ℕ), ⋂ (k : Fin (N + 1)), (⋃₀ (L k).toSet) ≠ ∅) (K : (k : Fin 1) → (L k)) - (hK : K = (get_element_zero hL hc).choose) : r K := by - exact hK ▸ (get_element_zero hL hc).choose_spec - -example (n : ℕ) : n < n.succ := by exact lt_add_one n - - -def join {n : ℕ} (K' : (k : ℕ) → (L k)) (K : L (n + 1)) {k : ℕ} (hk : k < n + 2) : - (L k) := by - let K'' (k : ℕ) (hk₁ : k < n + 2) (hk₂ : ¬ k < n + 1) : L k := by - have h : k = n + 1 := by linarith - exact h ▸ K - exact dite (k < n + 1) (fun c ↦ K' k) (fun c ↦ K'' k hk c) - -lemma join_of_lt_succ {n : ℕ} (K' : (k : ℕ) → (L k)) (K : L (n + 1)) {j : ℕ} (hj : j < n + 1) : - join K' K (lt_trans hj (lt_add_one (n + 1))) = K' j := by - simp only [join, dite_eq_left_iff, not_lt] - intro h - linarith - -lemma join_of_eq_succ {n : ℕ} (K' : (k : ℕ) → (L k)) (K : L (n + 1)) : - join K' K (lt_add_one (n + 1)) = K := by - simp [join] - -example (K : ℕ → Set α) (s : Set α) : ⋂ k, (K k) ∩ s = (⋂ k, (K k)) ∩ s := by - exact Eq.symm (iInter_inter s K) -example (n : ℕ) : 0 < n + 1 := by exact zero_lt_succ n - -example (x : α) (n : ℕ) (s : ℕ → Finset (Set α)) (u : (n : ℕ) → (s n)) (hs : ∀ i < n + 1, (x ∈ ((u i) : Set α) ∧ ∃ t ∈ s n, x ∈ t)) : - ∃ t ∈ s (n + 1), x ∈ t := by - obtain h₂ := (hs 0 (zero_lt_succ n)).2 - rcases h₂ with ⟨t, ht, h⟩ - use t, ht, h - -lemma iUnion_join {n : ℕ} (K' : (k : ℕ) → (L k)) (s : Set α) : - ⋃ (a : L (n + 1)), ⋂ (k : ℕ) (hk : k < n + 2), (join K' a hk) ∩ s = - ⋂ (k : ℕ) (hk : k < n + 1), (K' k) ∩ ⋃₀ (L (n + 1)) ∩ s := by - ext x - simp only [mem_iUnion, mem_iInter, mem_inter_iff, Subtype.exists, mem_sUnion, Finset.mem_coe] - refine ⟨fun h i hi ↦ ⟨⟨?_, ?_⟩, ?_⟩ , fun h ↦ ⟨?_, ?_, ?_⟩⟩ - · obtain ⟨K, ⟨hK, h'⟩⟩ := h - specialize h' i (lt_trans hi <| lt_add_one (n + 1)) - rw [join_of_lt_succ K' ⟨K, hK⟩ hi] at h' - exact h'.1 - · obtain ⟨K, ⟨hK, h'⟩⟩ := h - specialize h' (n + 1) (lt_add_one (n + 1)) - rw [join_of_eq_succ] at h' - use K - exact ⟨hK, h'.1⟩ - · obtain ⟨K, ⟨hK, h'⟩⟩ := h - refine (h' 0 (zero_lt_succ (n + 1))).2 - · obtain h₁ : ∀ i < n + 1, (x ∈ ((K' i) : Set α)) := by exact fun i hi ↦ (h i hi).1.1 - obtain h₂ : ∃ t ∈ (L (n + 1) : Set (Set α)), x ∈ t:= (h 0 (zero_lt_succ n)).1.2 - rcases h₂ with ⟨t, ht, j⟩ - sorry - · sorry - · sorry - -example (s : ℕ → (Set α)) (b : Set α) : ⋂ k, (s k) ∩ b = (⋂ k, (s k)) ∩ b := by - exact Eq.symm (iInter_inter b s) - -example (s : ℕ → Set α) : (∀ n, s n = ∅) ↔ (⋃ n, s n = ∅) := by - exact iUnion_eq_empty.symm - -example {s t u : Set α} (htu : t = u) : t ∩ s = u ∩ s := by - exact congrFun (congrArg Inter.inter htu) s - -example (i : ℕ) (hi : i ≠ 0) : ∃ j, i = j + 1 := by - exact exists_eq_succ_of_ne_zero hi - -example (i : ℕ) : (¬i = 0) ↔ i ≠ 0 := by - exact Eq.to_iff rfl - - -private lemma l4 {n : ℕ} (L : Fin (n + 1) → Set (Set α)) : ⋂ (k : Fin (n + 1)), ⋃₀ (L k) = - ⋃₀ (L 0) ∩ ⋂ (k : Fin n), ⋃₀ (L ((k + 1) : Fin (n + 1))) := by - refine Eq.symm (ext fun x ↦ ⟨fun h ↦ ?_, fun h ↦ ?_⟩) <;> - simp only [mem_inter_iff, mem_sUnion, mem_iInter] at h ⊢ - · intro i - by_cases g : i = 0 - · obtain ⟨t, ht⟩ := h.1 - use t - exact g.symm ▸ ht - · have h' : ∃ (j : ℕ), j < n ∧ i = j + 1 := by - have g' : i.val ≠ 0 := by - exact Fin.val_ne_zero_iff.mpr g - obtain ⟨j, hj⟩ := exists_eq_succ_of_ne_zero g' - use j - refine ⟨?_, ?_⟩ - · sorry - · simp [hj] - - - - - sorry - obtain ⟨j, ⟨hj1, hj2⟩⟩ := h' - obtain ⟨t, ⟨ht1, ht2⟩⟩ := h.2 ⟨j, hj1⟩ - use t - simp only at ht1 - rw [← hj2] at ht1 - exact ⟨ht1, ht2⟩ - · sorry - --- h : ∀ (n : ℕ) (x : (ℕ → α)) (hx : x n ∈ β n ∧ p n x), ∃ y ∈ β (n + 1), p (n + 1) (Function.update x (n + 1) y) - -lemma get_element_succ' (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) (n : ℕ) (K : ℕ → Set α) (hK : K n ∈ L n ∧ r n K) : ∃ K' ∈ L (n + 1), r (n + 1) (Function.update K (n + 1) K') := by - sorry - lemma get_element_succ (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) (hc : ∀ (n : ℕ), ⋂ (k : Fin (n + 1)), (⋃₀ (L k).toSet) ≠ ∅) : ∀ @@ -697,174 +478,15 @@ lemma get_element_succ (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet) exact ht1 -noncomputable def main : (n : ℕ) → ((K' : (k : Fin (n + 1)) → (L k)) ×' (r K')) - | 0 => ⟨(get_element_zero hL hc).choose, (get_element_zero hL hc).choose_spec⟩ - | n + 1 => by - let g := ((get_element_succ hL hc) n (main n).1 (main n).2) - exact ⟨join (main n).1 g.choose, g.choose_spec⟩ - -noncomputable def main' : (j : ℕ) → (L j) := by - have hj (j : ℕ) : j = ((j : Fin (j + 1)) : ℕ) := by - simp only [Fin.natCast_eq_last, Fin.val_last] - exact fun j ↦ (hj j).symm ▸ (main hL hc j).1 j - -lemma has_r (n : ℕ) : r (main hL hc n).1 := by - exact (main hL hc n).2 - -lemma has_r' (n : ℕ) : r (main' hL hc n).1 := by - exact (main hL hc n).2 - - theorem main' (p : Set α → Prop) (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) (hc : ∀ (n : ℕ), ⋂ (k : Fin (n + 1)), (⋃₀ (L k).toSet) ≠ ∅) : ∃ (K : (j : ℕ) → (L j)), (∀ n N, ⋂ (j : Fin (n + 1)), (K j) ∩ ⋂ (k < N), ⋃₀ (L (n + 1 + k)).toSet ≠ ∅) := by - use (main' hL hc n).1 - - exact has_r hL hc - sorry - -def ack : Nat → Nat → Nat - | 0, n => n + 1 - | m + 1, 0 => ack m 1 - | m + 1, n + 1 => ack m (ack (m + 1) n) - - -def myMax (a b : Nat) : Nat := - if a < b then myMax b a else a - - - - - - - - - - have hq (K : (L 0)) (n : ℕ) : q K n := by - specialize hc 0 - simp? at hc - sorry - have h'' (K : L 0) := Finite.exists_infinite_fiber (fun n ↦ q K n) - have h''' : ∃ (K : L 0), Infinite ((fun n ↦ q K n) ⁻¹' {True}) := by - by_contra! h - simp only [preimage_singleton_true, coe_setOf, not_infinite_iff_finite, Subtype.forall] at h - - - - -- apply hc 0 - simp only [nonpos_iff_eq_zero, iInter_iInter_eq_left, sUnion_eq_empty, Finset.mem_coe] - - sorry - - have h : ∃ (K : L 0), ∀ n, q K n:= by - by_contra h' - push_neg at h' - - sorry - - simp_rw [q] at h' - -- Finite.exists_infinite_fiber - sorry - sorry -theorem main (p : Set α → Prop) (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) - (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) - (hc : ∀ (n : ℕ), ⋂ (k ≤ n), (⋃₀ (L k).toSet) ≠ ∅) : - ∃ (K : (n : ℕ) → (L n)), (∀ N k, ⋂ (j : ℕ) (hj : j ≤ N), (K j) ∩ ⋂ (j ≤ k), - ⋃₀ (L (N + j + 1)).toSet ≠ ∅) := by - -- `q K n` is true, if `K ∩ ⋂ (k ≤ n), ⋃₀ (L k) ≠ ∅` - let q : (L 0) → ℕ → Prop := fun (K : (L 0)) n ↦ (K : Set α) ∩ ⋂ (k ≤ n), (⋃₀ (L k).toSet) ≠ ∅ - - have hq (n : ℕ) : ∃ (K : (L 0)), q K n := by - by_contra! h - push_neg at h - rw [← iUnion_eq_empty] at h - have f : ⋃ (i : { x // x ∈ L 0 }), ↑i ∩ ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ ↑(L k) = (⋃ (i : { x // x ∈ L 0 }), ↑i) ∩ ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ (L k).toSet := by - rw [iUnion_inter] - rw [f] at h - have g : (⋃ (i : { x // x ∈ L 0 }), ↑i) ∩ ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ (L k).toSet = ⋂ k, ⋂ (_ : k ≤ n), ⋃₀ (L k).toSet := by - apply inter_eq_self_of_subset_right - have f : ⋃ (i : { x // x ∈ (L 0) }), ↑i = ⋃₀ (L 0).toSet := by - rw [biUnion_eq_iUnion] - simp only [Finset.coe_sort_coe] - sorry - rw [f] - refine biInter_subset_of_mem (Nat.zero_le n) - rw [g] at h - apply (hc n) h - - - sorry - - - sorry - have h'' (K : L 0) := Finite.exists_infinite_fiber (fun n ↦ q K n) - have h''' : ∃ (K : L 0), Infinite ((fun n ↦ q K n) ⁻¹' {True}) := by - by_contra! h - simp only [preimage_singleton_true, coe_setOf, not_infinite_iff_finite, Subtype.forall] at h - - - - - let q' : (n : ℕ) → ((j : ℕ) → (hj : j ≤ n) → (L j)) → ℕ → Prop := - fun n K N ↦ ⋂ (j : ℕ) (hj : j ≤ n), (K j hj : Set α) ∩ ⋂ (k ≤ N), (⋃₀ (L (n + k + 1)).toSet) ≠ ∅ - have hq'' : q' = fun n K N ↦ ⋂ (j : ℕ) (hj : j ≤ n), (K j hj : Set α) ∩ ⋂ (k ≤ N), - (⋃₀ (L (n + k + 1)).toSet) ≠ ∅ := by - rfl - have hq' (n : ℕ) (K : ((j : ℕ) → (hj : j ≤ n) → (L j))) (N : ℕ) : (q' n K N) ↔ - (⋂ (j : ℕ) (hj : j ≤ n), (K j hj : Set α) ∩ ⋂ (k ≤ N), (⋃₀ (L (n + k + 1)).toSet) ≠ ∅) := by - rfl - simp_rw [← hq'] - - have h₀ (n : ℕ) : ∃ (K : ((j : ℕ) → (hj : j ≤ n) → (L j))), ∀ N, q' N (fun j hj ↦ K j) k := by sorry - - - sorry - - - - sorry - - rfl - - - - have hq (K : (L 0)) (n : ℕ) : q K n := by - specialize hc 0 - simp? at hc - sorry - have h'' (K : L 0) := Finite.exists_infinite_fiber (fun n ↦ q K n) - have h''' : ∃ (K : L 0), Infinite ((fun n ↦ q K n) ⁻¹' {True}) := by - by_contra! h - simp only [preimage_singleton_true, coe_setOf, not_infinite_iff_finite, Subtype.forall] at h - - - - -- apply hc 0 - simp only [nonpos_iff_eq_zero, iInter_iInter_eq_left, sUnion_eq_empty, Finset.mem_coe] - - sorry - - have h : ∃ (K : L 0), ∀ n, q K n:= by - by_contra h' - push_neg at h' - - sorry - - simp_rw [q] at h' - -- Finite.exists_infinite_fiber - sorry - sorry - -open Classical in -example (x : α) (H : Finset (Set α)) : x ∉ ⋃₀ ↑H ↔ ∀ h ∈ H, x ∉ h := by - simp only [mem_sUnion, Finset.mem_coe, not_exists, not_and] - theorem union (h : IsCompactSystem p) : IsCompactSystem (fun s ↦ ∃ (D : Finset (Set (α))), (∀ d ∈ D, p d) ∧ s = ⋃₀ (D : Set (Set α))) := by intro q hq h_empty From 5690c9ac82a83cbf3662429f4d0aa73625c4ee1c Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sat, 26 Apr 2025 00:37:33 +0200 Subject: [PATCH 093/129] almost... --- .../Topology/Compactness/CompactSystem.lean | 104 ++++++++++++++++-- 1 file changed, 95 insertions(+), 9 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index fe543464307ff7..4cbbdb642c4652 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -310,11 +310,19 @@ variable {p : Set α → Prop} (hp : IsCompactSystem p) (L : ℕ → Finset (Set -- variable (p : {n : ℕ} → ((k : Fin (n + 1)) → (β k)) → Prop) noncomputable def r (n : ℕ) (K : ℕ → Set α) : Prop := - ∀ N, ⋂ (j < n), (K j) ∩ ⋂ (k < N), (⋃₀ (L (n + k)).toSet) ≠ ∅ + ∀ N, (⋂ (j < n), (K j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ -- h0 -> (get_element_zero hL hc) -- (h0 : ∃ x : (ℕ → α), x 0 ∈ β 0 ∧ p 0 x) +lemma nonempty' (n : ℕ) (K : ℕ → Set α) + (hc : ∀ N, (⋂ (k < n), K k) ∩ (⋂ k < N, ⋃₀ (L (n + k))) ≠ ∅) : (L n).Nonempty := by + specialize hc 1 + by_contra! h + simp only [Finset.not_nonempty_iff_eq_empty] at h + apply hc + simp [h] + lemma nonempty (k : ℕ) (hc : ∀ N, ⋂ k < N, ⋃₀ (L k : Set (Set α)) ≠ ∅) : (L k).Nonempty := by specialize hc (k + 1) by_contra! h @@ -353,31 +361,109 @@ private lemma inter_sUnion_sUnion (m n : ℕ) : (⋂ k < m, (⋃₀ L k)) ∩ def q : ℕ → (ℕ → Set α) → Prop := fun n K ↦ (∀ k < n, K k ∈ L k) ∧ (r L n K) +lemma get_element_zero (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : + ∃ (K : ℕ → Set α), q L 0 K := by + simp [q, r, h] + variable [Nonempty α] -lemma get_element_zero : ∃ (K : ℕ → Set α), q L 0 K := by - simp [q, r] -- (h : ∀ (n : ℕ) (x : (ℕ → α)) (hx : p n x), ∃ y, p (n + 1) (Function.update x n y)) -- p n x ↔ (∀ k < n, K k ∈ β k) ∧ (r n K) +example (n : ℕ) (s : Set α) (K : ℕ → Set α): (⋂ j < n, K j) ∩ s = ⋂ j < n, K j ∩ s := by + refine Eq.symm (biInter_inter ?_ K s) + sorry + +example (k n : ℕ) (h : k < n + 1) (h' : k ≠ n) : k < n := by + by_contra h'' + simp at h'' + apply h' + exact Nat.eq_of_le_of_lt_succ h'' h + +example (a b s : Set α) (h : a = b) : a ∩ s = b ∩ s := by + exact congrFun (congrArg Inter.inter h) s + +example (s t : Set α) (L : Set (Set α)): (∀ y ∈ L, s ∩ y = ∅) → s ∩ ⋃₀ L = ∅ := by + refine fun a ↦ ?_ + refine Disjoint.inter_eq ?_ + refine disjoint_sUnion_right.mpr ?_ + simp_rw [Disjoint] + sorry + lemma get_element_succ' (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) (n : ℕ) (K : ℕ → Set α) (hK : q L n K) : ∃ y, q L (n + 1) (Function.update K n y) := by simp_rw [q, r] at hK ⊢ by_contra! h choose b hb using h - have hn (a : Set α) (ha : a ∈ L n) : (∀ k < n + 1, Function.update K n a k ∈ L k) := by - sorry + have hn : ∀ y ∈ L n, ∀ k < n + 1, Function.update K n y k ∈ L k := by + intro y hy k hk + by_cases d : n = k + · rw [d] + simp only [Function.update_self] + exact d ▸ hy + · have d' : k < n := by + by_contra h + apply d + simp only [not_lt] at h + apply Eq.symm + exact Nat.eq_of_le_of_lt_succ h hk + simp only [ne_eq, d'.ne, not_false_eq_true, Function.update_of_ne] + exact hK.1 k d' classical let b' : Set α → ℕ := fun y ↦ dite (y ∈ L n) (fun h ↦ b y (hn y h)) (fun _ ↦ 0) - have hc : ∀ N, ⋂ k < N, ⋃₀ (L k : Set (Set α)) ≠ ∅ := by sorry - obtain ⟨K0Max, ⟨hK0₁, hK0₂⟩⟩ := Finset.exists_max_image (L n) b' (nonempty L n hc) - apply hc (b' K0Max + 1 + 1) + obtain ⟨K0Max, ⟨hK0₁, hK0₂⟩⟩ := Finset.exists_max_image (L n) b' (nonempty' L n K hK.2) + apply hK.2 (b' K0Max + 1) + have hb' := fun y hy ↦ hb y (hn y hy) + have h₁ (y s : Set α): (⋂ j, ⋂ (_ : j < n + 1), Function.update K n y j) ∩ s = (⋂ j, ⋂ (_ : j < n), K j) ∩ y ∩ s := by + apply congrFun (congrArg Inter.inter _) s + ext x + refine ⟨fun h ↦ ⟨?_, ?_⟩, fun h ↦ ?_⟩ <;> simp only [mem_iInter, mem_inter_iff] at h ⊢ + · intro i hi + have h' := h i (le_trans hi (le_succ n)) + simp only [ne_eq, hi.ne, not_false_eq_true, Function.update_of_ne] at h' + exact h' + · have h'' := h n (lt_add_one n) + simp only [Function.update_self] at h'' + exact h'' + · intro i hi + by_cases h₁ : i < n + · simp only [ne_eq, h₁.ne, not_false_eq_true, Function.update_of_ne] + exact h.1 i h₁ + · simp only [not_lt] at h₁ + have h₂ := Nat.eq_of_le_of_lt_succ h₁ hi + rw [h₂] + simp only [Function.update_self] + exact h.2 + simp_rw [h₁] at hb' - have h' : ∀ a ∈ L n, ⋂ (k < n), ⋃₀ ↑(L k) ∩ a ∩ ⋂ (k < b' K0Max + 1), ⋃₀ ↑(L (n + k)) = ∅ := by + + + rw [eq_empty_iff_forall_not_mem] + intro x + simp only [mem_inter_iff, mem_iInter] + + + push_neg + + + have g : (⋂ j < n, K j) ∩ ⋂ k < b' K0Max + 1, ⋃₀ ↑(L (n + k)) = + ⋂ j < n, ( K j ∩ ⋂ k < b' K0Max + 1, ⋃₀ ↑(L (n + k))) := by + refine Eq.symm (biInter_inter ?_ K _) sorry + rw [g] + + rw [iInter_inter] + + + have h' : ∀ a ∈ L n, (⋂ (k < n), K k ∩ a) ∩ (⋂ (k < b' K0Max + 1), ⋃₀ ↑(L (n + k))) = ∅ := by + sorry + + + simp_rw [← iUnion_eq_empty] at h' + From f8ab9c3b44ba42dfe35090cd2a27ede030c2cc3f Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sun, 27 Apr 2025 07:38:37 +0200 Subject: [PATCH 094/129] main works --- .../Topology/Compactness/CompactSystem.lean | 230 ++++++------------ 1 file changed, 74 insertions(+), 156 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 4cbbdb642c4652..9345029b7f4860 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -304,6 +304,26 @@ end ClosedCompact section Union +example (L : ℕ → Set α) (h : ∀ n, L n = ∅) : ⋃ n, L n = ∅ := by exact iUnion_eq_empty.mpr h + +example (a s t : Set α) (hst : s ⊆ t) : a ∩ s ⊆ a ∩ t := by + exact inter_subset_inter (fun ⦃a_1⦄ a ↦ a) hst + +lemma l2 {ι : Type*} (s t : Set α) (u : Set ι) (L : (i : ι) → (hi : i ∈ u) → Set α) + (h : s ⊆ ⋃ (n : ι) (hn : n ∈ u), L n hn) (h' : ∀ (n : ι) (hn : n ∈ u), t ∩ (L n hn) = ∅) : + t ∩ s = ∅ := by + have j : ⋃ (n : ι) (hn : n ∈ u), t ∩ (L n hn) = ∅ := by + simp_rw [iUnion_eq_empty] + exact h' + simp_rw [← subset_empty_iff] at h' j ⊢ + have j' : ⋃ (n : u), t ∩ L n.val n.prop = ⋃ n, ⋃ (hn : n ∈ u), t ∩ L n hn := by + exact iUnion_coe_set u fun i ↦ t ∩ L (↑i) (Subtype.prop i) + rw [← j', ← inter_iUnion, iUnion_coe_set] at j + have gf := inter_subset_inter (t₁ := t) (fun ⦃a_1⦄ a ↦ a) h + apply le_trans gf j + + + variable {p : Set α → Prop} (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n : Set (Set α))), p d) @@ -365,34 +385,6 @@ lemma get_element_zero (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ∃ (K : ℕ → Set α), q L 0 K := by simp [q, r, h] -variable [Nonempty α] - - - --- (h : ∀ (n : ℕ) (x : (ℕ → α)) (hx : p n x), ∃ y, p (n + 1) (Function.update x n y)) - --- p n x ↔ (∀ k < n, K k ∈ β k) ∧ (r n K) -example (n : ℕ) (s : Set α) (K : ℕ → Set α): (⋂ j < n, K j) ∩ s = ⋂ j < n, K j ∩ s := by - refine Eq.symm (biInter_inter ?_ K s) - sorry - -example (k n : ℕ) (h : k < n + 1) (h' : k ≠ n) : k < n := by - by_contra h'' - simp at h'' - apply h' - exact Nat.eq_of_le_of_lt_succ h'' h - -example (a b s : Set α) (h : a = b) : a ∩ s = b ∩ s := by - exact congrFun (congrArg Inter.inter h) s - -example (s t : Set α) (L : Set (Set α)): (∀ y ∈ L, s ∩ y = ∅) → s ∩ ⋃₀ L = ∅ := by - refine fun a ↦ ?_ - refine Disjoint.inter_eq ?_ - refine disjoint_sUnion_right.mpr ?_ - simp_rw [Disjoint] - sorry - - lemma get_element_succ' (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) (n : ℕ) (K : ℕ → Set α) (hK : q L n K) : ∃ y, q L (n + 1) (Function.update K n y) := by simp_rw [q, r] at hK ⊢ @@ -413,11 +405,14 @@ lemma get_element_succ' (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet simp only [ne_eq, d'.ne, not_false_eq_true, Function.update_of_ne] exact hK.1 k d' classical - let b' : Set α → ℕ := fun y ↦ dite (y ∈ L n) (fun h ↦ b y (hn y h)) (fun _ ↦ 0) + let b' := fun y ↦ dite (y ∈ L n) (fun hy ↦ (b y (hn y hy))) (fun _ ↦ 0) + have hb' := fun y hy ↦ hb y (hn y hy) + have hb'' (y : Set α) (hy : y ∈ L n) : b y (hn y hy) = b' y := by + simp [b', hy] obtain ⟨K0Max, ⟨hK0₁, hK0₂⟩⟩ := Finset.exists_max_image (L n) b' (nonempty' L n K hK.2) apply hK.2 (b' K0Max + 1) - have hb' := fun y hy ↦ hb y (hn y hy) - have h₁ (y s : Set α): (⋂ j, ⋂ (_ : j < n + 1), Function.update K n y j) ∩ s = (⋂ j, ⋂ (_ : j < n), K j) ∩ y ∩ s := by + have h₁ (y s : Set α): (⋂ j, ⋂ (_ : j < n + 1), Function.update K n y j) ∩ s = + (⋂ j, ⋂ (_ : j < n), K j) ∩ y ∩ s := by apply congrFun (congrArg Inter.inter _) s ext x refine ⟨fun h ↦ ⟨?_, ?_⟩, fun h ↦ ?_⟩ <;> simp only [mem_iInter, mem_inter_iff] at h ⊢ @@ -439,129 +434,40 @@ lemma get_element_succ' (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet exact h.2 simp_rw [h₁] at hb' + have h₂ : ⋂ k < b' K0Max + 1, ⋃₀ (L (n + k)).toSet ⊆ + ⋃ (y : Set α) (hy : y ∈ L n), y ∩ ⋂ (k < b y (hn y hy)), ⋃₀ (L (n + 1 + k)).toSet := by + obtain ⟨y, hy⟩ := nonempty' L n K hK.2 + intro x hx + simp only [mem_iInter, mem_sUnion, Finset.mem_coe, mem_iUnion, mem_inter_iff, + exists_and_left] at hx ⊢ + obtain ⟨i, hi⟩ := hx 0 (zero_lt_succ (b' K0Max)) + rw [add_zero] at hi + use i, hi.2, hi.1 + intro k hk + have hk' : 1 + k < b' K0Max + 1:= by + rw [add_comm] + simp only [add_lt_add_iff_right] + apply lt_of_lt_of_le hk + rw [hb''] + apply hK0₂ i hi.1 + exact hi.1 + obtain ⟨t, ht⟩ := hx (1 + k) hk' + rw [← add_assoc] at ht + use t, ht.1, ht.2 + simp_rw [inter_assoc] at hb' + apply l2 (s := ⋂ k < b' K0Max + 1, ⋃₀ (L (n + k)).toSet) (t := (⋂ j < n, K j)) (u := L n) + (L := fun (y : Set α) (hy : y ∈ L n) ↦ (y ∩ ⋂ k, ⋂ (hk : k < b y (hn y hy)), + ⋃₀ (L (n + 1 + k)).toSet)) h₂ hb' + +noncomputable def m' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : + (n : ℕ) → ((K : ℕ → Set α) ×' (q L n K)) + | 0 => ⟨(get_element_zero L h).choose, (get_element_zero L h).choose_spec⟩ + | n + 1 => by + have g := (get_element_succ' L hL) n (m' h n).1 (m' h n).2 + exact ⟨Function.update (m' h n).1 n g.choose, g.choose_spec⟩ - rw [eq_empty_iff_forall_not_mem] - intro x - simp only [mem_inter_iff, mem_iInter] - - - push_neg - - - have g : (⋂ j < n, K j) ∩ ⋂ k < b' K0Max + 1, ⋃₀ ↑(L (n + k)) = - ⋂ j < n, ( K j ∩ ⋂ k < b' K0Max + 1, ⋃₀ ↑(L (n + k))) := by - refine Eq.symm (biInter_inter ?_ K _) - sorry - rw [g] - - rw [iInter_inter] - - - have h' : ∀ a ∈ L n, (⋂ (k < n), K k ∩ a) ∩ (⋂ (k < b' K0Max + 1), ⋃₀ ↑(L (n + k))) = ∅ := by - sorry - - - simp_rw [← iUnion_eq_empty] at h' - - - - - - - - - sorry -noncomputable def m' : (n : ℕ) → ((K : ℕ → Set α) ×' (q L n K)) - | 0 => ⟨(get_element_zero L).choose, (get_element_zero L).choose_spec⟩ - | n + 1 => by - have g := (get_element_succ' L hL) n (m' n).1 (m' n).2 - refine ⟨Function.update (m' n).1 n g.choose, g.choose_spec⟩ - - - - -lemma get_element_zero' (hL : ∀ n d (hd : d ∈ (L n : Set (Set α))), p d) - (hc : ∀ N, ⋂ k < N, ⋃₀ ((L k) : Set (Set α)) ≠ ∅) : - ∃ (K : ℕ → Set α) (hK : ∀ k < 1, K k ∈ L k), r L 1 K := by - have hKfun {K : Set α} (hK' : K ∈ L 0) (k : ℕ) (hk : k < 1) : (fun _ ↦ K) k ∈ L k := - (lt_one_iff.mp hk) ▸ hK' - simp_rw [r] - have d : ∃ (K : Set α) (hK' : K ∈ L 0), r L 1 (fun _ ↦ K) := by - simp_rw [r] - by_contra! h - choose! b ha using h - obtain ⟨K0Max, ⟨hK0₁, hK0₂⟩⟩ := Finset.exists_max_image (L 0) b (nonempty L 0 hc) - apply hc (b K0Max + 1 + 1) - -- refine Set.iInter_eq_empty_iff.mpr fun x ↦ ?_ - have h' : ∀ a ∈ L 0, a ∩ ⋂ k < 1, ⋂ (k < b K0Max + 1), ⋃₀ ↑(L (1 + k)) = ∅ := by - intro a' h' - have f := (ha a' h') - simp only [lt_one_iff, iInter_iInter_eq_left] at f - refine subset_eq_empty (inter_subset_inter (fun ⦃a⦄ a ↦ a) (iInter_mono' (fun j ↦ ?_))) f - use 0 - intro k - simp only [lt_one_iff, pos_of_gt, iInter_true, mem_iInter, mem_sUnion, Finset.mem_coe] - intro hk hj - exact hk j (le_trans hj (le_trans (hK0₂ a' h') (le_succ (b K0Max)))) - simp only [lt_one_iff, iInter_iInter_eq_left] at h' - have h'' : ∀ (a : L 0), a.val ∩ ⋂ k, ⋂ (_ : k < b K0Max + 1), ⋃₀ (L (1 + k) : Set (Set α)) = ∅ := by - rw [Subtype.forall] - simp only - exact h' - rw [← iUnion_eq_empty] at h'' - have h''' : (⋃ a : L 0, a.val) ∩ (⋂ k, ⋂ (_ : k < b K0Max + 1), ⋃₀ (L (1 + k) : Set (Set α))) = ∅ := by - rw [iUnion_inter] - exact h'' - have h'''': ⋃₀ L 0 ∩ ⋂ k, ⋂ (_ : k < b K0Max + 1), ⋃₀ (L (1 + k) : Set (Set α)) = ∅ := by - rw [sUnion_eq_iUnion] - exact h''' - rw [l] at h'''' - exact h'''' - obtain ⟨K, ⟨hK₁, hK₂⟩⟩ := d - refine ⟨fun _ ↦ K, hKfun hK₁, hK₂⟩ - - - -lemma get_element_succ (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) - (hc : ∀ (n : ℕ), ⋂ (k : Fin (n + 1)), (⋃₀ (L k).toSet) ≠ ∅) : ∀ - (n : ℕ) (K' : (k : Fin (n + 1)) → (L k)), r K' → - ∃ (K : (L (n + 1))), r (join K' K) := by - intro n K' hK' - simp only [r, ne_eq, Subtype.exists] - by_contra! h - choose! b ha using h - classical - obtain ⟨aMax, ⟨ha1, ha2⟩⟩ := Finset.exists_max_image (L (n + 1)) b (nonempty (n + 1) hc) - have h' : ∀ (a : L (n + 1)), ⋂ k, ↑(join K' a k) ∩ - ⋂ (k : Fin (b aMax)), ⋃₀ (L (n + 1 + 1 + ↑k) : Set (Set α)) = ∅ := by - intro a' - refine subset_eq_empty ?_ (ha a'.val a'.prop) - rw [← iInter_inter, ← iInter_inter] - apply (inter_subset_inter (fun ⦃a⦄ a ↦ a) (iInter_mono' (fun j ↦ ?_))) - use ⟨j.val, le_trans j.prop (ha2 a'.val a'.prop)⟩ - simp only [r] at hK' - apply hK' (b aMax + 1) - rw [← iUnion_eq_empty] at h' - rw [iUnion_join] at h' - rw [← h'] - refine iInter_congr fun i ↦ ?_ - rw [inter_assoc] - refine congrArg (Inter.inter _) ?_ - rw [l4] - simp only [Fin.val_zero, add_zero, Fin.coe_eq_castSucc] - apply congrArg (Inter.inter _) - refine iInter_congr fun i ↦ ?_ - ext x - simp only [Fin.coeSucc_eq_succ, Fin.val_succ, mem_sUnion, Finset.mem_coe] - refine ⟨fun ⟨t, ⟨ht1, ht2⟩⟩ ↦ ⟨t, ⟨?_, ht2⟩⟩, fun ⟨t, ⟨ht1, ht2⟩⟩ ↦ ⟨t, ⟨?_, ht2⟩⟩⟩ - · rw [add_assoc] - nth_rewrite 3 [add_comm] - exact ht1 - · rw [add_assoc] at ht1 - nth_rewrite 3 [add_comm] at ht1 - exact ht1 @@ -572,19 +478,31 @@ theorem main' (p : Set α → Prop) (hp : IsCompactSystem p) (L : ℕ → Finset ⋃₀ (L (n + 1 + k)).toSet ≠ ∅) := by sorry +example (s : Set α) : s ≠ ∅ ↔ s.Nonempty := by + exact Iff.symm nonempty_iff_ne_empty theorem union (h : IsCompactSystem p) : IsCompactSystem (fun s ↦ ∃ (D : Finset (Set (α))), (∀ d ∈ D, p d) ∧ s = ⋃₀ (D : Set (Set α))) := by intro q hq h_empty simp only at hq - choose f hf1 hf2 using hq - simp_rw [Dissipate, hf2] at h_empty ⊢ + choose L hL1 hL2 using hq + simp_rw [Dissipate, hL2] at h_empty ⊢ -- simp_rw [sUnion_eq_iUnion, iInter_iUnion_distr] at h_empty - simp_rw [iInter_eq_empty_iff, mem_sUnion, Finset.mem_coe, not_exists, not_and] at h_empty ⊢ - by_contra h + -- simp_rw [iInter_eq_empty_iff, mem_sUnion, Finset.mem_coe, not_exists, not_and] at h_empty ⊢ + by_contra! h + apply (imp_false (a := ⋂ i, ⋃₀ (L i).toSet = ∅)).mpr + simp_rw [nonempty_iff_ne_empty] at h + let m := m' L hL1 h + + revert h_empty simp only [imp_false] - push_neg at h ⊢ + push_neg + + + + + simp only [nonempty_iInter, mem_sUnion, Finset.mem_coe] at h ⊢ simp_rw [Dissipate, nonempty_iInter] at h From f3295e08404c9e7ef97151b1bad388e15b13afcb Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sun, 27 Apr 2025 13:48:01 +0200 Subject: [PATCH 095/129] define union --- .../Topology/Compactness/CompactSystem.lean | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 9345029b7f4860..0c45e08eb9f35a 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -481,7 +481,33 @@ theorem main' (p : Set α → Prop) (hp : IsCompactSystem p) (L : ℕ → Finset example (s : Set α) : s ≠ ∅ ↔ s.Nonempty := by exact Iff.symm nonempty_iff_ne_empty -theorem union (h : IsCompactSystem p) : IsCompactSystem (fun s ↦ ∃ (D : Finset (Set (α))), +def ofUnion {p : Set α → Prop} (hp : IsCompactSystem p) : Set α → Prop := + (sUnion '' ({ L : Set (Set α) | L.Finite ∧ ∀ K ∈ L, p K})) + +lemma union_mem_iff (s : Set α) : ofUnion hp s ↔ ∃ L : Finset (Set α), s = ⋃₀ L ∧ ∀ K ∈ L, p K := by + refine ⟨fun ⟨L, hL⟩ ↦ ?_, fun h ↦ ?_⟩ + · simp only [mem_setOf_eq] at hL + let L' := (hL.1.1).toFinset + use L' + rw [← hL.2, Finite.coe_toFinset] + refine ⟨rfl, fun K hK ↦ ?_⟩ + rw [Finite.mem_toFinset] at hK + apply hL.1.2 K hK + · obtain ⟨L, hL⟩ := h + use L + simp only [mem_setOf_eq, Finset.finite_toSet, Finset.mem_coe, true_and] + refine ⟨hL.2, hL.1.symm⟩ + + + +theorem unionIsCompactSystem : IsCompactSystem union := by sorry + + + +(L : ℕ → Finset (Set α)) + (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) + +theorem unionIsCompactSystem' (h : IsCompactSystem p) : IsCompactSystem (fun s ↦ ∃ (D : Finset (Set (α))), (∀ d ∈ D, p d) ∧ s = ⋃₀ (D : Set (Set α))) := by intro q hq h_empty simp only at hq From 97debb9808aa924791c75b4fa896ee9c12a24d8e Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Wed, 30 Apr 2025 00:12:11 +0200 Subject: [PATCH 096/129] progress --- .../Topology/Compactness/CompactSystem.lean | 130 +++++++++++++++--- 1 file changed, 109 insertions(+), 21 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 0c45e08eb9f35a..98a48b0f5df679 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -329,6 +329,8 @@ variable {p : Set α → Prop} (hp : IsCompactSystem p) (L : ℕ → Finset (Set -- variable (p : {n : ℕ} → ((k : Fin (n + 1)) → (β k)) → Prop) +/-- `r n K` is the property which must hold for compact systems: +`∀ N, (⋂ (j < n), (K j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅`. -/ noncomputable def r (n : ℕ) (K : ℕ → Set α) : Prop := ∀ N, (⋂ (j < n), (K j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ @@ -376,9 +378,7 @@ private lemma inter_sUnion_sUnion (m n : ℕ) : (⋂ k < m, (⋃₀ L k)) ∩ exact fun a ↦ Nat.add_lt_add_left a m exact h (m + i) (h' i m n hi) - --- (h0 : ∃ x : (ℕ → α), p 0 x) - +/-- `q n K` is the joint property that `(∀ k < n, K k ∈ L k)` and `r n K)` holds. -/ def q : ℕ → (ℕ → Set α) → Prop := fun n K ↦ (∀ k < n, K k ∈ L k) ∧ (r L n K) lemma get_element_zero (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : @@ -459,27 +459,98 @@ lemma get_element_succ' (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet (L := fun (y : Set α) (hy : y ∈ L n) ↦ (y ∩ ⋂ k, ⋂ (hk : k < b y (hn y hy)), ⋃₀ (L (n + 1 + k)).toSet)) h₂ hb' -noncomputable def m' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : +/-- `mem_of_union_aux h n` is the product of some `K : ℕ → Set α)` and `q n K`. +Constructing `(mem_of_union_aux h n).1` works inductively. When constructing +`(mem_of_union_aux h (n + 1)).1`, we update `(mem_of_union_aux h n).1` only at position `n`. -/ +noncomputable def mem_of_union_aux (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : (n : ℕ) → ((K : ℕ → Set α) ×' (q L n K)) | 0 => ⟨(get_element_zero L h).choose, (get_element_zero L h).choose_spec⟩ | n + 1 => by - have g := (get_element_succ' L hL) n (m' h n).1 (m' h n).2 - exact ⟨Function.update (m' h n).1 n g.choose, g.choose_spec⟩ - - - - - - -theorem main' (p : Set α → Prop) (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) - (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) - (hc : ∀ (n : ℕ), ⋂ (k : Fin (n + 1)), (⋃₀ (L k).toSet) ≠ ∅) : - ∃ (K : (j : ℕ) → (L j)), (∀ n N, ⋂ (j : Fin (n + 1)), (K j) ∩ ⋂ (k < N), - ⋃₀ (L (n + 1 + k)).toSet ≠ ∅) := by - sorry - -example (s : Set α) : s ≠ ∅ ↔ s.Nonempty := by - exact Iff.symm nonempty_iff_ne_empty + have g := (get_element_succ' L hL) n (mem_of_union_aux h n).1 (mem_of_union_aux h n).2 + exact ⟨Function.update (mem_of_union_aux h n).1 n g.choose, g.choose_spec⟩ + +lemma constantEventually (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n k : ℕ) (hkn : k < n) : + (mem_of_union_aux L hL h n).1 k = (mem_of_union_aux L hL h (n + 1)).1 k := by + simp [mem_of_union_aux, hkn.ne] + +lemma constantEventually' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n k : ℕ) (hkn : k < n) : + (mem_of_union_aux L hL h n).1 k = (mem_of_union_aux L hL h (k + 1)).1 k := by + induction n with + | zero => + cases hkn + | succ n hn => + by_cases h' : k < n + · rw [← hn h'] + exact (constantEventually L hL h n k h').symm + · have hkn' : k = n := by linarith + rw [hkn'] + +lemma constantEventually'' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (m n k : ℕ) + (hkn : k < n) (hkm : k < m) : (mem_of_union_aux L hL h n).1 k + = (mem_of_union_aux L hL h m).1 k := by + rw [constantEventually' L hL h n k hkn, constantEventually' L hL h m k hkm] + +/-- For `L : ℕ → Finset (Set α)` such that `∀ K ∈ L n, p K` and +`h : ∀ N, ⋂ k < N, ⋃₀ L k ≠ ∅`, `mem_of_union h n` is some `K : ℕ → Set α` such that `K n ∈ L n` +for all `n` (this is `prop₀`) and `∀ N, ⋂ (j < n, K j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ≠ ∅` +(this is `prop₁`.) -/ +noncomputable def mem_of_union (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) := + fun n ↦ (mem_of_union_aux L hL h (n + 1)).1 n + +example (a b c : Set α) (hab : a ⊆ b) : a ∩ c ⊆ b ∩ c := by + exact inter_subset_inter hab fun ⦃a⦄ a ↦ a + +lemma prop₀ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : mem_of_union L hL h n ∈ L n := by + exact (mem_of_union_aux L hL h (n + 1)).2.1 n (lt_add_one n) + +lemma isSubset (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n N : ℕ) : + (⋂ j < n, mem_of_union L hL h j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ⊆ + ⋂ (k < n + N), (⋃₀ (L k).toSet) := by + have h' : ⋂ (k < n + N), (⋃₀ (L k).toSet) = + (⋂ (k < n), (⋃₀ (L k).toSet)) ∩ ⋂ (k < N), (⋃₀ (L (n + k)).toSet) := by + ext x + simp only [mem_iInter, mem_sUnion, Finset.mem_coe, mem_inter_iff] + refine ⟨fun h ↦ ⟨fun i hi ↦ ?_, fun i hi ↦ ?_⟩, fun h i hi ↦ ?_⟩ + · refine h i (lt_of_lt_of_le hi (Nat.le_add_right n N)) + · refine h (n + i) (Nat.add_lt_add_left hi n) + · by_cases hin : i < n + · exact h.1 i hin + · have h₁ : i - n < N := Nat.sub_lt_left_of_lt_add (Nat.le_of_not_lt hin) hi + have h₂ : n + (i - n) = i := by + exact add_sub_of_le <| Nat.le_of_not_lt hin + exact h₂ ▸ h.2 (i - n) h₁ + rw [h'] + apply inter_subset_inter _ fun ⦃a⦄ a ↦ a + have h'' (j : ℕ) (hj : j < n) : mem_of_union L hL h j ⊆ ⋃₀ (L j).toSet := by + exact subset_sUnion_of_mem <| prop₀ L hL h j + exact iInter₂_mono h'' + + +lemma has_p (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : p (mem_of_union L hL h n) := by + exact hL n (mem_of_union L hL h n) (prop₀ L hL h n) + +lemma prop₁ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : + ∀ N, (⋂ (j < n), (mem_of_union L hL h j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ := by + have h' : r L n (mem_of_union_aux L hL h n).fst := (mem_of_union_aux L hL h n).2.2 + simp only [r] at h' + simp only [mem_of_union] + intro N + specialize h' N + conv at h' => + lhs + enter [1,1] + intro j + enter[1] + intro hj + rw [constantEventually' L hL h n j hj] + exact h' + +namespace mem_of_union + +noncomputable def choose (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : ℕ → Set α := + fun n ↦ (mem_of_union_aux L hL h n).1 n + +end mem_of_union def ofUnion {p : Set α → Prop} (hp : IsCompactSystem p) : Set α → Prop := (sUnion '' ({ L : Set (Set α) | L.Finite ∧ ∀ K ∈ L, p K})) @@ -500,6 +571,23 @@ lemma union_mem_iff (s : Set α) : ofUnion hp s ↔ ∃ L : Finset (Set α), s = + + + + +theorem main' (p : Set α → Prop) (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) + (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) + (hc : ∀ (n : ℕ), ⋂ (k : Fin (n + 1)), (⋃₀ (L k).toSet) ≠ ∅) : + ∃ (K : (j : ℕ) → (L j)), (∀ n N, ⋂ (j : Fin (n + 1)), (K j) ∩ ⋂ (k < N), + ⋃₀ (L (n + 1 + k)).toSet ≠ ∅) := by + sorry + +example (s : Set α) : s ≠ ∅ ↔ s.Nonempty := by + exact Iff.symm nonempty_iff_ne_empty + + + + theorem unionIsCompactSystem : IsCompactSystem union := by sorry From 86fa2abd0b715f3cd46de6b0818ad42656543268 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Wed, 30 Apr 2025 11:37:31 +0200 Subject: [PATCH 097/129] no problems anymore --- .../Topology/Compactness/CompactSystem.lean | 250 +++++++----------- 1 file changed, 100 insertions(+), 150 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 98a48b0f5df679..90efba71de654a 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -50,6 +50,36 @@ end definition namespace IsCompactSystem +lemma iff (p : Set α → Prop) : IsCompactSystem p ↔ + ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ n, ⋂ k < n, C k ≠ ∅) → ⋂ i, C i ≠ ∅ := by + refine ⟨fun h C hi ↦ ?_, fun h C hi ↦ ?_⟩ + · rw [← not_imp_not] + push_neg + intro h' + specialize h C hi h' + obtain ⟨n, hn⟩ := h + use n + 1 + rw [Dissipate] at hn + conv => + lhs + enter [1] + intro j + rw [Nat.lt_add_one_iff] + exact hn + · rw [← not_imp_not] + push_neg + simp_rw [nonempty_iff_ne_empty] + intro h' + apply h C hi + intro n hn + apply h' n + rw [← subset_empty_iff] at hn ⊢ + apply le_trans _ hn + rw [Dissipate] + intro x + rw [mem_iInter₂, mem_iInter₂] + exact fun h i hi ↦ h i hi.le + /-- In a compact system, given a countable family with empty intersection, we choose a finite subfamily with empty intersection. -/ noncomputable @@ -304,11 +334,6 @@ end ClosedCompact section Union -example (L : ℕ → Set α) (h : ∀ n, L n = ∅) : ⋃ n, L n = ∅ := by exact iUnion_eq_empty.mpr h - -example (a s t : Set α) (hst : s ⊆ t) : a ∩ s ⊆ a ∩ t := by - exact inter_subset_inter (fun ⦃a_1⦄ a ↦ a) hst - lemma l2 {ι : Type*} (s t : Set α) (u : Set ι) (L : (i : ι) → (hi : i ∈ u) → Set α) (h : s ⊆ ⋃ (n : ι) (hn : n ∈ u), L n hn) (h' : ∀ (n : ι) (hn : n ∈ u), t ∩ (L n hn) = ∅) : t ∩ s = ∅ := by @@ -322,10 +347,8 @@ lemma l2 {ι : Type*} (s t : Set α) (u : Set ι) (L : (i : ι) → (hi : i ∈ have gf := inter_subset_inter (t₁ := t) (fun ⦃a_1⦄ a ↦ a) h apply le_trans gf j - - variable {p : Set α → Prop} (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) - (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n : Set (Set α))), p d) + (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) -- variable (p : {n : ℕ} → ((k : Fin (n + 1)) → (β k)) → Prop) @@ -385,7 +408,7 @@ lemma get_element_zero (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ∃ (K : ℕ → Set α), q L 0 K := by simp [q, r, h] -lemma get_element_succ' (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) (n : ℕ) +lemma get_element_succ' (n : ℕ) (K : ℕ → Set α) (hK : q L n K) : ∃ y, q L (n + 1) (Function.update K n y) := by simp_rw [q, r] at hK ⊢ by_contra! h @@ -466,45 +489,48 @@ noncomputable def mem_of_union_aux (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ (n : ℕ) → ((K : ℕ → Set α) ×' (q L n K)) | 0 => ⟨(get_element_zero L h).choose, (get_element_zero L h).choose_spec⟩ | n + 1 => by - have g := (get_element_succ' L hL) n (mem_of_union_aux h n).1 (mem_of_union_aux h n).2 + have g := (get_element_succ' L) n (mem_of_union_aux h n).1 (mem_of_union_aux h n).2 exact ⟨Function.update (mem_of_union_aux h n).1 n g.choose, g.choose_spec⟩ +namespace mem_of_union + lemma constantEventually (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n k : ℕ) (hkn : k < n) : - (mem_of_union_aux L hL h n).1 k = (mem_of_union_aux L hL h (n + 1)).1 k := by + (mem_of_union_aux L h n).1 k = (mem_of_union_aux L h (n + 1)).1 k := by simp [mem_of_union_aux, hkn.ne] lemma constantEventually' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n k : ℕ) (hkn : k < n) : - (mem_of_union_aux L hL h n).1 k = (mem_of_union_aux L hL h (k + 1)).1 k := by + (mem_of_union_aux L h n).1 k = (mem_of_union_aux L h (k + 1)).1 k := by induction n with | zero => cases hkn | succ n hn => by_cases h' : k < n · rw [← hn h'] - exact (constantEventually L hL h n k h').symm + exact (constantEventually L h n k h').symm · have hkn' : k = n := by linarith rw [hkn'] lemma constantEventually'' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (m n k : ℕ) - (hkn : k < n) (hkm : k < m) : (mem_of_union_aux L hL h n).1 k - = (mem_of_union_aux L hL h m).1 k := by - rw [constantEventually' L hL h n k hkn, constantEventually' L hL h m k hkm] + (hkn : k < n) (hkm : k < m) : (mem_of_union_aux L h n).1 k + = (mem_of_union_aux L h m).1 k := by + rw [constantEventually' L h n k hkn, constantEventually' L h m k hkm] + +end mem_of_union /-- For `L : ℕ → Finset (Set α)` such that `∀ K ∈ L n, p K` and `h : ∀ N, ⋂ k < N, ⋃₀ L k ≠ ∅`, `mem_of_union h n` is some `K : ℕ → Set α` such that `K n ∈ L n` for all `n` (this is `prop₀`) and `∀ N, ⋂ (j < n, K j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ≠ ∅` (this is `prop₁`.) -/ noncomputable def mem_of_union (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) := - fun n ↦ (mem_of_union_aux L hL h (n + 1)).1 n + fun n ↦ (mem_of_union_aux L h (n + 1)).1 n -example (a b c : Set α) (hab : a ⊆ b) : a ∩ c ⊆ b ∩ c := by - exact inter_subset_inter hab fun ⦃a⦄ a ↦ a +namespace mem_of_union -lemma prop₀ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : mem_of_union L hL h n ∈ L n := by - exact (mem_of_union_aux L hL h (n + 1)).2.1 n (lt_add_one n) +lemma prop₀ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : mem_of_union L h n ∈ L n := by + exact (mem_of_union_aux L h (n + 1)).2.1 n (lt_add_one n) lemma isSubset (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n N : ℕ) : - (⋂ j < n, mem_of_union L hL h j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ⊆ + (⋂ j < n, mem_of_union L h j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ⊆ ⋂ (k < n + N), (⋃₀ (L k).toSet) := by have h' : ⋂ (k < n + N), (⋃₀ (L k).toSet) = (⋂ (k < n), (⋃₀ (L k).toSet)) ∩ ⋂ (k < N), (⋃₀ (L (n + k)).toSet) := by @@ -521,17 +547,23 @@ lemma isSubset (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n N : ℕ) : exact h₂ ▸ h.2 (i - n) h₁ rw [h'] apply inter_subset_inter _ fun ⦃a⦄ a ↦ a - have h'' (j : ℕ) (hj : j < n) : mem_of_union L hL h j ⊆ ⋃₀ (L j).toSet := by - exact subset_sUnion_of_mem <| prop₀ L hL h j + have h'' (j : ℕ) (hj : j < n) : mem_of_union L h j ⊆ ⋃₀ (L j).toSet := by + exact subset_sUnion_of_mem <| prop₀ L h j exact iInter₂_mono h'' +lemma isSubsetN0 (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : + (⋂ j, mem_of_union L h j) ⊆ + ⋂ k, (⋃₀ (L k).toSet) := by + exact iInter_mono <| fun n ↦ + subset_sUnion_of_subset (↑(L n)) (mem_of_union L h n) (fun ⦃a⦄ a ↦ a) (prop₀ L h n) -lemma has_p (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : p (mem_of_union L hL h n) := by - exact hL n (mem_of_union L hL h n) (prop₀ L hL h n) +lemma has_p (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) + (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : p (mem_of_union L h n) := by + exact hL n (mem_of_union L h n) (prop₀ L h n) lemma prop₁ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : - ∀ N, (⋂ (j < n), (mem_of_union L hL h j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ := by - have h' : r L n (mem_of_union_aux L hL h n).fst := (mem_of_union_aux L hL h n).2.2 + ∀ N, (⋂ (j < n), (mem_of_union L h j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ := by + have h' : r L n (mem_of_union_aux L h n).fst := (mem_of_union_aux L h n).2.2 simp only [r] at h' simp only [mem_of_union] intro N @@ -542,20 +574,26 @@ lemma prop₁ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : intro j enter[1] intro hj - rw [constantEventually' L hL h n j hj] + rw [constantEventually' L h n j hj] exact h' -namespace mem_of_union - -noncomputable def choose (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : ℕ → Set α := - fun n ↦ (mem_of_union_aux L hL h n).1 n +lemma prop₁N0 (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : + (⋂ (j < n), (mem_of_union L h j)) ≠ ∅ := by + have h' : (⋂ (k < 0), (⋃₀ (L (n + k)).toSet)) = univ := by + simp + have d (s : Set α) : s = s ∩ univ := by exact left_eq_inter.mpr fun ⦃a⦄ a ↦ trivial + rw [d (⋂ j, ⋂ (_ : j < n), mem_of_union L h j)] + rw [← h'] + exact prop₁ L h n 0 end mem_of_union -def ofUnion {p : Set α → Prop} (hp : IsCompactSystem p) : Set α → Prop := +def union (p : Set α → Prop) : Set α → Prop := (sUnion '' ({ L : Set (Set α) | L.Finite ∧ ∀ K ∈ L, p K})) -lemma union_mem_iff (s : Set α) : ofUnion hp s ↔ ∃ L : Finset (Set α), s = ⋃₀ L ∧ ∀ K ∈ L, p K := by +namespace union + +lemma mem_iff (s : Set α) : union p s ↔ ∃ L : Finset (Set α), s = ⋃₀ L ∧ ∀ K ∈ L, p K := by refine ⟨fun ⟨L, hL⟩ ↦ ?_, fun h ↦ ?_⟩ · simp only [mem_setOf_eq] at hL let L' := (hL.1.1).toFinset @@ -569,68 +607,33 @@ lemma union_mem_iff (s : Set α) : ofUnion hp s ↔ ∃ L : Finset (Set α), s = simp only [mem_setOf_eq, Finset.finite_toSet, Finset.mem_coe, true_and] refine ⟨hL.2, hL.1.symm⟩ - - - - - - -theorem main' (p : Set α → Prop) (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) - (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) - (hc : ∀ (n : ℕ), ⋂ (k : Fin (n + 1)), (⋃₀ (L k).toSet) ≠ ∅) : - ∃ (K : (j : ℕ) → (L j)), (∀ n N, ⋂ (j : Fin (n + 1)), (K j) ∩ ⋂ (k < N), - ⋃₀ (L (n + 1 + k)).toSet ≠ ∅) := by - sorry - -example (s : Set α) : s ≠ ∅ ↔ s.Nonempty := by - exact Iff.symm nonempty_iff_ne_empty - - - - -theorem unionIsCompactSystem : IsCompactSystem union := by sorry - - - -(L : ℕ → Finset (Set α)) - (hL : ∀ (n : ℕ) (d : Set α) (hd : d ∈ (L n).toSet), p d) - -theorem unionIsCompactSystem' (h : IsCompactSystem p) : IsCompactSystem (fun s ↦ ∃ (D : Finset (Set (α))), - (∀ d ∈ D, p d) ∧ s = ⋃₀ (D : Set (Set α))) := by - intro q hq h_empty - simp only at hq - choose L hL1 hL2 using hq - simp_rw [Dissipate, hL2] at h_empty ⊢ - -- simp_rw [sUnion_eq_iUnion, iInter_iUnion_distr] at h_empty - -- simp_rw [iInter_eq_empty_iff, mem_sUnion, Finset.mem_coe, not_exists, not_and] at h_empty ⊢ - by_contra! h - apply (imp_false (a := ⋂ i, ⋃₀ (L i).toSet = ∅)).mpr - simp_rw [nonempty_iff_ne_empty] at h - let m := m' L hL1 h - - - revert h_empty - simp only [imp_false] - push_neg - - - - - - - simp only [nonempty_iInter, mem_sUnion, Finset.mem_coe] at h ⊢ - simp_rw [Dissipate, nonempty_iInter] at h - - - - apply exists_mem_of_nonempty - - - - - - - sorry +example (s t : Set α) (hst : s ⊆ t) (hs : s.Nonempty) : t.Nonempty := by + exact Nonempty.mono hst hs + +example (s : Set α) : s ≠ ∅ ↔ s.Nonempty := by exact Iff.symm nonempty_iff_ne_empty + +theorem isCompactSystem (p : Set α → Prop)(hp : IsCompactSystem p) : IsCompactSystem (union p) := by + have hp' := (IsCompactSystem.iff p).mp hp + rw [IsCompactSystem.iff] + intro C hi + simp_rw [mem_iff] at hi + choose L' hL' using hi + have hL'1 := fun n ↦ (hL' n).1 + have hL'2 := fun n ↦ (hL' n).2 + simp_rw [hL'1] + intro hL + let K := mem_of_union L' hL + have h₁ : ⋂ i, K i ⊆ ⋂ i, ⋃₀ (L' i).toSet := by + apply mem_of_union.isSubsetN0 L' + have h₂ : ⋂ i, K i ≠ ∅ := by + apply hp' _ + · apply mem_of_union.has_p + exact hL'2 + · apply mem_of_union.prop₁N0 + rw [← nonempty_iff_ne_empty] at h₂ ⊢ + exact Nonempty.mono h₁ h₂ + +end union end Union @@ -798,56 +801,3 @@ theorem IsCompactSystem.closedCompactSquareCylinders : closedCompactSquareCylinders_supset end ClosedCompactSquareCylinders - - -variable {β : (n : ℕ) → Type*} - -variable (p : {n : ℕ} → ((k : Fin (n + 1)) → (β k)) → Prop) - -def joi {n : ℕ} (x : (k : Fin (n + 1)) → (β k)) (y : β (n + 1)) : (k : Fin (n + 2)) → (β k) := by - let z (k : Fin (n + 2)) (hk : ¬ k.val < n + 1) : β k := by - simp only [not_lt] at hk - have h : β k = β (n + 1) := by - congr - exact Nat.eq_of_le_of_lt_succ hk k.prop - exact h ▸ y - exact fun k ↦ dite (k.val < n + 1) (fun c ↦ x ⟨k.val, c⟩) (z k) - -variable (h0 : ∃ x : (k : Fin 1) → (β k), p x) - (h : ∀ (n : ℕ) (x : (k : Fin (n + 1)) → (β k)), p x → ∃ y : (β (n + 1)), - p (joi x y)) - - -noncomputable def m : (n : ℕ) → ((x : (k : Fin (n + 1)) → (β k)) ×' (p x)) - | 0 => ⟨h0.choose, h0.choose_spec⟩ - | n + 1 => by - let g := (h n (m n).1 (m n).2) - exact ⟨joi (m n).1 g.choose, g.choose_spec⟩ - -example (n : ℕ) : p (m p h0 h n).1 := by - exact (m p h0 h n).2 - - - - - -variable {β : (n : ℕ) → (Set α)} (p : ℕ → (ℕ → α) → Prop) - -variable (h0 : ∃ x : (ℕ → α), p 0 x) - (h : ∀ (n : ℕ) (x : (ℕ → α)) (hx₁ : ∀ k < n, x k ∈ β k) (hx₂ : p n x) , - ∃ y ∈ β n, p (n + 1) (Function.update x n y)) - -noncomputable def m' : (n : ℕ) → ((x : ℕ → α) ×' (∀ k < n, x k ∈ β k) ∧ (p n x)) - | 0 => ⟨h0.choose, ⟨by simp, h0.choose_spec⟩⟩ - | n + 1 => by - have g : ∃ y ∈ β n, p (n + 1) (Function.update (m' n).fst n y) := (h n (m' n).1 (m' n).2.1 (m' n).2.2) - obtain ⟨y, hy⟩ := g - have g' : Function.update (m' n).1 n g.choose n ∈ β n := by - simp only [ne_eq, left_eq_add, one_ne_zero, not_false_eq_true, Function.update_of_ne] - - simp only [Function.update_self] - exact g.choose_spec.1 - exact ⟨Function.update (m' n).1 (n + 1) g.choose, fun g' ↦ g.choose_spec.2⟩ - -lemma e (n : ℕ) : (((m' p h0 h n).1 n) ∈ β n) ∧ (p n (m' p h0 h n).1) := by - exact (m' p h0 h n).2 From f6a2cc72b2376ecf11a74b5a92b53e7796833d46 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Wed, 30 Apr 2025 13:59:22 +0200 Subject: [PATCH 098/129] typos --- Mathlib/Topology/Compactness/CompactSystem.lean | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 90efba71de654a..8979276e2e28c5 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -21,7 +21,7 @@ This file defines compact systems of sets. * `IsCompactSystem`: A set of sets is a compact system if, whenever a countable subfamily has empty intersection, then finitely many of them already have empty intersection. - +* `IsCompactSystem.union`: The set system of finite unions of another set system. ## Main results * `IsCompactSystemiff_isCompactSystem_of_or_univ`: A set system is a compact @@ -29,10 +29,10 @@ system iff inserting `univ` gives a compact system. * `IsClosedCompact.isCompactSystem`: The set of closed and compact sets is a compact system. * `IsClosedCompact.isCompactSystem_of_T2Space`: In a `T2Space α`, the set of compact sets is a compact system in a `T2Space`. +* `IsCompactSystem.union.isConpactSystem`: If `IsCompactSystem p`, the set of finite unions + of `K : Set α` with `p K` is a compact system. * `IsCompactSystem.closedCompactSquareCylinders`: Closed and compact square cylinders form a - compact system. -* `IsCompactSystem.closedCompactSquareCylinders`: Closed and compact square cylinders form a - compact system. + compact system in a product space. -/ open Set Nat MeasureTheory From af59b931bb941ae398d62c9800db78a869e6015b Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 2 May 2025 08:14:21 +0200 Subject: [PATCH 099/129] update Mathlib --- Mathlib.lean | 1 + Mathlib/Topology/Compactness/CompactSystem.lean | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index 5b4751deecfa23..249f85eb5731f2 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6376,6 +6376,7 @@ import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.CompactlyCoherentSpace import Mathlib.Topology.Compactness.CompactlyGeneratedSpace +import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.DeltaGeneratedSpace import Mathlib.Topology.Compactness.Exterior import Mathlib.Topology.Compactness.HilbertCubeEmbedding diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 8979276e2e28c5..58e4fbd1b0303a 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -261,7 +261,6 @@ theorem iff_directed' (hpi : IsPiSystem p) : theorem of_supset {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs - section ClosedCompact variable (α : Type*) [TopologicalSpace α] From c1d6caa10511e404f85cfc10b6be96bac9e76707 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 2 May 2025 09:06:41 +0200 Subject: [PATCH 100/129] typo --- .../Topology/Compactness/CompactSystem.lean | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 58e4fbd1b0303a..b90d4673ed6eae 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -379,27 +379,6 @@ lemma nonempty (k : ℕ) (hc : ∀ N, ⋂ k < N, ⋃₀ (L k : Set (Set α)) ≠ simp only [Finset.coe_empty, sUnion_empty] exact of_eq_false (congrFun hg x) -private lemma inter_sUnion_sUnion (m n : ℕ) : (⋂ k < m, (⋃₀ L k)) ∩ ⋂ (k < n), ⋃₀ L (m + k) = - ⋂ (k < m + n), ⋃₀ (L k).toSet := by - ext x - rw [mem_inter_iff, mem_iInter₂, mem_iInter₂, mem_iInter₂] - refine ⟨fun h i hi ↦ ?_, fun h ↦ ?_⟩ - · by_cases h' : i < m - · exact h.1 i h' - · have hj : ∃ j, j < n ∧ i = m + j := by - use i - m - refine ⟨Nat.sub_lt_left_of_lt_add (not_lt.mp h') hi, Eq.symm (add_sub_of_le (not_lt.mp h'))⟩ - obtain ⟨j, hj₁, hj₂⟩ := hj - rw [hj₂] - exact h.2 j hj₁ - · refine ⟨fun i hi ↦ ?_, fun i hi ↦ ?_⟩ - · have h' (j m n : ℕ) (hj : j < m) : j < m + n := by - exact Nat.lt_add_right n hj - exact h i (h' i m n hi) - · have h' (j m n : ℕ) : j < n → ((m + j) < m + n) := by - exact fun a ↦ Nat.add_lt_add_left a m - exact h (m + i) (h' i m n hi) - /-- `q n K` is the joint property that `(∀ k < n, K k ∈ L k)` and `r n K)` holds. -/ def q : ℕ → (ℕ → Set α) → Prop := fun n K ↦ (∀ k < n, K k ∈ L k) ∧ (r L n K) From 84b5e4a7000fafa95211a48bc6382dd39b1c0bf9 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 2 May 2025 09:07:41 +0200 Subject: [PATCH 101/129] deleted copy --- .../Compactness/CompactSystemcopy.lean | 125 ------------------ 1 file changed, 125 deletions(-) delete mode 100644 Mathlib/Topology/Compactness/CompactSystemcopy.lean diff --git a/Mathlib/Topology/Compactness/CompactSystemcopy.lean b/Mathlib/Topology/Compactness/CompactSystemcopy.lean deleted file mode 100644 index c9c1c7af694d49..00000000000000 --- a/Mathlib/Topology/Compactness/CompactSystemcopy.lean +++ /dev/null @@ -1,125 +0,0 @@ -/- -Copyright (c) 2023 Rémy Degenne. All rights reserved. -Released under Apache 2.0 license as described in the file LICENSE. -Authors: Rémy Degenne, Peter Pfaffelhuber --/ -import Mathlib.Data.Set.Dissipate - -variable {α : Type*} (p : ℕ → (ℕ → α) → Prop) - -variable (h0 : ∃ x : (ℕ → α), p 0 x) - (h : ∀ (n : ℕ) (x : (ℕ → α)) (hx : p n x), - ∃ y, p (n + 1) (Function.update x n y)) - --- p n x ↔ (∀ k < n, K k ∈ β k) ∧ (r n K) - -noncomputable def m' : (n : ℕ) → ((x : ℕ → α) ×' (p n x)) - | 0 => ⟨h0.choose, h0.choose_spec⟩ - | n + 1 => by - have g := h n (m' n).1 (m' n).2 - refine ⟨Function.update (m' n).1 n g.choose, g.choose_spec⟩ - - - - - - -def join {n : ℕ} (K' : (k : ℕ) → Set α) (hK' : ∀ k, K' k ∈ L k) (K : Set α) (hK : K ∈ L (n + 1)) - (k : ℕ) : Set α := dite (k < n + 1) (fun c ↦ K' k) (fun c ↦ K) - -lemma join_of_lt_succ {n : ℕ} (K' : (k : ℕ) → (L k)) (K : L (n + 1)) {j : ℕ} (hj : j < n + 1) : - join K' K j (lt_trans hj (lt_add_one (n + 1))) = K' j := by - simp only [join, dite_eq_left_iff, not_lt] - intro h - linarith - -lemma join_of_eq_succ {n : ℕ} (K' : (k : ℕ) → (L k)) (K : L (n + 1)) : - join K' K (n + 1) (lt_add_one (n + 1)) = K := by - simp [join] - -lemma l {n : ℕ} (K' : (k : ℕ) → (L k)) (s : Set α) : - ⋂ (k : ℕ) (hk : k < n + 1), (K' k) ∩ ⋃₀ (L (n + 1)) ∩ s ⊆ - ⋃ (a : L (n + 1)), ⋂ (k : ℕ) (hk : k < n + 2), (join K' a k hk) ∩ s - := by - intro x - simp only [mem_iInter, mem_inter_iff, mem_sUnion, Finset.mem_coe, mem_iUnion, Subtype.exists] - intro h - obtain h₁ : ∀ i < n + 1, (x ∈ ((K' i) : Set α)) := by exact fun i hi ↦ (h i hi).1.1 - obtain h₂ : ∃ t ∈ (L (n + 1) : Set (Set α)), x ∈ t:= (h 0 (zero_lt_succ n)).1.2 - rcases h₂ with ⟨t, ht, j⟩ - - sorry - -example (s t : Set α) : s = t ↔ s ⊆ t ∧ t ⊆ s := by exact Subset.antisymm_iff - -lemma iUnion_join {n : ℕ} (K' : (k : ℕ) → (L k)) (s : Set α) : - ⋃ (a : L (n + 1)), ⋂ (k : ℕ) (hk : k < n + 2), (join K' a k hk) ∩ s = - ⋂ (k : ℕ) (hk : k < n + 1), (K' k) ∩ ⋃₀ (L (n + 1)) ∩ s := by - apply Subset.antisymm_iff.mpr - simp only [subset_iInter_iff, subset_inter_iff, iUnion_subset_iff, Subtype.forall] - refine ⟨fun i hi ↦ ⟨⟨?_, ?_⟩, ?_⟩, fun x hx ↦ ?_⟩ - · intro K hK - intro x hx - simp only [mem_iInter, mem_inter_iff] at * - specialize hx i (lt_trans hi <| lt_add_one (n + 1)) - rw [join_of_lt_succ K' ⟨K, hK⟩ hi] at hx - exact hx.1 - · intro K hK - intro x hx - simp only [mem_iInter, mem_inter_iff, mem_sUnion, Finset.mem_coe] at * - specialize hx (n + 1) (lt_add_one (n + 1)) - rw [join_of_eq_succ] at hx - use K - exact ⟨hK, hx.1⟩ - · intro K hK x h - simp? at h - refine (h 0 (zero_lt_succ (n + 1))).2 - · simp only [mem_iInter, mem_inter_iff, mem_sUnion, Finset.mem_coe, mem_iUnion, - Subtype.exists] at * - obtain h₁ : ∀ i < n + 1, (x ∈ ((K' i) : Set α)) := by exact fun i hi ↦ (hx i hi).1.1 - obtain h₂ := (hx 0 (zero_lt_succ n)).1.2 - obtain h₃ := (hx 0 (zero_lt_succ n)).2 - rcases h₂ with ⟨t, ht, j⟩ - use t, ht - intro i hi - by_cases g : i < n + 1 - · rw [join_of_lt_succ K' ⟨t, ht⟩ g] - exact ⟨(hx i g).1.1, (hx i g).2⟩ - · have g' : i = n + 1 := by linarith - obtain h₄ := join_of_eq_succ K' ⟨t, ht⟩ - have h₅ : (join K' ⟨t, ht⟩ i hi) = g'.symm ▸ join K' ⟨t, ht⟩ (n + 1) (lt_add_one (n + 1)) := by sorry - rw [h₅] - - rw [join_of_eq_succ K' ⟨t, ht⟩] - refine ⟨?_, h₃⟩ - - - sorry - - - - - simp only [mem_iInter, mem_inter_iff] at * - - sorry - - simp only [mem_iUnion, mem_iInter, mem_inter_iff, Subtype.exists, mem_sUnion, Finset.mem_coe] - refine ⟨fun h i hi ↦ ⟨⟨?_, ?_⟩, ?_⟩ , fun h ↦ ⟨?_, ?_, ?_⟩⟩ - · obtain ⟨K, ⟨hK, h'⟩⟩ := h - specialize h' i (lt_trans hi <| lt_add_one (n + 1)) - rw [join_of_lt_succ K' ⟨K, hK⟩ hi] at h' - exact h'.1 - · obtain ⟨K, ⟨hK, h'⟩⟩ := h - specialize h' (n + 1) (lt_add_one (n + 1)) - rw [join_of_eq_succ] at h' - use K - exact ⟨hK, h'.1⟩ - · obtain ⟨K, ⟨hK, h'⟩⟩ := h - refine (h' 0 (zero_lt_succ (n + 1))).2 - · obtain h₁ : ∀ i < n + 1, (x ∈ ((K' i) : Set α)) := by exact fun i hi ↦ (h i hi).1.1 - obtain h₂ : ∃ t ∈ (L (n + 1) : Set (Set α)), x ∈ t:= (h 0 (zero_lt_succ n)).1.2 - change ∃ t, t ∈ (L (n + 1) : Set (Set α)) ∧ x ∈ t at h₂ - rcases h₂ with ⟨t, ht, j⟩ - sorry - · sorry - · sorry From cb3447f554a77dab0a77360b5bc6c227adfaf153 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 2 May 2025 09:21:21 +0200 Subject: [PATCH 102/129] typo --- .../Topology/Compactness/CompactSystem.lean | 41 ++----------------- 1 file changed, 3 insertions(+), 38 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index b90d4673ed6eae..0afff800fc6916 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -29,7 +29,7 @@ system iff inserting `univ` gives a compact system. * `IsClosedCompact.isCompactSystem`: The set of closed and compact sets is a compact system. * `IsClosedCompact.isCompactSystem_of_T2Space`: In a `T2Space α`, the set of compact sets is a compact system in a `T2Space`. -* `IsCompactSystem.union.isConpactSystem`: If `IsCompactSystem p`, the set of finite unions +* `IsCompactSystem.union.isCompactSystem`: If `IsCompactSystem p`, the set of finite unions of `K : Set α` with `p K` is a compact system. * `IsCompactSystem.closedCompactSquareCylinders`: Closed and compact square cylinders form a compact system in a product space. @@ -50,36 +50,6 @@ end definition namespace IsCompactSystem -lemma iff (p : Set α → Prop) : IsCompactSystem p ↔ - ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ n, ⋂ k < n, C k ≠ ∅) → ⋂ i, C i ≠ ∅ := by - refine ⟨fun h C hi ↦ ?_, fun h C hi ↦ ?_⟩ - · rw [← not_imp_not] - push_neg - intro h' - specialize h C hi h' - obtain ⟨n, hn⟩ := h - use n + 1 - rw [Dissipate] at hn - conv => - lhs - enter [1] - intro j - rw [Nat.lt_add_one_iff] - exact hn - · rw [← not_imp_not] - push_neg - simp_rw [nonempty_iff_ne_empty] - intro h' - apply h C hi - intro n hn - apply h' n - rw [← subset_empty_iff] at hn ⊢ - apply le_trans _ hn - rw [Dissipate] - intro x - rw [mem_iInter₂, mem_iInter₂] - exact fun h i hi ↦ h i hi.le - /-- In a compact system, given a countable family with empty intersection, we choose a finite subfamily with empty intersection. -/ noncomputable @@ -585,14 +555,9 @@ lemma mem_iff (s : Set α) : union p s ↔ ∃ L : Finset (Set α), s = ⋃₀ L simp only [mem_setOf_eq, Finset.finite_toSet, Finset.mem_coe, true_and] refine ⟨hL.2, hL.1.symm⟩ -example (s t : Set α) (hst : s ⊆ t) (hs : s.Nonempty) : t.Nonempty := by - exact Nonempty.mono hst hs - -example (s : Set α) : s ≠ ∅ ↔ s.Nonempty := by exact Iff.symm nonempty_iff_ne_empty - theorem isCompactSystem (p : Set α → Prop)(hp : IsCompactSystem p) : IsCompactSystem (union p) := by - have hp' := (IsCompactSystem.iff p).mp hp - rw [IsCompactSystem.iff] + have hp' := (IsCompactSystem.iff_of_not_empty p).mp hp + rw [IsCompactSystem.iff_of_not_empty] intro C hi simp_rw [mem_iff] at hi choose L' hL' using hi From 0bb15b05b1a1727a580ee46c4a4161baec73a8ae Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 2 May 2025 09:40:06 +0200 Subject: [PATCH 103/129] run mk_all --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index 249f85eb5731f2..547729242ba1d4 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6377,6 +6377,7 @@ import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.CompactlyCoherentSpace import Mathlib.Topology.Compactness.CompactlyGeneratedSpace import Mathlib.Topology.Compactness.CompactSystem +import Mathlib.Topology.Compactness.CompactlyGeneratedSpace import Mathlib.Topology.Compactness.DeltaGeneratedSpace import Mathlib.Topology.Compactness.Exterior import Mathlib.Topology.Compactness.HilbertCubeEmbedding From 420e12a6340a5acc084337605373fb2860a79eee Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 2 May 2025 11:38:56 +0200 Subject: [PATCH 104/129] merge cs --- Mathlib/Topology/Compactness/CompactSystem.lean | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 0afff800fc6916..c59f8a37855ed8 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -4,14 +4,9 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ import Mathlib.Data.Set.Dissipate -import Mathlib.Logic.IsEmpty import Mathlib.MeasureTheory.Constructions.Cylinders import Mathlib.Order.OmegaCompletePartialOrder import Mathlib.Topology.Separation.Hausdorff -import Mathlib.MeasureTheory.PiSystem -import Mathlib.MeasureTheory.Constructions.Cylinders -import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic - /-! # Compact systems. From e145e655de7c52136eaa368f192b08b1fc5ac51a Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sat, 3 May 2025 07:13:39 +0200 Subject: [PATCH 105/129] added Nat --- Mathlib/Topology/Compactness/CompactSystem.lean | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index c59f8a37855ed8..c3414df821138b 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -338,7 +338,8 @@ lemma nonempty (k : ℕ) (hc : ∀ N, ⋂ k < N, ⋃₀ (L k : Set (Set α)) ≠ simp only [Finset.not_nonempty_iff_eq_empty] at h apply hc apply iInter_eq_empty_iff.mpr fun x ↦ ⟨k, ?_⟩ - simp only [lt_add_iff_pos_right, lt_one_iff, pos_of_gt, iInter_true] + -- simp only [Nat.lt_add_one, iInter_true, mem_sUnion, Finset.mem_coe, not_exists, not_and] + simp only [Nat.lt_add_one, iInter_true, Finset.mem_coe, not_exists, not_and] have hg : ⋃₀ (L k : Set (Set α)) = ∅ := by rw [h] simp only [Finset.coe_empty, sUnion_empty] @@ -386,7 +387,7 @@ lemma get_element_succ' (n : ℕ) have h' := h i (le_trans hi (le_succ n)) simp only [ne_eq, hi.ne, not_false_eq_true, Function.update_of_ne] at h' exact h' - · have h'' := h n (lt_add_one n) + · have h'' := h n (Nat.lt_add_one n) simp only [Function.update_self] at h'' exact h'' · intro i hi @@ -412,7 +413,7 @@ lemma get_element_succ' (n : ℕ) intro k hk have hk' : 1 + k < b' K0Max + 1:= by rw [add_comm] - simp only [add_lt_add_iff_right] + simp only [Nat.add_lt_add_iff_right] apply lt_of_lt_of_le hk rw [hb''] apply hK0₂ i hi.1 @@ -450,7 +451,8 @@ lemma constantEventually' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n by_cases h' : k < n · rw [← hn h'] exact (constantEventually L h n k h').symm - · have hkn' : k = n := by linarith + · have hkn' : k = n := by + exact Nat.eq_of_lt_succ_of_not_lt hkn h' rw [hkn'] lemma constantEventually'' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (m n k : ℕ) @@ -470,7 +472,7 @@ noncomputable def mem_of_union (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅ namespace mem_of_union lemma prop₀ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : mem_of_union L h n ∈ L n := by - exact (mem_of_union_aux L h (n + 1)).2.1 n (lt_add_one n) + exact (mem_of_union_aux L h (n + 1)).2.1 n (Nat.lt_add_one n) lemma isSubset (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n N : ℕ) : (⋂ j < n, mem_of_union L h j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ⊆ From 8235dc36a086422c4c7ec044be54b4acb6c418ae Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 2 May 2025 23:20:26 +0200 Subject: [PATCH 106/129] deleted double thm --- .../Constructions/Cylinders.lean | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Mathlib/MeasureTheory/Constructions/Cylinders.lean b/Mathlib/MeasureTheory/Constructions/Cylinders.lean index 6729d5bebb9ab9..ccfc91603cdd76 100644 --- a/Mathlib/MeasureTheory/Constructions/Cylinders.lean +++ b/Mathlib/MeasureTheory/Constructions/Cylinders.lean @@ -375,16 +375,23 @@ theorem diff_mem_measurableCylinders (hs : s ∈ measurableCylinders α) rw [diff_eq_compl_inter] exact inter_mem_measurableCylinders (compl_mem_measurableCylinders ht) hs -/-- The measurable cylinders are a ring. -/ -theorem isSetRing_measurableCylinders : IsSetRing (measurableCylinders α) where + +section MeasurableCylinders + +lemma isSetAlgebra_measurableCylinders : IsSetAlgebra (measurableCylinders α) where empty_mem := empty_mem_measurableCylinders α - union_mem := fun _ _ ↦ union_mem_measurableCylinders - diff_mem := fun _ _ ↦ diff_mem_measurableCylinders + compl_mem _ := compl_mem_measurableCylinders + union_mem _ _ := union_mem_measurableCylinders + +lemma isSetRing_measurableCylinders : IsSetRing (measurableCylinders α) := + isSetAlgebra_measurableCylinders.isSetRing -/-- The measurable cylinders are a semiring. -/ -theorem isSetSemiring_measurableCylinders : MeasureTheory.IsSetSemiring (measurableCylinders α) := +lemma isSetSemiring_measurableCylinders : MeasureTheory.IsSetSemiring (measurableCylinders α) := isSetRing_measurableCylinders.isSetSemiring +end MeasurableCylinders + + theorem iUnion_le_mem_measurableCylinders {s : ℕ → Set (∀ i : ι, α i)} (hs : ∀ n, s n ∈ measurableCylinders α) (n : ℕ) : (⋃ i ≤ n, s i) ∈ measurableCylinders α := From fb6f48572112526d2d2397f18080438f1a5e238d Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sat, 3 May 2025 07:28:50 +0200 Subject: [PATCH 107/129] added docstring union --- Mathlib/Topology/Compactness/CompactSystem.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index c3414df821138b..fb89441dbf63f0 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -533,6 +533,7 @@ lemma prop₁N0 (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : end mem_of_union +/-- Finite unions of sets in a compact system. -/ def union (p : Set α → Prop) : Set α → Prop := (sUnion '' ({ L : Set (Set α) | L.Finite ∧ ∀ K ∈ L, p K})) From b4b9484cd9d2ad6347fb2316d2e56d0112a74d6c Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Wed, 28 May 2025 22:11:05 +0200 Subject: [PATCH 108/129] added prefixINduction --- .../Topology/Compactness/CompactSystem.lean | 60 +++++++++++++++++-- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index fb89441dbf63f0..b6d862b3318b79 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -7,6 +7,7 @@ import Mathlib.Data.Set.Dissipate import Mathlib.MeasureTheory.Constructions.Cylinders import Mathlib.Order.OmegaCompletePartialOrder import Mathlib.Topology.Separation.Hausdorff + /-! # Compact systems. @@ -30,6 +31,52 @@ system iff inserting `univ` gives a compact system. compact system in a product space. -/ +section PrefixInduction + +variable {α : Type} +variable (q : ∀ n, (Fin n → α) → Prop) +variable (step0 : q 0 Fin.elim0) +variable (step : + ∀ n (k : Fin n → α) (_ : q n k), + { a : α // q (n+1) (Fin.snoc k a)}) + +def Nat.prefixInduction.aux : ∀ (n : Nat), { k : Fin n -> α // q n k } + | 0 => ⟨Fin.elim0, step0⟩ + | n+1 => + let ⟨k, hk⟩ := aux n + let ⟨a, ha⟩ := step n k hk + ⟨Fin.snoc k a, ha⟩ + +theorem Nat.prefixInduction.auxConsistent : + ∀ n (i : Fin n), + (Nat.prefixInduction.aux q step0 step (i+1)).1 (Fin.last i) = + (Nat.prefixInduction.aux q step0 step n).1 i := by + intro n + induction n + next => simp + next n ih => + apply Fin.lastCases + case last => simp + case cast => + intro i + simp only [Fin.coe_castSucc] + rw [ih, aux] + simp + +def Nat.prefixInduction (n : Nat) : α := + (Nat.prefixInduction.aux q step0 step (n+1)).1 (Fin.last n) + +theorem Nat.prefixInduction_spec (n : Nat) : q n (Nat.prefixInduction q step0 step ·) := by + cases n + next => + convert step0 + next n => + have hk := (Nat.prefixInduction.aux q step0 step (n+1)).2 + convert hk with i + apply Nat.prefixInduction.auxConsistent + +end PrefixInduction + open Set Nat MeasureTheory variable {α : Type*} {p : Set α → Prop} {C : ℕ → Set α} @@ -348,10 +395,15 @@ lemma nonempty (k : ℕ) (hc : ∀ N, ⋂ k < N, ⋃₀ (L k : Set (Set α)) ≠ /-- `q n K` is the joint property that `(∀ k < n, K k ∈ L k)` and `r n K)` holds. -/ def q : ℕ → (ℕ → Set α) → Prop := fun n K ↦ (∀ k < n, K k ∈ L k) ∧ (r L n K) -lemma get_element_zero (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : +lemma get_element_zero' (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : ∃ (K : ℕ → Set α), q L 0 K := by simp [q, r, h] +def get_element_zero (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : + { K : ℕ → Set α // q L 0 K} := by + exists fun _ => ∅ + simp [q, r, h] + lemma get_element_succ' (n : ℕ) (K : ℕ → Set α) (hK : q L n K) : ∃ y, q L (n + 1) (Function.update K n y) := by simp_rw [q, r] at hK ⊢ @@ -430,8 +482,8 @@ lemma get_element_succ' (n : ℕ) Constructing `(mem_of_union_aux h n).1` works inductively. When constructing `(mem_of_union_aux h (n + 1)).1`, we update `(mem_of_union_aux h n).1` only at position `n`. -/ noncomputable def mem_of_union_aux (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : - (n : ℕ) → ((K : ℕ → Set α) ×' (q L n K)) - | 0 => ⟨(get_element_zero L h).choose, (get_element_zero L h).choose_spec⟩ + (n : ℕ) → {K : ℕ → Set α | q L n K} + | 0 => get_element_zero L h | n + 1 => by have g := (get_element_succ' L) n (mem_of_union_aux h n).1 (mem_of_union_aux h n).2 exact ⟨Function.update (mem_of_union_aux h n).1 n g.choose, g.choose_spec⟩ @@ -508,7 +560,7 @@ lemma has_p (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p lemma prop₁ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : ∀ N, (⋂ (j < n), (mem_of_union L h j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ := by - have h' : r L n (mem_of_union_aux L h n).fst := (mem_of_union_aux L h n).2.2 + have h' : r L n (mem_of_union_aux L h n).val := (mem_of_union_aux L h n).2.2 simp only [r] at h' simp only [mem_of_union] intro N From 4fad8dc90c68d400ae0faa3320499b40af0e54c3 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 30 May 2025 22:31:02 +0200 Subject: [PATCH 109/129] halfway --- .../Topology/Compactness/CompactSystem.lean | 144 ++++++++++++------ 1 file changed, 96 insertions(+), 48 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index b6d862b3318b79..90e89cb4d6a95f 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -31,52 +31,6 @@ system iff inserting `univ` gives a compact system. compact system in a product space. -/ -section PrefixInduction - -variable {α : Type} -variable (q : ∀ n, (Fin n → α) → Prop) -variable (step0 : q 0 Fin.elim0) -variable (step : - ∀ n (k : Fin n → α) (_ : q n k), - { a : α // q (n+1) (Fin.snoc k a)}) - -def Nat.prefixInduction.aux : ∀ (n : Nat), { k : Fin n -> α // q n k } - | 0 => ⟨Fin.elim0, step0⟩ - | n+1 => - let ⟨k, hk⟩ := aux n - let ⟨a, ha⟩ := step n k hk - ⟨Fin.snoc k a, ha⟩ - -theorem Nat.prefixInduction.auxConsistent : - ∀ n (i : Fin n), - (Nat.prefixInduction.aux q step0 step (i+1)).1 (Fin.last i) = - (Nat.prefixInduction.aux q step0 step n).1 i := by - intro n - induction n - next => simp - next n ih => - apply Fin.lastCases - case last => simp - case cast => - intro i - simp only [Fin.coe_castSucc] - rw [ih, aux] - simp - -def Nat.prefixInduction (n : Nat) : α := - (Nat.prefixInduction.aux q step0 step (n+1)).1 (Fin.last n) - -theorem Nat.prefixInduction_spec (n : Nat) : q n (Nat.prefixInduction q step0 step ·) := by - cases n - next => - convert step0 - next n => - have hk := (Nat.prefixInduction.aux q step0 step (n+1)).2 - convert hk with i - apply Nat.prefixInduction.auxConsistent - -end PrefixInduction - open Set Nat MeasureTheory variable {α : Type*} {p : Set α → Prop} {C : ℕ → Set α} @@ -343,8 +297,104 @@ theorem _of_isCompact_of_T2Space [T2Space α] : end ClosedCompact +end IsCompactSystem + +section PrefixInduction + +variable {α : Type} +variable (q : ∀ n, (Fin n → α) → Prop) +variable (step0 : q 0 Fin.elim0) +variable (step : + ∀ n (k : Fin n → α) (_ : q n k), + { a : α // q (n+1) (Fin.snoc k a)}) + +/-- In this section, we prove a general induction principle, which we need for the construction +`Nat.prefixInduction q step0 step : ℕ → α` based on some `q : (n : ℕ) → (Fin n → α) → Prop`. For +the inducation start, `step0 : q 0 _` requires that `Fin 0` cannot be satisfied, and +`step : (n : ℕ) → (k : Fin n → α) → q n k → { a // q (n + 1) (Fin.snoc k a) }) (n : ℕ) : α` +constructs the next element satisfying `q (n + 1) _` from a proof of `q n k` and finding the next +element. + +In comparisong to other induction principles, the proofs of `q n k` are needed in order to find +the next element. -/ + +def Nat.prefixInduction.aux : ∀ (n : Nat), { k : Fin n -> α // q n k } + | 0 => ⟨Fin.elim0, step0⟩ + | n+1 => + let ⟨k, hk⟩ := aux n + let ⟨a, ha⟩ := step n k hk + ⟨Fin.snoc k a, ha⟩ + +theorem Nat.prefixInduction.auxConsistent : + ∀ n (i : Fin n), + (Nat.prefixInduction.aux q step0 step (i+1)).1 (Fin.last i) = + (Nat.prefixInduction.aux q step0 step n).1 i := by + intro n + induction n + next => simp + next n ih => + apply Fin.lastCases + case last => simp + case cast => + intro i + simp only [Fin.coe_castSucc] + rw [ih, aux] + simp + +def Nat.prefixInduction (n : Nat) : α := + (Nat.prefixInduction.aux q step0 step (n+1)).1 (Fin.last n) + +theorem Nat.prefixInduction_spec (n : Nat) : q n (Nat.prefixInduction q step0 step ·) := by + cases n + next => + convert step0 + next n => + have hk := (Nat.prefixInduction.aux q step0 step (n+1)).2 + convert hk with i + apply Nat.prefixInduction.auxConsistent + +end PrefixInduction + +namespace IsCompactSystem + section Union +variable {p : Set α → Prop} (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) + (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) + +/-- `q n K` is the joint property that `∀ (k : Fin n), K k ∈ L k` and +`∀ N, (⋂ (j : Fin n), K j) ∩ (⋂ (k < N), ⋃₀ (L (n + k)).toSet) ≠ ∅`.` holds. -/ +def q : ∀ n, (Fin n → Set α) → Prop := fun n K ↦ (∀ (k : Fin n), K k ∈ L k) ∧ + (∀ N, (⋂ j, K j) ∩ (⋂ (k < N), ⋃₀ (L (n + k)).toSet) ≠ ∅) + +def get_element_zero (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : + { K : Fin 0 → Set α // (q L) 0 K} := by + exists fun _ => ∅ + simp [q, h] + +def find0 (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : (q L) 0 Fin.elim0 := by + sorry + +def findSucc (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : ∀ n (k : Fin n → Set α) + (_ : (q L) n k), { a : Set α // (q L) (n + 1) (Fin.snoc k a) } := by + sorry +-- ∀ n (k : Fin n → α) (_ : q n k), { a : α // q (n+1) (Fin.snoc k a)}) + + + +/-- For `L : ℕ → Finset (Set α)` such that `∀ K ∈ L n, p K` and +`h : ∀ N, ⋂ k < N, ⋃₀ L k ≠ ∅`, `mem_of_union h n` is some `K : ℕ → Set α` such that `K n ∈ L n` +for all `n` (this is `prop₀`) and `∀ N, ⋂ (j < n, K j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ≠ ∅` +(this is `prop₁`.) -/ +noncomputable def mem_of_union (L : ℕ → Finset (Set α)) (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) := + Nat.prefixInduction (q L) (find0 L h) (findSucc L h) + + +#exit + + + + lemma l2 {ι : Type*} (s t : Set α) (u : Set ι) (L : (i : ι) → (hi : i ∈ u) → Set α) (h : s ⊆ ⋃ (n : ι) (hn : n ∈ u), L n hn) (h' : ∀ (n : ι) (hn : n ∈ u), t ∩ (L n hn) = ∅) : t ∩ s = ∅ := by @@ -358,8 +408,6 @@ lemma l2 {ι : Type*} (s t : Set α) (u : Set ι) (L : (i : ι) → (hi : i ∈ have gf := inter_subset_inter (t₁ := t) (fun ⦃a_1⦄ a ↦ a) h apply le_trans gf j -variable {p : Set α → Prop} (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) - (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) -- variable (p : {n : ℕ} → ((k : Fin (n + 1)) → (β k)) → Prop) From 4bebc1b7d631937610323ef3a889287c7b33729d Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Tue, 27 May 2025 17:36:44 +0200 Subject: [PATCH 110/129] small --- .../Topology/Compactness/CompactSystem.lean | 515 ++---------------- 1 file changed, 55 insertions(+), 460 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 90e89cb4d6a95f..52ffcc0c917b91 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ import Mathlib.Data.Set.Dissipate +import Mathlib.Logic.IsEmpty import Mathlib.MeasureTheory.Constructions.Cylinders import Mathlib.Order.OmegaCompletePartialOrder import Mathlib.Topology.Separation.Hausdorff @@ -288,422 +289,26 @@ theorem isCompacts (h : ∀ {s : Set α}, IsCompact s → IsClosed s) : IsCompactSystem (fun s : Set α ↦ IsCompact s) := by have h : (fun s : Set α ↦ IsCompact s) = (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by ext s - refine ⟨fun h' ↦ ⟨h', h h'⟩, fun h' ↦ h'.1⟩ - exact h ▸ (isClosedCompacts α) + refine ⟨fun h' ↦ ⟨h', h'.isClosed⟩, fun h ↦ h.1⟩ + exact h ▸ (of_isCompact_isClosed) -/-- In a `T2Space` The set of compact sets is a compact system. -/ -theorem _of_isCompact_of_T2Space [T2Space α] : - IsCompactSystem (fun s : Set α ↦ IsCompact s) := (isCompacts α) (fun hs ↦ hs.isClosed) - -end ClosedCompact - -end IsCompactSystem - -section PrefixInduction - -variable {α : Type} -variable (q : ∀ n, (Fin n → α) → Prop) -variable (step0 : q 0 Fin.elim0) -variable (step : - ∀ n (k : Fin n → α) (_ : q n k), - { a : α // q (n+1) (Fin.snoc k a)}) - -/-- In this section, we prove a general induction principle, which we need for the construction -`Nat.prefixInduction q step0 step : ℕ → α` based on some `q : (n : ℕ) → (Fin n → α) → Prop`. For -the inducation start, `step0 : q 0 _` requires that `Fin 0` cannot be satisfied, and -`step : (n : ℕ) → (k : Fin n → α) → q n k → { a // q (n + 1) (Fin.snoc k a) }) (n : ℕ) : α` -constructs the next element satisfying `q (n + 1) _` from a proof of `q n k` and finding the next -element. - -In comparisong to other induction principles, the proofs of `q n k` are needed in order to find -the next element. -/ - -def Nat.prefixInduction.aux : ∀ (n : Nat), { k : Fin n -> α // q n k } - | 0 => ⟨Fin.elim0, step0⟩ - | n+1 => - let ⟨k, hk⟩ := aux n - let ⟨a, ha⟩ := step n k hk - ⟨Fin.snoc k a, ha⟩ - -theorem Nat.prefixInduction.auxConsistent : - ∀ n (i : Fin n), - (Nat.prefixInduction.aux q step0 step (i+1)).1 (Fin.last i) = - (Nat.prefixInduction.aux q step0 step n).1 i := by - intro n - induction n - next => simp - next n ih => - apply Fin.lastCases - case last => simp - case cast => - intro i - simp only [Fin.coe_castSucc] - rw [ih, aux] - simp - -def Nat.prefixInduction (n : Nat) : α := - (Nat.prefixInduction.aux q step0 step (n+1)).1 (Fin.last n) - -theorem Nat.prefixInduction_spec (n : Nat) : q n (Nat.prefixInduction q step0 step ·) := by - cases n - next => - convert step0 - next n => - have hk := (Nat.prefixInduction.aux q step0 step (n+1)).2 - convert hk with i - apply Nat.prefixInduction.auxConsistent - -end PrefixInduction - -namespace IsCompactSystem - -section Union - -variable {p : Set α → Prop} (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) - (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) - -/-- `q n K` is the joint property that `∀ (k : Fin n), K k ∈ L k` and -`∀ N, (⋂ (j : Fin n), K j) ∩ (⋂ (k < N), ⋃₀ (L (n + k)).toSet) ≠ ∅`.` holds. -/ -def q : ∀ n, (Fin n → Set α) → Prop := fun n K ↦ (∀ (k : Fin n), K k ∈ L k) ∧ - (∀ N, (⋂ j, K j) ∩ (⋂ (k < N), ⋃₀ (L (n + k)).toSet) ≠ ∅) - -def get_element_zero (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : - { K : Fin 0 → Set α // (q L) 0 K} := by - exists fun _ => ∅ - simp [q, h] - -def find0 (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : (q L) 0 Fin.elim0 := by - sorry - -def findSucc (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : ∀ n (k : Fin n → Set α) - (_ : (q L) n k), { a : Set α // (q L) (n + 1) (Fin.snoc k a) } := by - sorry --- ∀ n (k : Fin n → α) (_ : q n k), { a : α // q (n+1) (Fin.snoc k a)}) - - - -/-- For `L : ℕ → Finset (Set α)` such that `∀ K ∈ L n, p K` and -`h : ∀ N, ⋂ k < N, ⋃₀ L k ≠ ∅`, `mem_of_union h n` is some `K : ℕ → Set α` such that `K n ∈ L n` -for all `n` (this is `prop₀`) and `∀ N, ⋂ (j < n, K j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ≠ ∅` -(this is `prop₁`.) -/ -noncomputable def mem_of_union (L : ℕ → Finset (Set α)) (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) := - Nat.prefixInduction (q L) (find0 L h) (findSucc L h) - - -#exit - - - - -lemma l2 {ι : Type*} (s t : Set α) (u : Set ι) (L : (i : ι) → (hi : i ∈ u) → Set α) - (h : s ⊆ ⋃ (n : ι) (hn : n ∈ u), L n hn) (h' : ∀ (n : ι) (hn : n ∈ u), t ∩ (L n hn) = ∅) : - t ∩ s = ∅ := by - have j : ⋃ (n : ι) (hn : n ∈ u), t ∩ (L n hn) = ∅ := by - simp_rw [iUnion_eq_empty] - exact h' - simp_rw [← subset_empty_iff] at h' j ⊢ - have j' : ⋃ (n : u), t ∩ L n.val n.prop = ⋃ n, ⋃ (hn : n ∈ u), t ∩ L n hn := by - exact iUnion_coe_set u fun i ↦ t ∩ L (↑i) (Subtype.prop i) - rw [← j', ← inter_iUnion, iUnion_coe_set] at j - have gf := inter_subset_inter (t₁ := t) (fun ⦃a_1⦄ a ↦ a) h - apply le_trans gf j - - --- variable (p : {n : ℕ} → ((k : Fin (n + 1)) → (β k)) → Prop) - -/-- `r n K` is the property which must hold for compact systems: -`∀ N, (⋂ (j < n), (K j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅`. -/ -noncomputable def r (n : ℕ) (K : ℕ → Set α) : Prop := - ∀ N, (⋂ (j < n), (K j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ - --- h0 -> (get_element_zero hL hc) --- (h0 : ∃ x : (ℕ → α), x 0 ∈ β 0 ∧ p 0 x) - -lemma nonempty' (n : ℕ) (K : ℕ → Set α) - (hc : ∀ N, (⋂ (k < n), K k) ∩ (⋂ k < N, ⋃₀ (L (n + k))) ≠ ∅) : (L n).Nonempty := by - specialize hc 1 - by_contra! h - simp only [Finset.not_nonempty_iff_eq_empty] at h - apply hc - simp [h] - -lemma nonempty (k : ℕ) (hc : ∀ N, ⋂ k < N, ⋃₀ (L k : Set (Set α)) ≠ ∅) : (L k).Nonempty := by - specialize hc (k + 1) - by_contra! h - simp only [Finset.not_nonempty_iff_eq_empty] at h - apply hc - apply iInter_eq_empty_iff.mpr fun x ↦ ⟨k, ?_⟩ - -- simp only [Nat.lt_add_one, iInter_true, mem_sUnion, Finset.mem_coe, not_exists, not_and] - simp only [Nat.lt_add_one, iInter_true, Finset.mem_coe, not_exists, not_and] - have hg : ⋃₀ (L k : Set (Set α)) = ∅ := by - rw [h] - simp only [Finset.coe_empty, sUnion_empty] - exact of_eq_false (congrFun hg x) - -/-- `q n K` is the joint property that `(∀ k < n, K k ∈ L k)` and `r n K)` holds. -/ -def q : ℕ → (ℕ → Set α) → Prop := fun n K ↦ (∀ k < n, K k ∈ L k) ∧ (r L n K) - -lemma get_element_zero' (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : - ∃ (K : ℕ → Set α), q L 0 K := by - simp [q, r, h] - -def get_element_zero (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : - { K : ℕ → Set α // q L 0 K} := by - exists fun _ => ∅ - simp [q, r, h] - -lemma get_element_succ' (n : ℕ) - (K : ℕ → Set α) (hK : q L n K) : ∃ y, q L (n + 1) (Function.update K n y) := by - simp_rw [q, r] at hK ⊢ - by_contra! h - choose b hb using h - have hn : ∀ y ∈ L n, ∀ k < n + 1, Function.update K n y k ∈ L k := by - intro y hy k hk - by_cases d : n = k - · rw [d] - simp only [Function.update_self] - exact d ▸ hy - · have d' : k < n := by - by_contra h - apply d - simp only [not_lt] at h - apply Eq.symm - exact Nat.eq_of_le_of_lt_succ h hk - simp only [ne_eq, d'.ne, not_false_eq_true, Function.update_of_ne] - exact hK.1 k d' - classical - let b' := fun y ↦ dite (y ∈ L n) (fun hy ↦ (b y (hn y hy))) (fun _ ↦ 0) - have hb' := fun y hy ↦ hb y (hn y hy) - have hb'' (y : Set α) (hy : y ∈ L n) : b y (hn y hy) = b' y := by - simp [b', hy] - obtain ⟨K0Max, ⟨hK0₁, hK0₂⟩⟩ := Finset.exists_max_image (L n) b' (nonempty' L n K hK.2) - apply hK.2 (b' K0Max + 1) - have h₁ (y s : Set α): (⋂ j, ⋂ (_ : j < n + 1), Function.update K n y j) ∩ s = - (⋂ j, ⋂ (_ : j < n), K j) ∩ y ∩ s := by - apply congrFun (congrArg Inter.inter _) s - ext x - refine ⟨fun h ↦ ⟨?_, ?_⟩, fun h ↦ ?_⟩ <;> simp only [mem_iInter, mem_inter_iff] at h ⊢ - · intro i hi - have h' := h i (le_trans hi (le_succ n)) - simp only [ne_eq, hi.ne, not_false_eq_true, Function.update_of_ne] at h' - exact h' - · have h'' := h n (Nat.lt_add_one n) - simp only [Function.update_self] at h'' - exact h'' - · intro i hi - by_cases h₁ : i < n - · simp only [ne_eq, h₁.ne, not_false_eq_true, Function.update_of_ne] - exact h.1 i h₁ - · simp only [not_lt] at h₁ - have h₂ := Nat.eq_of_le_of_lt_succ h₁ hi - rw [h₂] - simp only [Function.update_self] - exact h.2 - simp_rw [h₁] at hb' - - have h₂ : ⋂ k < b' K0Max + 1, ⋃₀ (L (n + k)).toSet ⊆ - ⋃ (y : Set α) (hy : y ∈ L n), y ∩ ⋂ (k < b y (hn y hy)), ⋃₀ (L (n + 1 + k)).toSet := by - obtain ⟨y, hy⟩ := nonempty' L n K hK.2 - intro x hx - simp only [mem_iInter, mem_sUnion, Finset.mem_coe, mem_iUnion, mem_inter_iff, - exists_and_left] at hx ⊢ - obtain ⟨i, hi⟩ := hx 0 (zero_lt_succ (b' K0Max)) - rw [add_zero] at hi - use i, hi.2, hi.1 - intro k hk - have hk' : 1 + k < b' K0Max + 1:= by - rw [add_comm] - simp only [Nat.add_lt_add_iff_right] - apply lt_of_lt_of_le hk - rw [hb''] - apply hK0₂ i hi.1 - exact hi.1 - obtain ⟨t, ht⟩ := hx (1 + k) hk' - rw [← add_assoc] at ht - use t, ht.1, ht.2 - simp_rw [inter_assoc] at hb' - apply l2 (s := ⋂ k < b' K0Max + 1, ⋃₀ (L (n + k)).toSet) (t := (⋂ j < n, K j)) (u := L n) - (L := fun (y : Set α) (hy : y ∈ L n) ↦ (y ∩ ⋂ k, ⋂ (hk : k < b y (hn y hy)), - ⋃₀ (L (n + 1 + k)).toSet)) h₂ hb' - -/-- `mem_of_union_aux h n` is the product of some `K : ℕ → Set α)` and `q n K`. -Constructing `(mem_of_union_aux h n).1` works inductively. When constructing -`(mem_of_union_aux h (n + 1)).1`, we update `(mem_of_union_aux h n).1` only at position `n`. -/ -noncomputable def mem_of_union_aux (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : - (n : ℕ) → {K : ℕ → Set α | q L n K} - | 0 => get_element_zero L h - | n + 1 => by - have g := (get_element_succ' L) n (mem_of_union_aux h n).1 (mem_of_union_aux h n).2 - exact ⟨Function.update (mem_of_union_aux h n).1 n g.choose, g.choose_spec⟩ - -namespace mem_of_union - -lemma constantEventually (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n k : ℕ) (hkn : k < n) : - (mem_of_union_aux L h n).1 k = (mem_of_union_aux L h (n + 1)).1 k := by - simp [mem_of_union_aux, hkn.ne] - -lemma constantEventually' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n k : ℕ) (hkn : k < n) : - (mem_of_union_aux L h n).1 k = (mem_of_union_aux L h (k + 1)).1 k := by - induction n with - | zero => - cases hkn - | succ n hn => - by_cases h' : k < n - · rw [← hn h'] - exact (constantEventually L h n k h').symm - · have hkn' : k = n := by - exact Nat.eq_of_lt_succ_of_not_lt hkn h' - rw [hkn'] - -lemma constantEventually'' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (m n k : ℕ) - (hkn : k < n) (hkm : k < m) : (mem_of_union_aux L h n).1 k - = (mem_of_union_aux L h m).1 k := by - rw [constantEventually' L h n k hkn, constantEventually' L h m k hkm] - -end mem_of_union - -/-- For `L : ℕ → Finset (Set α)` such that `∀ K ∈ L n, p K` and -`h : ∀ N, ⋂ k < N, ⋃₀ L k ≠ ∅`, `mem_of_union h n` is some `K : ℕ → Set α` such that `K n ∈ L n` -for all `n` (this is `prop₀`) and `∀ N, ⋂ (j < n, K j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ≠ ∅` -(this is `prop₁`.) -/ -noncomputable def mem_of_union (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) := - fun n ↦ (mem_of_union_aux L h (n + 1)).1 n - -namespace mem_of_union - -lemma prop₀ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : mem_of_union L h n ∈ L n := by - exact (mem_of_union_aux L h (n + 1)).2.1 n (Nat.lt_add_one n) - -lemma isSubset (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n N : ℕ) : - (⋂ j < n, mem_of_union L h j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ⊆ - ⋂ (k < n + N), (⋃₀ (L k).toSet) := by - have h' : ⋂ (k < n + N), (⋃₀ (L k).toSet) = - (⋂ (k < n), (⋃₀ (L k).toSet)) ∩ ⋂ (k < N), (⋃₀ (L (n + k)).toSet) := by - ext x - simp only [mem_iInter, mem_sUnion, Finset.mem_coe, mem_inter_iff] - refine ⟨fun h ↦ ⟨fun i hi ↦ ?_, fun i hi ↦ ?_⟩, fun h i hi ↦ ?_⟩ - · refine h i (lt_of_lt_of_le hi (Nat.le_add_right n N)) - · refine h (n + i) (Nat.add_lt_add_left hi n) - · by_cases hin : i < n - · exact h.1 i hin - · have h₁ : i - n < N := Nat.sub_lt_left_of_lt_add (Nat.le_of_not_lt hin) hi - have h₂ : n + (i - n) = i := by - exact add_sub_of_le <| Nat.le_of_not_lt hin - exact h₂ ▸ h.2 (i - n) h₁ - rw [h'] - apply inter_subset_inter _ fun ⦃a⦄ a ↦ a - have h'' (j : ℕ) (hj : j < n) : mem_of_union L h j ⊆ ⋃₀ (L j).toSet := by - exact subset_sUnion_of_mem <| prop₀ L h j - exact iInter₂_mono h'' - -lemma isSubsetN0 (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : - (⋂ j, mem_of_union L h j) ⊆ - ⋂ k, (⋃₀ (L k).toSet) := by - exact iInter_mono <| fun n ↦ - subset_sUnion_of_subset (↑(L n)) (mem_of_union L h n) (fun ⦃a⦄ a ↦ a) (prop₀ L h n) - -lemma has_p (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) - (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : p (mem_of_union L h n) := by - exact hL n (mem_of_union L h n) (prop₀ L h n) - -lemma prop₁ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : - ∀ N, (⋂ (j < n), (mem_of_union L h j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ := by - have h' : r L n (mem_of_union_aux L h n).val := (mem_of_union_aux L h n).2.2 - simp only [r] at h' - simp only [mem_of_union] - intro N - specialize h' N - conv at h' => - lhs - enter [1,1] - intro j - enter[1] - intro hj - rw [constantEventually' L h n j hj] - exact h' - -lemma prop₁N0 (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : - (⋂ (j < n), (mem_of_union L h j)) ≠ ∅ := by - have h' : (⋂ (k < 0), (⋃₀ (L (n + k)).toSet)) = univ := by - simp - have d (s : Set α) : s = s ∩ univ := by exact left_eq_inter.mpr fun ⦃a⦄ a ↦ trivial - rw [d (⋂ j, ⋂ (_ : j < n), mem_of_union L h j)] - rw [← h'] - exact prop₁ L h n 0 - -end mem_of_union - -/-- Finite unions of sets in a compact system. -/ -def union (p : Set α → Prop) : Set α → Prop := - (sUnion '' ({ L : Set (Set α) | L.Finite ∧ ∀ K ∈ L, p K})) - -namespace union - -lemma mem_iff (s : Set α) : union p s ↔ ∃ L : Finset (Set α), s = ⋃₀ L ∧ ∀ K ∈ L, p K := by - refine ⟨fun ⟨L, hL⟩ ↦ ?_, fun h ↦ ?_⟩ - · simp only [mem_setOf_eq] at hL - let L' := (hL.1.1).toFinset - use L' - rw [← hL.2, Finite.coe_toFinset] - refine ⟨rfl, fun K hK ↦ ?_⟩ - rw [Finite.mem_toFinset] at hK - apply hL.1.2 K hK - · obtain ⟨L, hL⟩ := h - use L - simp only [mem_setOf_eq, Finset.finite_toSet, Finset.mem_coe, true_and] - refine ⟨hL.2, hL.1.symm⟩ - -theorem isCompactSystem (p : Set α → Prop)(hp : IsCompactSystem p) : IsCompactSystem (union p) := by - have hp' := (IsCompactSystem.iff_of_not_empty p).mp hp - rw [IsCompactSystem.iff_of_not_empty] - intro C hi - simp_rw [mem_iff] at hi - choose L' hL' using hi - have hL'1 := fun n ↦ (hL' n).1 - have hL'2 := fun n ↦ (hL' n).2 - simp_rw [hL'1] - intro hL - let K := mem_of_union L' hL - have h₁ : ⋂ i, K i ⊆ ⋂ i, ⋃₀ (L' i).toSet := by - apply mem_of_union.isSubsetN0 L' - have h₂ : ⋂ i, K i ≠ ∅ := by - apply hp' _ - · apply mem_of_union.has_p - exact hL'2 - · apply mem_of_union.prop₁N0 - rw [← nonempty_iff_ne_empty] at h₂ ⊢ - exact Nonempty.mono h₁ h₂ - -end union - -end Union - -end IsCompactSystem +end IsCompactIsClosed section pi variable {ι : Type*} {α : ι → Type*} +/- In a product space, the intersection of square cylinders is empty iff there is a coordinate `i` +such that the projections to `i` have empty intersection. -/ theorem iInter_pi_empty_iff {β : Type*} (s : β → Set ι) (t : β → (i : ι) → Set (α i)) : - ( ⋂ b, ((s b).pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β) (_: i ∈ s b), (t b i) = ∅):= by + (⋂ b, ((s b).pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β) (_: i ∈ s b), (t b i) = ∅):= by rw [iInter_eq_empty_iff, not_iff_not.symm] push_neg - refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ - · have ⟨x, hx⟩ := h - simp only [nonempty_iInter] - intro i - refine ⟨x i, fun j ↦ ?_⟩ - rw [mem_iInter] - intro hi - simp_rw [mem_pi] at hx - exact hx j i hi - · simp only [nonempty_iInter, mem_iInter] at h - choose x hx using h - use x - simp_rw [mem_pi] - intro i - intro j hj - exact hx j i hj + simp only [nonempty_iInter, mem_iInter] + refine ⟨fun ⟨x, hx⟩ i ↦ ?_, fun h ↦ ?_⟩ + · refine ⟨x i, fun j hi ↦ hx j i hi⟩ + · choose x hx using h + refine ⟨x, fun i j hj ↦ hx j i hj⟩ theorem iInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) : ( ⋂ b, (univ.pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β), (t b i) = ∅):= by @@ -720,7 +325,7 @@ theorem biInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α exact biInter_eq_iInter p fun x h ↦ t x i simp_rw [h, h', iInter_univ_pi_empty_iff] -theorem IsCompactSystem.pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : +theorem pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : IsCompactSystem (univ.pi '' univ.pi C) := by intro S hS h_empty change ∀ i, S i ∈ univ.pi '' univ.pi C at hS @@ -741,6 +346,8 @@ theorem IsCompactSystem.pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCo end pi +end IsCompactSystem + section ClosedCompactSquareCylinders variable {ι : Type*} {α : ι → Type*} @@ -750,95 +357,83 @@ variable [∀ i, TopologicalSpace (α i)] variable (α) /-- The set of sets of the form `s.pi t`, where `s : Finset ι` and `t i` is both, closed and compact, for all `i ∈ s`. -/ -def closedCompactSquareCylinders : Set (Set (Π i, α i)) := - ⋃ (s) (t) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), {squareCylinder s t} +def compactClosedSquareCylinders : Set (Set (Π i, α i)) := + ⋃ (s) (t) (_ : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)), {squareCylinder s t} + +def squareCylinders_of_prop (p : (i : ι) → Set (α i) → Prop) : Set (Set (Π i, α i)) := + ⋃ (s) (t) (_ : ∀ i ∈ s, p i (t i)), {squareCylinder s t} variable {α} @[simp] -theorem mem_closedCompactSquareCylinders (S : Set (Π i, α i)) : - S ∈ closedCompactSquareCylinders α - ↔ ∃ (s t : _) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), +theorem mem_compactClosedSquareCylinders_iff (S : Set (Π i, α i)) : + S ∈ compactClosedSquareCylinders α + ↔ ∃ (s t : _) (_ : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)), S = squareCylinder s t := by - simp_rw [closedCompactSquareCylinders, mem_iUnion, mem_singleton_iff] + simp_rw [compactClosedSquareCylinders, mem_iUnion, mem_singleton_iff] + variable {S : Set (Π i, α i)} /-- Given a closed compact cylinder, choose a finset of variables such that it only depends on these variables. -/ -noncomputable def closedCompactSquareCylinders.finset (hS : S ∈ closedCompactSquareCylinders α) : +noncomputable def compactClosedSquareCylinders.finset (hS : S ∈ compactClosedSquareCylinders α) : Finset ι := - ((mem_closedCompactSquareCylinders S).mp hS).choose + ((mem_compactClosedSquareCylinders_iff S).mp hS).choose /-- Given a closed compact square cylinder `S`, choose a dependent function `(i : ι) → Set (α i)` of which it is a lift. -/ -def closedCompactSquareCylinders.func (hS : S ∈ closedCompactSquareCylinders α) : +def closedCompactSquareCylinders.func (hS : S ∈ compactClosedSquareCylinders α) : (i : ι) → Set (α i) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose - -theorem closedCompactSquareCylinders.isClosed (hS : S ∈ closedCompactSquareCylinders α) : - ∀ i ∈ closedCompactSquareCylinders.finset hS, - IsClosed (closedCompactSquareCylinders.func hS i) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose + ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose -theorem closedCompactSquareCylinders.isCompact (hS : S ∈ closedCompactSquareCylinders α) : - ∀ i ∈ closedCompactSquareCylinders.finset hS, - IsCompact (closedCompactSquareCylinders.func hS i) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose +theorem compactClosedSquareCylinders.isCompact_isClosed (hS : S ∈ compactClosedSquareCylinders α) : + ∀ i ∈ compactClosedSquareCylinders.finset hS, + IsCompact (closedCompactSquareCylinders.func hS i) ∧ + IsClosed (closedCompactSquareCylinders.func hS i) := + ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose_spec.choose -theorem closedCompactSquareCylinders.eq_squareCylinder (hS : S ∈ closedCompactSquareCylinders α) : - S = squareCylinder (closedCompactSquareCylinders.finset hS) +theorem closedCompactSquareCylinders.eq_squareCylinder (hS : S ∈ compactClosedSquareCylinders α) : + S = squareCylinder (compactClosedSquareCylinders.finset hS) (closedCompactSquareCylinders.func hS) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose_spec + ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose_spec.choose_spec theorem squareCylinder_mem_closedCompactSquareCylinders (s : Finset ι) (t : (i : ι) → Set (α i)) - (hS_closed : ∀ i ∈ s, IsClosed (t i)) (hS_compact : ∀ i ∈ s, IsCompact (t i)) : - squareCylinder s t ∈ closedCompactSquareCylinders α := by - rw [mem_closedCompactSquareCylinders] - exact ⟨s, t, hS_closed, hS_compact, rfl⟩ - -/- -theorem mem_cylinder_of_mem_closedCompactSquareCylinders [∀ i, MeasurableSpace (α i)] - [∀ i, SecondCountableTopology (α i)] [∀ i, OpensMeasurableSpace (α i)] - (hS : S ∈ closedCompactSquareCylinders α) : - S ∈ measurableCylinders α := by - rw [mem_measurableSquareCylinders] - refine ⟨closedCompactCylinders.finset ht, closedCompactCylinders.set ht, ?_, ?_⟩ - · exact (closedCompactCylinders.isClosed ht).measurableSet - · exact closedCompactCylinders.eq_cylinder ht --/ + (h : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)) : + squareCylinder s t ∈ compactClosedSquareCylinders α := by + rw [mem_compactClosedSquareCylinders_iff] + exact ⟨s, t, h, rfl⟩ -theorem IsCompactSystem.CompactClosedOrUniv_pi : +theorem CompactClosedOrUniv_pi : IsCompactSystem (univ.pi '' univ.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by apply IsCompactSystem.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ))) - <| fun i ↦ IsCompactSystem.isClosedCompactOrUnivs (α i) + <| fun i ↦ IsCompactSystem.of_isCompact_isClosed_or_univ /-- In `closedCompactSquareCylinders α`, the set of dependent variables is a finset, but not necessarily in `univ.pi '' univ.pi _`, where `_` are closed compact set, or `univ`. -/ -theorem closedCompactSquareCylinders_supset (S : _) : - S ∈ closedCompactSquareCylinders α → S ∈ (univ.pi '' univ.pi +theorem compactClosedSquareCylinders_supset (S : _) : + S ∈ compactClosedSquareCylinders α → S ∈ (univ.pi '' univ.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by classical intro hS - simp_rw [mem_closedCompactSquareCylinders, squareCylinder] at hS + simp_rw [mem_compactClosedSquareCylinders_iff, squareCylinder] at hS simp only [mem_image, mem_pi, mem_univ, forall_const] obtain ⟨s, t, h_cl, h_co, h_pi⟩ := hS let t' := fun (i : ι) ↦ if (i ∈ s) then (t i) else univ - refine ⟨t', ?_, ?_⟩ - · intro i - by_cases hi : i ∈ s + refine ⟨t', fun i ↦ ?_, ?_⟩ + · by_cases hi : i ∈ s · simp only [hi, ↓reduceIte, t'] - exact Or.inl ⟨h_co i hi, h_cl i hi⟩ + exact Or.inl (h_cl i hi) · simp only [hi, ↓reduceIte, t'] apply Or.inr rfl - · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = S - rw [h_pi, univ_pi_ite s t] + · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = (s : Set ι).pi t + rw [univ_pi_ite s t] /-- Closed and compact square cylinders form a compact system. -/ -theorem IsCompactSystem.closedCompactSquareCylinders : - IsCompactSystem (closedCompactSquareCylinders α) := - IsCompactSystem.of_supset IsCompactSystem.CompactClosedOrUniv_pi - closedCompactSquareCylinders_supset +theorem isCompactSystem.compactClosedSquareCylinders : + IsCompactSystem (compactClosedSquareCylinders α) := + IsCompactSystem.mono CompactClosedOrUniv_pi + compactClosedSquareCylinders_supset end ClosedCompactSquareCylinders From 15b925a5f257e531186dd2836e84a8e225903128 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Wed, 28 May 2025 23:57:20 +0200 Subject: [PATCH 111/129] sq --- .../Topology/Compactness/CompactSystem.lean | 634 ++++++++++++------ 1 file changed, 439 insertions(+), 195 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 52ffcc0c917b91..3902eb3fb7296e 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -4,7 +4,6 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ import Mathlib.Data.Set.Dissipate -import Mathlib.Logic.IsEmpty import Mathlib.MeasureTheory.Constructions.Cylinders import Mathlib.Order.OmegaCompletePartialOrder import Mathlib.Topology.Separation.Hausdorff @@ -19,17 +18,19 @@ This file defines compact systems of sets. * `IsCompactSystem`: A set of sets is a compact system if, whenever a countable subfamily has empty intersection, then finitely many of them already have empty intersection. * `IsCompactSystem.union`: The set system of finite unions of another set system. +* `IsCompactSystem.union`: The set system of finite unions of another set system. ## Main results -* `IsCompactSystemiff_isCompactSystem_of_or_univ`: A set system is a compact -system iff inserting `univ` gives a compact system. * `IsClosedCompact.isCompactSystem`: The set of closed and compact sets is a compact system. * `IsClosedCompact.isCompactSystem_of_T2Space`: In a `T2Space α`, the set of compact sets is a compact system in a `T2Space`. * `IsCompactSystem.union.isCompactSystem`: If `IsCompactSystem p`, the set of finite unions of `K : Set α` with `p K` is a compact system. +* `IsCompactSystem.union.isCompactSystem`: If `IsCompactSystem p`, the set of finite unions + of `K : Set α` with `p K` is a compact system. * `IsCompactSystem.closedCompactSquareCylinders`: Closed and compact square cylinders form a compact system in a product space. + compact system in a product space. -/ open Set Nat MeasureTheory @@ -47,20 +48,21 @@ end definition namespace IsCompactSystem +/-- In a compact system, given a countable family with empty intersection, we choose a finite +subfamily with empty intersection. -/ /-- In a compact system, given a countable family with empty intersection, we choose a finite subfamily with empty intersection. -/ noncomputable -def finite_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) +def max_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) (hC_empty : ⋂ i, C i = ∅) : ℕ := - Nat.find (hp C hC hC_empty) + (hp C hC hC_empty).choose -open Classical in -lemma dissipate_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) +lemma iInter_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) (hC_empty : ⋂ i, C i = ∅) : - dissipate C (hp.finite_of_empty hC hC_empty) = ∅ := by - apply Nat.find_spec (hp C hC hC_empty) + Dissipate C (hp.max_of_empty hC hC_empty) = ∅ := + (hp C hC hC_empty).choose_spec -theorem iff_nonempty_iInter (p : Set α → Prop) : +theorem iff_of_nempty (p : Set α → Prop) : IsCompactSystem p ↔ (∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ (n : ℕ), (dissipate C n).Nonempty) → (⋂ i, C i).Nonempty) := by refine ⟨fun h C hC hn ↦ ?_, fun h C hC ↦ ?_⟩ <;> have h2 := not_imp_not.mpr <| h C hC @@ -71,9 +73,9 @@ theorem iff_nonempty_iInter (p : Set α → Prop) : /-- In this equivalent formulation for a compact system, note that we use `⋂ k < n, C k` rather than `⋂ k ≤ n, C k`. -/ -lemma iff_nonempty_iInter_of_lt (p : Set α → Prop) : IsCompactSystem p ↔ - ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ n, (⋂ k < n, C k).Nonempty) → (⋂ i, C i).Nonempty := by - simp_rw [iff_nonempty_iInter] +lemma iff_of_not_empty (p : Set α → Prop) : IsCompactSystem p ↔ + ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ n, ⋂ k < n, C k ≠ ∅) → ⋂ i, C i ≠ ∅ := by + simp_rw [← Set.nonempty_iff_ne_empty, iff_of_nempty] refine ⟨fun h C hi h'↦ ?_, fun h C hi h' ↦ ?_⟩ · apply h C hi exact fun n ↦ dissipate_eq ▸ (h' (n + 1)) @@ -88,135 +90,18 @@ lemma iff_nonempty_iInter_of_lt (p : Set α → Prop) : IsCompactSystem p ↔ rw [mem_iInter₂, mem_iInter₂] exact fun h i hi ↦ h i hi.le -/-- Any subset of a compact system is a compact system. -/ -theorem mono {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : - IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs - -/-- A set system is a compact system iff adding `∅` gives a compact system. -/ -lemma iff_isCompactSystem_of_or_empty : IsCompactSystem p ↔ - IsCompactSystem (fun s ↦ (p s ∨ (s = ∅))) := by - refine ⟨fun h s h' hd ↦ ?_, fun h ↦ mono h (fun s ↦ fun a ↦ Or.symm (Or.inr a))⟩ - by_cases g : ∃ n, s n = ∅ - · use g.choose - rw [← subset_empty_iff] at hd ⊢ - exact le_trans (dissipate_subset (by rfl)) g.choose_spec.le - · push_neg at g - have hj (i : _) : p (s i) := by - rcases h' i with a | b - · exact a - · exfalso - revert g i - simp_rw [← Set.not_nonempty_iff_eq_empty] - simp_rw [imp_false, not_not] - exact fun h i ↦ h i - exact h s hj hd - -lemma of_IsEmpty (h : IsEmpty α) (p : Set α → Prop) : IsCompactSystem p := - fun s _ _ ↦ ⟨0, Set.eq_empty_of_isEmpty (dissipate s 0)⟩ - -/-- A set system is a compact system iff adding `univ` gives a compact system. -/ -lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ - IsCompactSystem (fun s ↦ (p s ∨ s = univ)) := by - refine ⟨fun h ↦ ?_, fun h ↦ mono h (fun s ↦ fun a ↦ Or.symm (Or.inr a))⟩ - wlog ht : Nonempty α - · rw [not_nonempty_iff] at ht - apply of_IsEmpty ht - · rw [iff_nonempty_iInter] at h ⊢ - intro s h' hd - classical - by_cases h₀ : ∀ n, ¬p (s n) - · simp only [h₀, false_or] at h' - simp_rw [h', iInter_univ, Set.univ_nonempty] - · push_neg at h₀ - let n := Nat.find h₀ - let s' := fun i ↦ if p (s i) then s i else s n - have h₁ : ∀ i, p (s' i) := by - intro i - by_cases h₁ : p (s i) - · simp only [h₁, ↓reduceIte, s'] - · simp only [h₁, ↓reduceIte, Nat.find_spec h₀, s', n] - have h₃ : ∀ i, (p (s i) → s' i = s i) := fun i h ↦ if_pos h - have h₄ : ∀ i, (¬p (s i) → s' i = s n) := fun i h ↦ if_neg h - have h₂ : ⋂ i, s i = ⋂ i, s' i := by - simp only [s'] at * - ext x - simp only [mem_iInter] - refine ⟨fun h i ↦ ?_, fun h i ↦ ?_⟩ - · by_cases h' : p (s i) <;> simp only [h', ↓reduceIte, h, n] - · specialize h' i - specialize h i - rcases h' with a | b - · simp only [a, ↓reduceIte] at h - exact h - · simp only [b, Set.mem_univ] - apply h₂ ▸ h s' h₁ - by_contra! a - obtain ⟨j, hj⟩ := a - have h₂ (v : ℕ) (hv : n ≤ v) : dissipate s v = dissipate s' v:= by - ext x - refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ <;> simp only [dissipate_def, mem_iInter] at h ⊢ <;> - intro i hi - · by_cases h₅ : p (s i) - · exact (h₃ i h₅) ▸ h i hi - · exact (h₄ i h₅) ▸ h n hv - · by_cases h₅ : p (s i) - · exact (h₃ i h₅) ▸ h i hi - · have h₆ : s i = univ := by - specialize h' i - simp only [h₅, false_or] at h' - exact h' - simp only [h₆, Set.mem_univ] - have h₇ : dissipate s' (max j n) = ∅ := by - rw [← subset_empty_iff] at hj ⊢ - exact le_trans (antitone_dissipate (Nat.le_max_left j n)) hj - specialize h₂ (max j n) (Nat.le_max_right j n) - specialize hd (max j n) - rw [h₂, Set.nonempty_iff_ne_empty, h₇] at hd - exact hd rfl - -theorem iff_directed (hpi : IsPiSystem p) : - IsCompactSystem p ↔ - ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → - ⋂ i, C i = ∅ → ∃ (n : ℕ), C n = ∅ := by - rw [iff_isCompactSystem_of_or_empty] +theorem iff_directed (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : + (IsCompactSystem p) ↔ + (∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → + ⋂ i, C i = ∅ → ∃ (n : ℕ), C n = ∅) := by refine ⟨fun h ↦ fun C hdi hi ↦ ?_, fun h C h1 h2 ↦ ?_⟩ - · rw [exists_dissipate_eq_empty_iff_of_directed C hdi] - apply h C - exact fun i ↦ Or.inl (hi i) - · have hpi' : IsPiSystem (fun s ↦ p s ∨ s = ∅) := by - intro a ha b hb hab - rcases ha with ha₁ | ha₂ - · rcases hb with hb₁ | hb₂ - · left - exact hpi a ha₁ b hb₁ hab - · right - exact hb₂ ▸ (Set.inter_empty a) - · simp only [ha₂, Set.empty_inter] - right - rfl - rw [← biInter_le_eq_iInter] at h2 - obtain h' := h (dissipate C) directed_dissipate - have h₀ : (∀ (n : ℕ), p (dissipate C n) ∨ dissipate C n = ∅) → ⋂ n, dissipate C n = ∅ → - ∃ n, dissipate C n = ∅ := by - intro h₀ h₁ - by_cases f : ∀ n, p (dissipate C n) - · apply h' f h₁ - · push_neg at f - obtain ⟨n, hn⟩ := f - use n - specialize h₀ n - simp_all only [false_or] - obtain h'' := IsPiSystem.dissipate_mem hpi' h1 - have h₁ : ∀ (n : ℕ), p (dissipate C n) ∨ dissipate C n = ∅ := by - intro n - by_cases g : (dissipate C n).Nonempty - · exact h'' n g - · right - exact Set.not_nonempty_iff_eq_empty.mp g - apply h₀ h₁ h2 - -theorem iff_directed' (hpi : IsPiSystem p) : - IsCompactSystem p ↔ + · rw [dissipate_exists_empty_iff_of_directed C hdi] + exact h C hi + · rw [← biInter_le_eq_iInter] at h2 + exact h (Dissipate C) dissipate_directed (dissipate_of_piSystem hpi h1) h2 + +theorem iff_directed' (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : + (IsCompactSystem p) ↔ ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → (∀ (n : ℕ), (C n).Nonempty) → (⋂ i, C i).Nonempty := by rw [IsCompactSystem.iff_directed hpi] @@ -228,10 +113,31 @@ theorem iff_directed' (hpi : IsPiSystem p) : theorem of_supset {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs +section ClosedCompact +/-- Any subset of a compact system is a compact system. -/ +theorem of_supset {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : + IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs + section ClosedCompact +variable (α : Type*) [TopologicalSpace α] variable (α : Type*) [TopologicalSpace α] +/-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ +theorem isClosedCompactOrUnivs : + IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by + let p := fun (s : Set α) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ) + have h2 : ∀ (s t : Set α), p s → p t → p (s ∩ t) := by + intro s t hs ht + by_cases hs' : s = univ + · rw [hs', univ_inter] + exact ht + · by_cases ht' : t = univ + · rw [ht', inter_comm, univ_inter] + exact hs + · exact Or.inl <| ⟨IsCompact.inter_right (Or.resolve_right hs hs').1 + (Or.resolve_right ht ht').2, IsClosed.inter (Or.resolve_right hs hs').2 + (Or.resolve_right ht ht').2⟩ /-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ theorem isClosedCompactOrUnivs : IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by @@ -256,9 +162,9 @@ theorem isClosedCompactOrUnivs : have hz : s z ≠ univ := fun h ↦ a.prop <| eq_univ_of_subset hz1 h use ⟨z, hz⟩ have htcl : ∀ (i : { j : ℕ | s j ≠ univ}), IsClosed (s i) := - fun i ↦ (h1 i).2 + fun i ↦ (Or.resolve_right (h1 i.val) i.prop).2 have htco : ∀ (i : { j : ℕ | s j ≠ univ}), IsCompact (s i) := - fun i ↦ (h1 i).1 + fun i ↦ (Or.resolve_right (h1 i.val) i.prop).1 haveI f : Nonempty α := by apply Exists.nonempty _ · exact fun x ↦ x ∈ s 0 @@ -285,30 +191,336 @@ theorem isClosedCompacts : IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := IsCompactSystem.of_supset (isClosedCompactOrUnivs α) (fun _ hs ↦ Or.inl hs) +theorem isCompacts (h : ∀ {s : Set α}, IsCompact s → IsClosed s) : + simp only [nonempty_iInter, s', h] + simp only [Set.mem_univ, implies_true, exists_const, s'] + +/-- The set of compact and closed sets is a compact system. -/ +theorem isClosedCompacts : + IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := + IsCompactSystem.of_supset (isClosedCompactOrUnivs α) (fun _ hs ↦ Or.inl hs) + theorem isCompacts (h : ∀ {s : Set α}, IsCompact s → IsClosed s) : IsCompactSystem (fun s : Set α ↦ IsCompact s) := by have h : (fun s : Set α ↦ IsCompact s) = (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by ext s - refine ⟨fun h' ↦ ⟨h', h'.isClosed⟩, fun h ↦ h.1⟩ - exact h ▸ (of_isCompact_isClosed) + refine ⟨fun h' ↦ ⟨h', h h'⟩, fun h' ↦ h'.1⟩ + exact h ▸ (isClosedCompacts α) + +/-- In a `T2Space` The set of compact sets is a compact system. -/ +theorem _of_isCompact_of_T2Space [T2Space α] : + IsCompactSystem (fun s : Set α ↦ IsCompact s) := (isCompacts α) (fun hs ↦ hs.isClosed) + +end ClosedCompact + +section Union + +lemma l2 {ι : Type*} (s t : Set α) (u : Set ι) (L : (i : ι) → (hi : i ∈ u) → Set α) + (h : s ⊆ ⋃ (n : ι) (hn : n ∈ u), L n hn) (h' : ∀ (n : ι) (hn : n ∈ u), t ∩ (L n hn) = ∅) : + t ∩ s = ∅ := by + have j : ⋃ (n : ι) (hn : n ∈ u), t ∩ (L n hn) = ∅ := by + simp_rw [iUnion_eq_empty] + exact h' + simp_rw [← subset_empty_iff] at h' j ⊢ + have j' : ⋃ (n : u), t ∩ L n.val n.prop = ⋃ n, ⋃ (hn : n ∈ u), t ∩ L n hn := by + exact iUnion_coe_set u fun i ↦ t ∩ L (↑i) (Subtype.prop i) + rw [← j', ← inter_iUnion, iUnion_coe_set] at j + have gf := inter_subset_inter (t₁ := t) (fun ⦃a_1⦄ a ↦ a) h + apply le_trans gf j + +variable {p : Set α → Prop} (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) + (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) + +-- variable (p : {n : ℕ} → ((k : Fin (n + 1)) → (β k)) → Prop) + +/-- `r n K` is the property which must hold for compact systems: +`∀ N, (⋂ (j < n), (K j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅`. -/ +noncomputable def r (n : ℕ) (K : ℕ → Set α) : Prop := + ∀ N, (⋂ (j < n), (K j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ + +-- h0 -> (get_element_zero hL hc) +-- (h0 : ∃ x : (ℕ → α), x 0 ∈ β 0 ∧ p 0 x) + +lemma nonempty' (n : ℕ) (K : ℕ → Set α) + (hc : ∀ N, (⋂ (k < n), K k) ∩ (⋂ k < N, ⋃₀ (L (n + k))) ≠ ∅) : (L n).Nonempty := by + specialize hc 1 + by_contra! h + simp only [Finset.not_nonempty_iff_eq_empty] at h + apply hc + simp [h] + +lemma nonempty (k : ℕ) (hc : ∀ N, ⋂ k < N, ⋃₀ (L k : Set (Set α)) ≠ ∅) : (L k).Nonempty := by + specialize hc (k + 1) + by_contra! h + simp only [Finset.not_nonempty_iff_eq_empty] at h + apply hc + apply iInter_eq_empty_iff.mpr fun x ↦ ⟨k, ?_⟩ + -- simp only [Nat.lt_add_one, iInter_true, mem_sUnion, Finset.mem_coe, not_exists, not_and] + simp only [Nat.lt_add_one, iInter_true, Finset.mem_coe, not_exists, not_and] + have hg : ⋃₀ (L k : Set (Set α)) = ∅ := by + rw [h] + simp only [Finset.coe_empty, sUnion_empty] + exact of_eq_false (congrFun hg x) + +/-- `q n K` is the joint property that `(∀ k < n, K k ∈ L k)` and `r n K)` holds. -/ +def q : ℕ → (ℕ → Set α) → Prop := fun n K ↦ (∀ k < n, K k ∈ L k) ∧ (r L n K) + +lemma get_element_zero (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : + ∃ (K : ℕ → Set α), q L 0 K := by + simp [q, r, h] + +lemma get_element_succ' (n : ℕ) + (K : ℕ → Set α) (hK : q L n K) : ∃ y, q L (n + 1) (Function.update K n y) := by + simp_rw [q, r] at hK ⊢ + by_contra! h + choose b hb using h + have hn : ∀ y ∈ L n, ∀ k < n + 1, Function.update K n y k ∈ L k := by + intro y hy k hk + by_cases d : n = k + · rw [d] + simp only [Function.update_self] + exact d ▸ hy + · have d' : k < n := by + by_contra h + apply d + simp only [not_lt] at h + apply Eq.symm + exact Nat.eq_of_le_of_lt_succ h hk + simp only [ne_eq, d'.ne, not_false_eq_true, Function.update_of_ne] + exact hK.1 k d' + classical + let b' := fun y ↦ dite (y ∈ L n) (fun hy ↦ (b y (hn y hy))) (fun _ ↦ 0) + have hb' := fun y hy ↦ hb y (hn y hy) + have hb'' (y : Set α) (hy : y ∈ L n) : b y (hn y hy) = b' y := by + simp [b', hy] + obtain ⟨K0Max, ⟨hK0₁, hK0₂⟩⟩ := Finset.exists_max_image (L n) b' (nonempty' L n K hK.2) + apply hK.2 (b' K0Max + 1) + have h₁ (y s : Set α): (⋂ j, ⋂ (_ : j < n + 1), Function.update K n y j) ∩ s = + (⋂ j, ⋂ (_ : j < n), K j) ∩ y ∩ s := by + apply congrFun (congrArg Inter.inter _) s + ext x + refine ⟨fun h ↦ ⟨?_, ?_⟩, fun h ↦ ?_⟩ <;> simp only [mem_iInter, mem_inter_iff] at h ⊢ + · intro i hi + have h' := h i (le_trans hi (le_succ n)) + simp only [ne_eq, hi.ne, not_false_eq_true, Function.update_of_ne] at h' + exact h' + · have h'' := h n (Nat.lt_add_one n) + simp only [Function.update_self] at h'' + exact h'' + · intro i hi + by_cases h₁ : i < n + · simp only [ne_eq, h₁.ne, not_false_eq_true, Function.update_of_ne] + exact h.1 i h₁ + · simp only [not_lt] at h₁ + have h₂ := Nat.eq_of_le_of_lt_succ h₁ hi + rw [h₂] + simp only [Function.update_self] + exact h.2 + simp_rw [h₁] at hb' + + have h₂ : ⋂ k < b' K0Max + 1, ⋃₀ (L (n + k)).toSet ⊆ + ⋃ (y : Set α) (hy : y ∈ L n), y ∩ ⋂ (k < b y (hn y hy)), ⋃₀ (L (n + 1 + k)).toSet := by + obtain ⟨y, hy⟩ := nonempty' L n K hK.2 + intro x hx + simp only [mem_iInter, mem_sUnion, Finset.mem_coe, mem_iUnion, mem_inter_iff, + exists_and_left] at hx ⊢ + obtain ⟨i, hi⟩ := hx 0 (zero_lt_succ (b' K0Max)) + rw [add_zero] at hi + use i, hi.2, hi.1 + intro k hk + have hk' : 1 + k < b' K0Max + 1:= by + rw [add_comm] + simp only [Nat.add_lt_add_iff_right] + apply lt_of_lt_of_le hk + rw [hb''] + apply hK0₂ i hi.1 + exact hi.1 + obtain ⟨t, ht⟩ := hx (1 + k) hk' + rw [← add_assoc] at ht + use t, ht.1, ht.2 + simp_rw [inter_assoc] at hb' + apply l2 (s := ⋂ k < b' K0Max + 1, ⋃₀ (L (n + k)).toSet) (t := (⋂ j < n, K j)) (u := L n) + (L := fun (y : Set α) (hy : y ∈ L n) ↦ (y ∩ ⋂ k, ⋂ (hk : k < b y (hn y hy)), + ⋃₀ (L (n + 1 + k)).toSet)) h₂ hb' + +/-- `mem_of_union_aux h n` is the product of some `K : ℕ → Set α)` and `q n K`. +Constructing `(mem_of_union_aux h n).1` works inductively. When constructing +`(mem_of_union_aux h (n + 1)).1`, we update `(mem_of_union_aux h n).1` only at position `n`. -/ +noncomputable def mem_of_union_aux (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : + (n : ℕ) → ((K : ℕ → Set α) ×' (q L n K)) + | 0 => ⟨(get_element_zero L h).choose, (get_element_zero L h).choose_spec⟩ + | n + 1 => by + have g := (get_element_succ' L) n (mem_of_union_aux h n).1 (mem_of_union_aux h n).2 + exact ⟨Function.update (mem_of_union_aux h n).1 n g.choose, g.choose_spec⟩ + +namespace mem_of_union + +lemma constantEventually (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n k : ℕ) (hkn : k < n) : + (mem_of_union_aux L h n).1 k = (mem_of_union_aux L h (n + 1)).1 k := by + simp [mem_of_union_aux, hkn.ne] + +lemma constantEventually' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n k : ℕ) (hkn : k < n) : + (mem_of_union_aux L h n).1 k = (mem_of_union_aux L h (k + 1)).1 k := by + induction n with + | zero => + cases hkn + | succ n hn => + by_cases h' : k < n + · rw [← hn h'] + exact (constantEventually L h n k h').symm + · have hkn' : k = n := by + exact Nat.eq_of_lt_succ_of_not_lt hkn h' + rw [hkn'] + +lemma constantEventually'' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (m n k : ℕ) + (hkn : k < n) (hkm : k < m) : (mem_of_union_aux L h n).1 k + = (mem_of_union_aux L h m).1 k := by + rw [constantEventually' L h n k hkn, constantEventually' L h m k hkm] + +end mem_of_union + +/-- For `L : ℕ → Finset (Set α)` such that `∀ K ∈ L n, p K` and +`h : ∀ N, ⋂ k < N, ⋃₀ L k ≠ ∅`, `mem_of_union h n` is some `K : ℕ → Set α` such that `K n ∈ L n` +for all `n` (this is `prop₀`) and `∀ N, ⋂ (j < n, K j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ≠ ∅` +(this is `prop₁`.) -/ +noncomputable def mem_of_union (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) := + fun n ↦ (mem_of_union_aux L h (n + 1)).1 n + +namespace mem_of_union + +lemma prop₀ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : mem_of_union L h n ∈ L n := by + exact (mem_of_union_aux L h (n + 1)).2.1 n (Nat.lt_add_one n) + +lemma isSubset (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n N : ℕ) : + (⋂ j < n, mem_of_union L h j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ⊆ + ⋂ (k < n + N), (⋃₀ (L k).toSet) := by + have h' : ⋂ (k < n + N), (⋃₀ (L k).toSet) = + (⋂ (k < n), (⋃₀ (L k).toSet)) ∩ ⋂ (k < N), (⋃₀ (L (n + k)).toSet) := by + ext x + simp only [mem_iInter, mem_sUnion, Finset.mem_coe, mem_inter_iff] + refine ⟨fun h ↦ ⟨fun i hi ↦ ?_, fun i hi ↦ ?_⟩, fun h i hi ↦ ?_⟩ + · refine h i (lt_of_lt_of_le hi (Nat.le_add_right n N)) + · refine h (n + i) (Nat.add_lt_add_left hi n) + · by_cases hin : i < n + · exact h.1 i hin + · have h₁ : i - n < N := Nat.sub_lt_left_of_lt_add (Nat.le_of_not_lt hin) hi + have h₂ : n + (i - n) = i := by + exact add_sub_of_le <| Nat.le_of_not_lt hin + exact h₂ ▸ h.2 (i - n) h₁ + rw [h'] + apply inter_subset_inter _ fun ⦃a⦄ a ↦ a + have h'' (j : ℕ) (hj : j < n) : mem_of_union L h j ⊆ ⋃₀ (L j).toSet := by + exact subset_sUnion_of_mem <| prop₀ L h j + exact iInter₂_mono h'' + +lemma isSubsetN0 (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : + (⋂ j, mem_of_union L h j) ⊆ + ⋂ k, (⋃₀ (L k).toSet) := by + exact iInter_mono <| fun n ↦ + subset_sUnion_of_subset (↑(L n)) (mem_of_union L h n) (fun ⦃a⦄ a ↦ a) (prop₀ L h n) + +lemma has_p (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) + (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : p (mem_of_union L h n) := by + exact hL n (mem_of_union L h n) (prop₀ L h n) + +lemma prop₁ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : + ∀ N, (⋂ (j < n), (mem_of_union L h j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ := by + have h' : r L n (mem_of_union_aux L h n).fst := (mem_of_union_aux L h n).2.2 + simp only [r] at h' + simp only [mem_of_union] + intro N + specialize h' N + conv at h' => + lhs + enter [1,1] + intro j + enter[1] + intro hj + rw [constantEventually' L h n j hj] + exact h' + +lemma prop₁N0 (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : + (⋂ (j < n), (mem_of_union L h j)) ≠ ∅ := by + have h' : (⋂ (k < 0), (⋃₀ (L (n + k)).toSet)) = univ := by + simp + have d (s : Set α) : s = s ∩ univ := by exact left_eq_inter.mpr fun ⦃a⦄ a ↦ trivial + rw [d (⋂ j, ⋂ (_ : j < n), mem_of_union L h j)] + rw [← h'] + exact prop₁ L h n 0 + +end mem_of_union + +/-- Finite unions of sets in a compact system. -/ +def union (p : Set α → Prop) : Set α → Prop := + (sUnion '' ({ L : Set (Set α) | L.Finite ∧ ∀ K ∈ L, p K})) + +namespace union + +lemma mem_iff (s : Set α) : union p s ↔ ∃ L : Finset (Set α), s = ⋃₀ L ∧ ∀ K ∈ L, p K := by + refine ⟨fun ⟨L, hL⟩ ↦ ?_, fun h ↦ ?_⟩ + · simp only [mem_setOf_eq] at hL + let L' := (hL.1.1).toFinset + use L' + rw [← hL.2, Finite.coe_toFinset] + refine ⟨rfl, fun K hK ↦ ?_⟩ + rw [Finite.mem_toFinset] at hK + apply hL.1.2 K hK + · obtain ⟨L, hL⟩ := h + use L + simp only [mem_setOf_eq, Finset.finite_toSet, Finset.mem_coe, true_and] + refine ⟨hL.2, hL.1.symm⟩ + +theorem isCompactSystem (p : Set α → Prop)(hp : IsCompactSystem p) : IsCompactSystem (union p) := by + have hp' := (IsCompactSystem.iff_of_not_empty p).mp hp + rw [IsCompactSystem.iff_of_not_empty] + intro C hi + simp_rw [mem_iff] at hi + choose L' hL' using hi + have hL'1 := fun n ↦ (hL' n).1 + have hL'2 := fun n ↦ (hL' n).2 + simp_rw [hL'1] + intro hL + let K := mem_of_union L' hL + have h₁ : ⋂ i, K i ⊆ ⋂ i, ⋃₀ (L' i).toSet := by + apply mem_of_union.isSubsetN0 L' + have h₂ : ⋂ i, K i ≠ ∅ := by + apply hp' _ + · apply mem_of_union.has_p + exact hL'2 + · apply mem_of_union.prop₁N0 + rw [← nonempty_iff_ne_empty] at h₂ ⊢ + exact Nonempty.mono h₁ h₂ + +end union + +end Union -end IsCompactIsClosed +end IsCompactSystem section pi variable {ι : Type*} {α : ι → Type*} -/- In a product space, the intersection of square cylinders is empty iff there is a coordinate `i` -such that the projections to `i` have empty intersection. -/ theorem iInter_pi_empty_iff {β : Type*} (s : β → Set ι) (t : β → (i : ι) → Set (α i)) : - (⋂ b, ((s b).pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β) (_: i ∈ s b), (t b i) = ∅):= by + ( ⋂ b, ((s b).pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β) (_: i ∈ s b), (t b i) = ∅):= by rw [iInter_eq_empty_iff, not_iff_not.symm] push_neg - simp only [nonempty_iInter, mem_iInter] - refine ⟨fun ⟨x, hx⟩ i ↦ ?_, fun h ↦ ?_⟩ - · refine ⟨x i, fun j hi ↦ hx j i hi⟩ - · choose x hx using h - refine ⟨x, fun i j hj ↦ hx j i hj⟩ + refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ + · have ⟨x, hx⟩ := h + simp only [nonempty_iInter] + intro i + refine ⟨x i, fun j ↦ ?_⟩ + rw [mem_iInter] + intro hi + simp_rw [mem_pi] at hx + exact hx j i hi + · simp only [nonempty_iInter, mem_iInter] at h + choose x hx using h + use x + simp_rw [mem_pi] + intro i + intro j hj + exact hx j i hj theorem iInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) : ( ⋂ b, (univ.pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β), (t b i) = ∅):= by @@ -325,7 +537,7 @@ theorem biInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α exact biInter_eq_iInter p fun x h ↦ t x i simp_rw [h, h', iInter_univ_pi_empty_iff] -theorem pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : +theorem IsCompactSystem.pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : IsCompactSystem (univ.pi '' univ.pi C) := by intro S hS h_empty change ∀ i, S i ∈ univ.pi '' univ.pi C at hS @@ -346,8 +558,6 @@ theorem pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i end pi -end IsCompactSystem - section ClosedCompactSquareCylinders variable {ι : Type*} {α : ι → Type*} @@ -357,83 +567,117 @@ variable [∀ i, TopologicalSpace (α i)] variable (α) /-- The set of sets of the form `s.pi t`, where `s : Finset ι` and `t i` is both, closed and compact, for all `i ∈ s`. -/ -def compactClosedSquareCylinders : Set (Set (Π i, α i)) := - ⋃ (s) (t) (_ : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)), {squareCylinder s t} +def closedCompactSquareCylinders : Set (Set (Π i, α i)) := + ⋃ (s) (t) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), {squareCylinder s t} -def squareCylinders_of_prop (p : (i : ι) → Set (α i) → Prop) : Set (Set (Π i, α i)) := - ⋃ (s) (t) (_ : ∀ i ∈ s, p i (t i)), {squareCylinder s t} +def closedCompactSquareCylinders' : Set (Set (Π i, α i)) := + ⋃ (s : Finset ι), s.toSet.pi '' s.toSet.pi + (fun (i : ι) ↦ fun t : Set (α i) ↦ IsCompact t ∧ IsClosed t) + +lemma supset : + closedCompactSquareCylinders' α ⊆ (univ.pi '' univ.pi + (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by + intro S + simp [closedCompactSquareCylinders'] + intro s t hs hS + classical + use fun i ↦ (if i ∈ s then (t i) else univ) + simp + refine ⟨?_, ?_⟩ + · intro i + by_cases hs' : i ∈ s + · simp [hs'] + exact Or.inl (hs i hs') + · simp [hs'] + exact Or.inr rfl + · rw [← hS, ← univ_pi_ite s.toSet t] + simp variable {α} @[simp] -theorem mem_compactClosedSquareCylinders_iff (S : Set (Π i, α i)) : - S ∈ compactClosedSquareCylinders α +theorem mem_closedCompactSquareCylinders' (S : Set (Π i, α i)) : + S ∈ closedCompactSquareCylinders' α ↔ ∃ (s t : _) (_ : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)), - S = squareCylinder s t := by - simp_rw [compactClosedSquareCylinders, mem_iUnion, mem_singleton_iff] + squareCylinder s t = S := by + refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ <;> + simp only [closedCompactSquareCylinders', squareCylinder, + mem_iUnion, mem_image, mem_pi, Finset.mem_coe, exists_prop] at h ⊢ <;> + · exact h +@[simp] +theorem mem_closedCompactSquareCylinders (S : Set (Π i, α i)) : + S ∈ closedCompactSquareCylinders α + ↔ ∃ (s t : _) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), + S = squareCylinder s t := by + simp_rw [closedCompactSquareCylinders, mem_iUnion, mem_singleton_iff] variable {S : Set (Π i, α i)} /-- Given a closed compact cylinder, choose a finset of variables such that it only depends on these variables. -/ -noncomputable def compactClosedSquareCylinders.finset (hS : S ∈ compactClosedSquareCylinders α) : +noncomputable def closedCompactSquareCylinders.finset (hS : S ∈ closedCompactSquareCylinders α) : Finset ι := - ((mem_compactClosedSquareCylinders_iff S).mp hS).choose + ((mem_closedCompactSquareCylinders S).mp hS).choose /-- Given a closed compact square cylinder `S`, choose a dependent function `(i : ι) → Set (α i)` of which it is a lift. -/ -def closedCompactSquareCylinders.func (hS : S ∈ compactClosedSquareCylinders α) : +def closedCompactSquareCylinders.func (hS : S ∈ closedCompactSquareCylinders α) : (i : ι) → Set (α i) := - ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose + +theorem closedCompactSquareCylinders.isClosed (hS : S ∈ closedCompactSquareCylinders α) : + ∀ i ∈ closedCompactSquareCylinders.finset hS, + IsClosed (closedCompactSquareCylinders.func hS i) := + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose -theorem compactClosedSquareCylinders.isCompact_isClosed (hS : S ∈ compactClosedSquareCylinders α) : - ∀ i ∈ compactClosedSquareCylinders.finset hS, - IsCompact (closedCompactSquareCylinders.func hS i) ∧ - IsClosed (closedCompactSquareCylinders.func hS i) := - ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose_spec.choose +theorem closedCompactSquareCylinders.isCompact (hS : S ∈ closedCompactSquareCylinders α) : + ∀ i ∈ closedCompactSquareCylinders.finset hS, + IsCompact (closedCompactSquareCylinders.func hS i) := + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose -theorem closedCompactSquareCylinders.eq_squareCylinder (hS : S ∈ compactClosedSquareCylinders α) : - S = squareCylinder (compactClosedSquareCylinders.finset hS) +theorem closedCompactSquareCylinders.eq_squareCylinder (hS : S ∈ closedCompactSquareCylinders α) : + S = squareCylinder (closedCompactSquareCylinders.finset hS) (closedCompactSquareCylinders.func hS) := - ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose_spec.choose_spec + ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose_spec theorem squareCylinder_mem_closedCompactSquareCylinders (s : Finset ι) (t : (i : ι) → Set (α i)) - (h : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)) : - squareCylinder s t ∈ compactClosedSquareCylinders α := by - rw [mem_compactClosedSquareCylinders_iff] - exact ⟨s, t, h, rfl⟩ + (hS_closed : ∀ i ∈ s, IsClosed (t i)) (hS_compact : ∀ i ∈ s, IsCompact (t i)) : + squareCylinder s t ∈ closedCompactSquareCylinders α := by + rw [mem_closedCompactSquareCylinders] + exact ⟨s, t, hS_closed, hS_compact, rfl⟩ -theorem CompactClosedOrUniv_pi : +theorem IsCompactSystem.CompactClosedOrUniv_pi : IsCompactSystem (univ.pi '' univ.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by apply IsCompactSystem.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ))) - <| fun i ↦ IsCompactSystem.of_isCompact_isClosed_or_univ + <| fun i ↦ IsCompactSystem.isClosedCompactOrUnivs (α i) /-- In `closedCompactSquareCylinders α`, the set of dependent variables is a finset, but not necessarily in `univ.pi '' univ.pi _`, where `_` are closed compact set, or `univ`. -/ -theorem compactClosedSquareCylinders_supset (S : _) : - S ∈ compactClosedSquareCylinders α → S ∈ (univ.pi '' univ.pi +theorem closedCompactSquareCylinders_supset (S : _) : + S ∈ closedCompactSquareCylinders α → S ∈ (univ.pi '' univ.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by classical intro hS - simp_rw [mem_compactClosedSquareCylinders_iff, squareCylinder] at hS + simp_rw [mem_closedCompactSquareCylinders, squareCylinder] at hS simp only [mem_image, mem_pi, mem_univ, forall_const] obtain ⟨s, t, h_cl, h_co, h_pi⟩ := hS let t' := fun (i : ι) ↦ if (i ∈ s) then (t i) else univ - refine ⟨t', fun i ↦ ?_, ?_⟩ - · by_cases hi : i ∈ s + refine ⟨t', ?_, ?_⟩ + · intro i + by_cases hi : i ∈ s · simp only [hi, ↓reduceIte, t'] - exact Or.inl (h_cl i hi) + exact Or.inl ⟨h_co i hi, h_cl i hi⟩ · simp only [hi, ↓reduceIte, t'] apply Or.inr rfl - · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = (s : Set ι).pi t - rw [univ_pi_ite s t] + · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = S + rw [h_pi, univ_pi_ite s t] /-- Closed and compact square cylinders form a compact system. -/ -theorem isCompactSystem.compactClosedSquareCylinders : - IsCompactSystem (compactClosedSquareCylinders α) := - IsCompactSystem.mono CompactClosedOrUniv_pi - compactClosedSquareCylinders_supset +theorem IsCompactSystem.closedCompactSquareCylinders : + IsCompactSystem (closedCompactSquareCylinders α) := + IsCompactSystem.of_supset IsCompactSystem.CompactClosedOrUniv_pi + closedCompactSquareCylinders_supset end ClosedCompactSquareCylinders From 3dc5fde0d5db855debd4bbb515d2aacc7ba09426 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Fri, 30 May 2025 00:27:53 +0200 Subject: [PATCH 112/129] Revert "sq" This reverts commit 7fbd0b2c9f9982253b4acdd211c44ee24b399755. --- .../Topology/Compactness/CompactSystem.lean | 690 ++++++------------ 1 file changed, 217 insertions(+), 473 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 3902eb3fb7296e..1fd9d0c72a7f1e 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber -/ import Mathlib.Data.Set.Dissipate +import Mathlib.Logic.IsEmpty import Mathlib.MeasureTheory.Constructions.Cylinders import Mathlib.Order.OmegaCompletePartialOrder import Mathlib.Topology.Separation.Hausdorff @@ -17,20 +18,16 @@ This file defines compact systems of sets. * `IsCompactSystem`: A set of sets is a compact system if, whenever a countable subfamily has empty intersection, then finitely many of them already have empty intersection. -* `IsCompactSystem.union`: The set system of finite unions of another set system. -* `IsCompactSystem.union`: The set system of finite unions of another set system. + ## Main results +* `IsCompactSystemiff_isCompactSystem_of_or_univ`: A set system is a compact +system iff inserting `univ` gives a compact system. * `IsClosedCompact.isCompactSystem`: The set of closed and compact sets is a compact system. * `IsClosedCompact.isCompactSystem_of_T2Space`: In a `T2Space α`, the set of compact sets is a compact system in a `T2Space`. -* `IsCompactSystem.union.isCompactSystem`: If `IsCompactSystem p`, the set of finite unions - of `K : Set α` with `p K` is a compact system. -* `IsCompactSystem.union.isCompactSystem`: If `IsCompactSystem p`, the set of finite unions - of `K : Set α` with `p K` is a compact system. * `IsCompactSystem.closedCompactSquareCylinders`: Closed and compact square cylinders form a - compact system in a product space. - compact system in a product space. + compact system. -/ open Set Nat MeasureTheory @@ -48,21 +45,21 @@ end definition namespace IsCompactSystem -/-- In a compact system, given a countable family with empty intersection, we choose a finite -subfamily with empty intersection. -/ -/-- In a compact system, given a countable family with empty intersection, we choose a finite -subfamily with empty intersection. -/ +open Classical in +/-- In a compact system, given a countable family with `⋂ i, C i = ∅`, we choose the smallest `n` +with `⋂ (i ≤ n), C i = ∅`. -/ noncomputable -def max_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) +def finite_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) (hC_empty : ⋂ i, C i = ∅) : ℕ := - (hp C hC hC_empty).choose + Nat.find (hp C hC hC_empty) -lemma iInter_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) +open Classical in +lemma dissipate_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) (hC_empty : ⋂ i, C i = ∅) : - Dissipate C (hp.max_of_empty hC hC_empty) = ∅ := - (hp C hC hC_empty).choose_spec + Dissipate C (hp.finite_of_empty hC hC_empty) = ∅ := by + apply Nat.find_spec (hp C hC hC_empty) -theorem iff_of_nempty (p : Set α → Prop) : +theorem iff_nonempty_iInter (p : Set α → Prop) : IsCompactSystem p ↔ (∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ (n : ℕ), (dissipate C n).Nonempty) → (⋂ i, C i).Nonempty) := by refine ⟨fun h C hC hn ↦ ?_, fun h C hC ↦ ?_⟩ <;> have h2 := not_imp_not.mpr <| h C hC @@ -73,9 +70,9 @@ theorem iff_of_nempty (p : Set α → Prop) : /-- In this equivalent formulation for a compact system, note that we use `⋂ k < n, C k` rather than `⋂ k ≤ n, C k`. -/ -lemma iff_of_not_empty (p : Set α → Prop) : IsCompactSystem p ↔ - ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ n, ⋂ k < n, C k ≠ ∅) → ⋂ i, C i ≠ ∅ := by - simp_rw [← Set.nonempty_iff_ne_empty, iff_of_nempty] +lemma iff_nonempty_iInter_of_lt (p : Set α → Prop) : IsCompactSystem p ↔ + ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ n, (⋂ k < n, C k).Nonempty) → (⋂ i, C i).Nonempty := by + simp_rw [iff_nonempty_iInter] refine ⟨fun h C hi h'↦ ?_, fun h C hi h' ↦ ?_⟩ · apply h C hi exact fun n ↦ dissipate_eq ▸ (h' (n + 1)) @@ -90,18 +87,135 @@ lemma iff_of_not_empty (p : Set α → Prop) : IsCompactSystem p ↔ rw [mem_iInter₂, mem_iInter₂] exact fun h i hi ↦ h i hi.le -theorem iff_directed (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : - (IsCompactSystem p) ↔ - (∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → - ⋂ i, C i = ∅ → ∃ (n : ℕ), C n = ∅) := by - refine ⟨fun h ↦ fun C hdi hi ↦ ?_, fun h C h1 h2 ↦ ?_⟩ - · rw [dissipate_exists_empty_iff_of_directed C hdi] - exact h C hi - · rw [← biInter_le_eq_iInter] at h2 - exact h (Dissipate C) dissipate_directed (dissipate_of_piSystem hpi h1) h2 +/-- Any subset of a compact system is a compact system. -/ +theorem mono {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : + IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs -theorem iff_directed' (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : - (IsCompactSystem p) ↔ +/-- A set system is a compact system iff adding `∅` gives a compact system. -/ +lemma iff_isCompactSystem_of_or_empty : IsCompactSystem p ↔ + IsCompactSystem (fun s ↦ (p s ∨ (s = ∅))) := by + refine ⟨fun h s h' hd ↦ ?_, fun h ↦ mono h (fun s ↦ fun a ↦ Or.symm (Or.inr a))⟩ + by_cases g : ∃ n, s n = ∅ + · use g.choose + rw [← subset_empty_iff] at hd ⊢ + exact le_trans (dissipate_subset (by rfl)) g.choose_spec.le + · push_neg at g + have hj (i : _) : p (s i) := by + rcases h' i with a | b + · exact a + · exfalso + revert g i + simp_rw [← Set.not_nonempty_iff_eq_empty] + simp_rw [imp_false, not_not] + exact fun h i ↦ h i + exact h s hj hd + +lemma of_IsEmpty (h : IsEmpty α) (p : Set α → Prop) : IsCompactSystem p := + fun s _ _ ↦ ⟨0, Set.eq_empty_of_isEmpty (Dissipate s 0)⟩ + +/-- A set system is a compact system iff adding `univ` gives a compact system. -/ +lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ + IsCompactSystem (fun s ↦ (p s ∨ s = univ)) := by + refine ⟨fun h ↦ ?_, fun h ↦ mono h (fun s ↦ fun a ↦ Or.symm (Or.inr a))⟩ + wlog ht : Nonempty α + · rw [not_nonempty_iff] at ht + apply of_IsEmpty ht + · rw [iff_nonempty_iInter] at h ⊢ + intro s h' hd + classical + by_cases h₀ : ∀ n, ¬p (s n) + · simp only [h₀, false_or] at h' + simp_rw [h', iInter_univ, Set.univ_nonempty] + · push_neg at h₀ + let n := Nat.find h₀ + let s' := fun i ↦ if p (s i) then s i else s n + have h₁ : ∀ i, p (s' i) := by + intro i + by_cases h₁ : p (s i) + · simp only [h₁, ↓reduceIte, s'] + · simp only [h₁, ↓reduceIte, Nat.find_spec h₀, s', n] + have h₃ : ∀ i, (p (s i) → s' i = s i) := fun i h ↦ if_pos h + have h₄ : ∀ i, (¬p (s i) → s' i = s n) := fun i h ↦ if_neg h + have h₂ : ⋂ i, s i = ⋂ i, s' i := by + simp only [s'] at * + ext x + simp only [mem_iInter] + refine ⟨fun h i ↦ ?_, fun h i ↦ ?_⟩ + · by_cases h' : p (s i) <;> simp only [h', ↓reduceIte, h, s', n] + · specialize h' i + specialize h i + rcases h' with a | b + · simp only [a, ↓reduceIte, s', n] at h + exact h + · simp only [b, Set.mem_univ] + apply h₂ ▸ h s' h₁ + by_contra! a + obtain ⟨j, hj⟩ := a + have h₂ (v : ℕ) (hv : n ≤ v) : Dissipate s v = Dissipate s' v:= by + ext x + refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ <;> simp only [dissipate_def, mem_iInter] at h ⊢ <;> + intro i hi + · by_cases h₅ : p (s i) + · exact (h₃ i h₅) ▸ h i hi + · exact (h₄ i h₅) ▸ h n hv + · by_cases h₅ : p (s i) + · exact (h₃ i h₅) ▸ h i hi + · have h₆ : s i = univ := by + specialize h' i + simp only [h₅, false_or] at h' + exact h' + simp only [h₆, Set.mem_univ] + have h₇ : Dissipate s' (max j n) = ∅ := by + rw [← subset_empty_iff] at hj ⊢ + exact le_trans (antitone_dissipate (Nat.le_max_left j n)) hj + specialize h₂ (max j n) (Nat.le_max_right j n) + specialize hd (max j n) + rw [h₂, Set.nonempty_iff_ne_empty, h₇] at hd + exact hd rfl + +theorem iff_directed (hpi : IsPiSystem p) : + IsCompactSystem p ↔ + ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → + ⋂ i, C i = ∅ → ∃ (n : ℕ), C n = ∅ := by + rw [iff_isCompactSystem_of_or_empty] + refine ⟨fun h ↦ fun C hdi hi ↦ ?_, fun h C h1 h2 ↦ ?_⟩ + · rw [exists_dissipate_eq_empty_iff_of_directed C hdi] + apply h C + exact fun i ↦ Or.inl (hi i) + · have hpi' : IsPiSystem (fun s ↦ p s ∨ s = ∅) := by + intro a ha b hb hab + rcases ha with ha₁ | ha₂ + · rcases hb with hb₁ | hb₂ + · left + exact hpi a ha₁ b hb₁ hab + · right + exact hb₂ ▸ (Set.inter_empty a) + · simp only [ha₂, Set.empty_inter] + right + rfl + rw [← biInter_le_eq_iInter] at h2 + obtain h' := h (Dissipate C) directed_dissipate + have h₀ : (∀ (n : ℕ), p (Dissipate C n) ∨ Dissipate C n = ∅) → ⋂ n, Dissipate C n = ∅ → + ∃ n, Dissipate C n = ∅ := by + intro h₀ h₁ + by_cases f : ∀ n, p (Dissipate C n) + · apply h' f h₁ + · push_neg at f + obtain ⟨n, hn⟩ := f + use n + specialize h₀ n + simp_all only [false_or] + obtain h'' := dissipate_of_piSystem hpi' h1 + have h₁ : ∀ (n : ℕ), p (Dissipate C n) ∨ Dissipate C n = ∅ := by + intro n + by_cases g : (Dissipate C n).Nonempty + · exact h'' n g + · right + exact Set.not_nonempty_iff_eq_empty.mp g + apply h₀ h₁ h2 + +theorem iff_directed' (hpi : IsPiSystem p) : + IsCompactSystem p ↔ ∀ (C : ℕ → Set α), ∀ (_ : Directed (fun (x1 x2 : Set α) => x1 ⊇ x2) C), (∀ i, p (C i)) → (∀ (n : ℕ), (C n).Nonempty) → (⋂ i, C i).Nonempty := by rw [IsCompactSystem.iff_directed hpi] @@ -109,50 +223,17 @@ theorem iff_directed' (hpi : ∀ (s t : Set α), p s → p t → p (s ∩ t)) : · exact h1 C h3 h4 · exact h1 C h3 s -/-- Any subset of a compact system is a compact system. -/ -theorem of_supset {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : - IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs +section IsCompactIsClosed -section ClosedCompact -/-- Any subset of a compact system is a compact system. -/ -theorem of_supset {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : - IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs - -section ClosedCompact +variable {α : Type*} [TopologicalSpace α] -variable (α : Type*) [TopologicalSpace α] -variable (α : Type*) [TopologicalSpace α] - -/-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ -theorem isClosedCompactOrUnivs : - IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by - let p := fun (s : Set α) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ) - have h2 : ∀ (s t : Set α), p s → p t → p (s ∩ t) := by - intro s t hs ht - by_cases hs' : s = univ - · rw [hs', univ_inter] - exact ht - · by_cases ht' : t = univ - · rw [ht', inter_comm, univ_inter] - exact hs - · exact Or.inl <| ⟨IsCompact.inter_right (Or.resolve_right hs hs').1 - (Or.resolve_right ht ht').2, IsClosed.inter (Or.resolve_right hs hs').2 - (Or.resolve_right ht ht').2⟩ -/-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ -theorem isClosedCompactOrUnivs : - IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by - let p := fun (s : Set α) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ) - have h2 : ∀ (s t : Set α), p s → p t → p (s ∩ t) := by - intro s t hs ht - by_cases hs' : s = univ - · rw [hs', univ_inter] - exact ht - · by_cases ht' : t = univ - · rw [ht', inter_comm, univ_inter] - exact hs - · exact Or.inl <| ⟨IsCompact.inter_right (Or.resolve_right hs hs').1 - (Or.resolve_right ht ht').2, IsClosed.inter (Or.resolve_right hs hs').2 - (Or.resolve_right ht ht').2⟩ +/-- The set of compact and closed sets is a compact system. -/ +theorem of_isCompact_isClosed : + IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by + let p := fun (s : Set α) ↦ IsCompact s ∧ IsClosed s + have h2 : IsPiSystem p := by + intro s hs t ht _ + refine ⟨IsCompact.inter_left ht.1 hs.2, IsClosed.inter hs.2 ht.2⟩ rw [IsCompactSystem.iff_directed' h2] intro s hs h1 h2 let s' := fun (i : { j : ℕ | s j ≠ univ}) ↦ s i @@ -162,9 +243,9 @@ theorem isClosedCompactOrUnivs : have hz : s z ≠ univ := fun h ↦ a.prop <| eq_univ_of_subset hz1 h use ⟨z, hz⟩ have htcl : ∀ (i : { j : ℕ | s j ≠ univ}), IsClosed (s i) := - fun i ↦ (Or.resolve_right (h1 i.val) i.prop).2 + fun i ↦ (h1 i).2 have htco : ∀ (i : { j : ℕ | s j ≠ univ}), IsCompact (s i) := - fun i ↦ (Or.resolve_right (h1 i.val) i.prop).1 + fun i ↦ (h1 i).1 haveI f : Nonempty α := by apply Exists.nonempty _ · exact fun x ↦ x ∈ s 0 @@ -183,344 +264,39 @@ theorem isClosedCompactOrUnivs : apply g <| IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed s' hs' (fun j ↦ h2 j) htco htcl · simp only [ne_eq, coe_setOf, nonempty_subtype, not_exists, not_not, s'] at h - simp only [nonempty_iInter, s', h] - simp only [Set.mem_univ, implies_true, exists_const, s'] + simp [s', h] -/-- The set of compact and closed sets is a compact system. -/ -theorem isClosedCompacts : - IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := - IsCompactSystem.of_supset (isClosedCompactOrUnivs α) (fun _ hs ↦ Or.inl hs) - -theorem isCompacts (h : ∀ {s : Set α}, IsCompact s → IsClosed s) : - simp only [nonempty_iInter, s', h] - simp only [Set.mem_univ, implies_true, exists_const, s'] - -/-- The set of compact and closed sets is a compact system. -/ -theorem isClosedCompacts : - IsCompactSystem (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := - IsCompactSystem.of_supset (isClosedCompactOrUnivs α) (fun _ hs ↦ Or.inl hs) +/-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ +theorem of_isCompact_isClosed_or_univ : + IsCompactSystem (fun s : Set α ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)) := by + rw [← iff_isCompactSystem_of_or_univ] + exact of_isCompact_isClosed -theorem isCompacts (h : ∀ {s : Set α}, IsCompact s → IsClosed s) : +/-- In a `T2Space` the set of compact sets is a compact system. -/ +theorem of_isCompact [T2Space α] : IsCompactSystem (fun s : Set α ↦ IsCompact s) := by have h : (fun s : Set α ↦ IsCompact s) = (fun s : Set α ↦ IsCompact s ∧ IsClosed s) := by ext s - refine ⟨fun h' ↦ ⟨h', h h'⟩, fun h' ↦ h'.1⟩ - exact h ▸ (isClosedCompacts α) - -/-- In a `T2Space` The set of compact sets is a compact system. -/ -theorem _of_isCompact_of_T2Space [T2Space α] : - IsCompactSystem (fun s : Set α ↦ IsCompact s) := (isCompacts α) (fun hs ↦ hs.isClosed) - -end ClosedCompact - -section Union - -lemma l2 {ι : Type*} (s t : Set α) (u : Set ι) (L : (i : ι) → (hi : i ∈ u) → Set α) - (h : s ⊆ ⋃ (n : ι) (hn : n ∈ u), L n hn) (h' : ∀ (n : ι) (hn : n ∈ u), t ∩ (L n hn) = ∅) : - t ∩ s = ∅ := by - have j : ⋃ (n : ι) (hn : n ∈ u), t ∩ (L n hn) = ∅ := by - simp_rw [iUnion_eq_empty] - exact h' - simp_rw [← subset_empty_iff] at h' j ⊢ - have j' : ⋃ (n : u), t ∩ L n.val n.prop = ⋃ n, ⋃ (hn : n ∈ u), t ∩ L n hn := by - exact iUnion_coe_set u fun i ↦ t ∩ L (↑i) (Subtype.prop i) - rw [← j', ← inter_iUnion, iUnion_coe_set] at j - have gf := inter_subset_inter (t₁ := t) (fun ⦃a_1⦄ a ↦ a) h - apply le_trans gf j - -variable {p : Set α → Prop} (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) - (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) - --- variable (p : {n : ℕ} → ((k : Fin (n + 1)) → (β k)) → Prop) - -/-- `r n K` is the property which must hold for compact systems: -`∀ N, (⋂ (j < n), (K j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅`. -/ -noncomputable def r (n : ℕ) (K : ℕ → Set α) : Prop := - ∀ N, (⋂ (j < n), (K j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ - --- h0 -> (get_element_zero hL hc) --- (h0 : ∃ x : (ℕ → α), x 0 ∈ β 0 ∧ p 0 x) - -lemma nonempty' (n : ℕ) (K : ℕ → Set α) - (hc : ∀ N, (⋂ (k < n), K k) ∩ (⋂ k < N, ⋃₀ (L (n + k))) ≠ ∅) : (L n).Nonempty := by - specialize hc 1 - by_contra! h - simp only [Finset.not_nonempty_iff_eq_empty] at h - apply hc - simp [h] - -lemma nonempty (k : ℕ) (hc : ∀ N, ⋂ k < N, ⋃₀ (L k : Set (Set α)) ≠ ∅) : (L k).Nonempty := by - specialize hc (k + 1) - by_contra! h - simp only [Finset.not_nonempty_iff_eq_empty] at h - apply hc - apply iInter_eq_empty_iff.mpr fun x ↦ ⟨k, ?_⟩ - -- simp only [Nat.lt_add_one, iInter_true, mem_sUnion, Finset.mem_coe, not_exists, not_and] - simp only [Nat.lt_add_one, iInter_true, Finset.mem_coe, not_exists, not_and] - have hg : ⋃₀ (L k : Set (Set α)) = ∅ := by - rw [h] - simp only [Finset.coe_empty, sUnion_empty] - exact of_eq_false (congrFun hg x) - -/-- `q n K` is the joint property that `(∀ k < n, K k ∈ L k)` and `r n K)` holds. -/ -def q : ℕ → (ℕ → Set α) → Prop := fun n K ↦ (∀ k < n, K k ∈ L k) ∧ (r L n K) - -lemma get_element_zero (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : - ∃ (K : ℕ → Set α), q L 0 K := by - simp [q, r, h] - -lemma get_element_succ' (n : ℕ) - (K : ℕ → Set α) (hK : q L n K) : ∃ y, q L (n + 1) (Function.update K n y) := by - simp_rw [q, r] at hK ⊢ - by_contra! h - choose b hb using h - have hn : ∀ y ∈ L n, ∀ k < n + 1, Function.update K n y k ∈ L k := by - intro y hy k hk - by_cases d : n = k - · rw [d] - simp only [Function.update_self] - exact d ▸ hy - · have d' : k < n := by - by_contra h - apply d - simp only [not_lt] at h - apply Eq.symm - exact Nat.eq_of_le_of_lt_succ h hk - simp only [ne_eq, d'.ne, not_false_eq_true, Function.update_of_ne] - exact hK.1 k d' - classical - let b' := fun y ↦ dite (y ∈ L n) (fun hy ↦ (b y (hn y hy))) (fun _ ↦ 0) - have hb' := fun y hy ↦ hb y (hn y hy) - have hb'' (y : Set α) (hy : y ∈ L n) : b y (hn y hy) = b' y := by - simp [b', hy] - obtain ⟨K0Max, ⟨hK0₁, hK0₂⟩⟩ := Finset.exists_max_image (L n) b' (nonempty' L n K hK.2) - apply hK.2 (b' K0Max + 1) - have h₁ (y s : Set α): (⋂ j, ⋂ (_ : j < n + 1), Function.update K n y j) ∩ s = - (⋂ j, ⋂ (_ : j < n), K j) ∩ y ∩ s := by - apply congrFun (congrArg Inter.inter _) s - ext x - refine ⟨fun h ↦ ⟨?_, ?_⟩, fun h ↦ ?_⟩ <;> simp only [mem_iInter, mem_inter_iff] at h ⊢ - · intro i hi - have h' := h i (le_trans hi (le_succ n)) - simp only [ne_eq, hi.ne, not_false_eq_true, Function.update_of_ne] at h' - exact h' - · have h'' := h n (Nat.lt_add_one n) - simp only [Function.update_self] at h'' - exact h'' - · intro i hi - by_cases h₁ : i < n - · simp only [ne_eq, h₁.ne, not_false_eq_true, Function.update_of_ne] - exact h.1 i h₁ - · simp only [not_lt] at h₁ - have h₂ := Nat.eq_of_le_of_lt_succ h₁ hi - rw [h₂] - simp only [Function.update_self] - exact h.2 - simp_rw [h₁] at hb' - - have h₂ : ⋂ k < b' K0Max + 1, ⋃₀ (L (n + k)).toSet ⊆ - ⋃ (y : Set α) (hy : y ∈ L n), y ∩ ⋂ (k < b y (hn y hy)), ⋃₀ (L (n + 1 + k)).toSet := by - obtain ⟨y, hy⟩ := nonempty' L n K hK.2 - intro x hx - simp only [mem_iInter, mem_sUnion, Finset.mem_coe, mem_iUnion, mem_inter_iff, - exists_and_left] at hx ⊢ - obtain ⟨i, hi⟩ := hx 0 (zero_lt_succ (b' K0Max)) - rw [add_zero] at hi - use i, hi.2, hi.1 - intro k hk - have hk' : 1 + k < b' K0Max + 1:= by - rw [add_comm] - simp only [Nat.add_lt_add_iff_right] - apply lt_of_lt_of_le hk - rw [hb''] - apply hK0₂ i hi.1 - exact hi.1 - obtain ⟨t, ht⟩ := hx (1 + k) hk' - rw [← add_assoc] at ht - use t, ht.1, ht.2 - simp_rw [inter_assoc] at hb' - apply l2 (s := ⋂ k < b' K0Max + 1, ⋃₀ (L (n + k)).toSet) (t := (⋂ j < n, K j)) (u := L n) - (L := fun (y : Set α) (hy : y ∈ L n) ↦ (y ∩ ⋂ k, ⋂ (hk : k < b y (hn y hy)), - ⋃₀ (L (n + 1 + k)).toSet)) h₂ hb' - -/-- `mem_of_union_aux h n` is the product of some `K : ℕ → Set α)` and `q n K`. -Constructing `(mem_of_union_aux h n).1` works inductively. When constructing -`(mem_of_union_aux h (n + 1)).1`, we update `(mem_of_union_aux h n).1` only at position `n`. -/ -noncomputable def mem_of_union_aux (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : - (n : ℕ) → ((K : ℕ → Set α) ×' (q L n K)) - | 0 => ⟨(get_element_zero L h).choose, (get_element_zero L h).choose_spec⟩ - | n + 1 => by - have g := (get_element_succ' L) n (mem_of_union_aux h n).1 (mem_of_union_aux h n).2 - exact ⟨Function.update (mem_of_union_aux h n).1 n g.choose, g.choose_spec⟩ - -namespace mem_of_union - -lemma constantEventually (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n k : ℕ) (hkn : k < n) : - (mem_of_union_aux L h n).1 k = (mem_of_union_aux L h (n + 1)).1 k := by - simp [mem_of_union_aux, hkn.ne] - -lemma constantEventually' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n k : ℕ) (hkn : k < n) : - (mem_of_union_aux L h n).1 k = (mem_of_union_aux L h (k + 1)).1 k := by - induction n with - | zero => - cases hkn - | succ n hn => - by_cases h' : k < n - · rw [← hn h'] - exact (constantEventually L h n k h').symm - · have hkn' : k = n := by - exact Nat.eq_of_lt_succ_of_not_lt hkn h' - rw [hkn'] - -lemma constantEventually'' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (m n k : ℕ) - (hkn : k < n) (hkm : k < m) : (mem_of_union_aux L h n).1 k - = (mem_of_union_aux L h m).1 k := by - rw [constantEventually' L h n k hkn, constantEventually' L h m k hkm] - -end mem_of_union - -/-- For `L : ℕ → Finset (Set α)` such that `∀ K ∈ L n, p K` and -`h : ∀ N, ⋂ k < N, ⋃₀ L k ≠ ∅`, `mem_of_union h n` is some `K : ℕ → Set α` such that `K n ∈ L n` -for all `n` (this is `prop₀`) and `∀ N, ⋂ (j < n, K j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ≠ ∅` -(this is `prop₁`.) -/ -noncomputable def mem_of_union (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) := - fun n ↦ (mem_of_union_aux L h (n + 1)).1 n - -namespace mem_of_union - -lemma prop₀ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : mem_of_union L h n ∈ L n := by - exact (mem_of_union_aux L h (n + 1)).2.1 n (Nat.lt_add_one n) - -lemma isSubset (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n N : ℕ) : - (⋂ j < n, mem_of_union L h j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ⊆ - ⋂ (k < n + N), (⋃₀ (L k).toSet) := by - have h' : ⋂ (k < n + N), (⋃₀ (L k).toSet) = - (⋂ (k < n), (⋃₀ (L k).toSet)) ∩ ⋂ (k < N), (⋃₀ (L (n + k)).toSet) := by - ext x - simp only [mem_iInter, mem_sUnion, Finset.mem_coe, mem_inter_iff] - refine ⟨fun h ↦ ⟨fun i hi ↦ ?_, fun i hi ↦ ?_⟩, fun h i hi ↦ ?_⟩ - · refine h i (lt_of_lt_of_le hi (Nat.le_add_right n N)) - · refine h (n + i) (Nat.add_lt_add_left hi n) - · by_cases hin : i < n - · exact h.1 i hin - · have h₁ : i - n < N := Nat.sub_lt_left_of_lt_add (Nat.le_of_not_lt hin) hi - have h₂ : n + (i - n) = i := by - exact add_sub_of_le <| Nat.le_of_not_lt hin - exact h₂ ▸ h.2 (i - n) h₁ - rw [h'] - apply inter_subset_inter _ fun ⦃a⦄ a ↦ a - have h'' (j : ℕ) (hj : j < n) : mem_of_union L h j ⊆ ⋃₀ (L j).toSet := by - exact subset_sUnion_of_mem <| prop₀ L h j - exact iInter₂_mono h'' - -lemma isSubsetN0 (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : - (⋂ j, mem_of_union L h j) ⊆ - ⋂ k, (⋃₀ (L k).toSet) := by - exact iInter_mono <| fun n ↦ - subset_sUnion_of_subset (↑(L n)) (mem_of_union L h n) (fun ⦃a⦄ a ↦ a) (prop₀ L h n) - -lemma has_p (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) - (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : p (mem_of_union L h n) := by - exact hL n (mem_of_union L h n) (prop₀ L h n) - -lemma prop₁ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : - ∀ N, (⋂ (j < n), (mem_of_union L h j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ := by - have h' : r L n (mem_of_union_aux L h n).fst := (mem_of_union_aux L h n).2.2 - simp only [r] at h' - simp only [mem_of_union] - intro N - specialize h' N - conv at h' => - lhs - enter [1,1] - intro j - enter[1] - intro hj - rw [constantEventually' L h n j hj] - exact h' - -lemma prop₁N0 (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : - (⋂ (j < n), (mem_of_union L h j)) ≠ ∅ := by - have h' : (⋂ (k < 0), (⋃₀ (L (n + k)).toSet)) = univ := by - simp - have d (s : Set α) : s = s ∩ univ := by exact left_eq_inter.mpr fun ⦃a⦄ a ↦ trivial - rw [d (⋂ j, ⋂ (_ : j < n), mem_of_union L h j)] - rw [← h'] - exact prop₁ L h n 0 - -end mem_of_union - -/-- Finite unions of sets in a compact system. -/ -def union (p : Set α → Prop) : Set α → Prop := - (sUnion '' ({ L : Set (Set α) | L.Finite ∧ ∀ K ∈ L, p K})) - -namespace union - -lemma mem_iff (s : Set α) : union p s ↔ ∃ L : Finset (Set α), s = ⋃₀ L ∧ ∀ K ∈ L, p K := by - refine ⟨fun ⟨L, hL⟩ ↦ ?_, fun h ↦ ?_⟩ - · simp only [mem_setOf_eq] at hL - let L' := (hL.1.1).toFinset - use L' - rw [← hL.2, Finite.coe_toFinset] - refine ⟨rfl, fun K hK ↦ ?_⟩ - rw [Finite.mem_toFinset] at hK - apply hL.1.2 K hK - · obtain ⟨L, hL⟩ := h - use L - simp only [mem_setOf_eq, Finset.finite_toSet, Finset.mem_coe, true_and] - refine ⟨hL.2, hL.1.symm⟩ - -theorem isCompactSystem (p : Set α → Prop)(hp : IsCompactSystem p) : IsCompactSystem (union p) := by - have hp' := (IsCompactSystem.iff_of_not_empty p).mp hp - rw [IsCompactSystem.iff_of_not_empty] - intro C hi - simp_rw [mem_iff] at hi - choose L' hL' using hi - have hL'1 := fun n ↦ (hL' n).1 - have hL'2 := fun n ↦ (hL' n).2 - simp_rw [hL'1] - intro hL - let K := mem_of_union L' hL - have h₁ : ⋂ i, K i ⊆ ⋂ i, ⋃₀ (L' i).toSet := by - apply mem_of_union.isSubsetN0 L' - have h₂ : ⋂ i, K i ≠ ∅ := by - apply hp' _ - · apply mem_of_union.has_p - exact hL'2 - · apply mem_of_union.prop₁N0 - rw [← nonempty_iff_ne_empty] at h₂ ⊢ - exact Nonempty.mono h₁ h₂ - -end union - -end Union + refine ⟨fun h' ↦ ⟨h', h'.isClosed⟩, fun h ↦ h.1⟩ + exact h ▸ (of_isCompact_isClosed) -end IsCompactSystem +end IsCompactIsClosed section pi variable {ι : Type*} {α : ι → Type*} +/- In a product space, the intersection of square cylinders is empty iff there is a coordinate `i` +such that the projections to `i` have empty intersection. -/ theorem iInter_pi_empty_iff {β : Type*} (s : β → Set ι) (t : β → (i : ι) → Set (α i)) : - ( ⋂ b, ((s b).pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β) (_: i ∈ s b), (t b i) = ∅):= by + (⋂ b, ((s b).pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β) (_: i ∈ s b), (t b i) = ∅):= by rw [iInter_eq_empty_iff, not_iff_not.symm] push_neg - refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ - · have ⟨x, hx⟩ := h - simp only [nonempty_iInter] - intro i - refine ⟨x i, fun j ↦ ?_⟩ - rw [mem_iInter] - intro hi - simp_rw [mem_pi] at hx - exact hx j i hi - · simp only [nonempty_iInter, mem_iInter] at h - choose x hx using h - use x - simp_rw [mem_pi] - intro i - intro j hj - exact hx j i hj + simp only [nonempty_iInter, mem_iInter] + refine ⟨fun ⟨x, hx⟩ i ↦ ?_, fun h ↦ ?_⟩ + · refine ⟨x i, fun j hi ↦ hx j i hi⟩ + · choose x hx using h + refine ⟨x, fun i j hj ↦ hx j i hj⟩ theorem iInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) : ( ⋂ b, (univ.pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β), (t b i) = ∅):= by @@ -537,7 +313,7 @@ theorem biInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α exact biInter_eq_iInter p fun x h ↦ t x i simp_rw [h, h', iInter_univ_pi_empty_iff] -theorem IsCompactSystem.pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : +theorem pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i)) : IsCompactSystem (univ.pi '' univ.pi C) := by intro S hS h_empty change ∀ i, S i ∈ univ.pi '' univ.pi C at hS @@ -558,6 +334,8 @@ theorem IsCompactSystem.pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCo end pi +end IsCompactSystem + section ClosedCompactSquareCylinders variable {ι : Type*} {α : ι → Type*} @@ -567,117 +345,83 @@ variable [∀ i, TopologicalSpace (α i)] variable (α) /-- The set of sets of the form `s.pi t`, where `s : Finset ι` and `t i` is both, closed and compact, for all `i ∈ s`. -/ -def closedCompactSquareCylinders : Set (Set (Π i, α i)) := - ⋃ (s) (t) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), {squareCylinder s t} - -def closedCompactSquareCylinders' : Set (Set (Π i, α i)) := - ⋃ (s : Finset ι), s.toSet.pi '' s.toSet.pi - (fun (i : ι) ↦ fun t : Set (α i) ↦ IsCompact t ∧ IsClosed t) +def compactClosedSquareCylinders : Set (Set (Π i, α i)) := + ⋃ (s) (t) (_ : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)), {squareCylinder s t} -lemma supset : - closedCompactSquareCylinders' α ⊆ (univ.pi '' univ.pi - (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by - intro S - simp [closedCompactSquareCylinders'] - intro s t hs hS - classical - use fun i ↦ (if i ∈ s then (t i) else univ) - simp - refine ⟨?_, ?_⟩ - · intro i - by_cases hs' : i ∈ s - · simp [hs'] - exact Or.inl (hs i hs') - · simp [hs'] - exact Or.inr rfl - · rw [← hS, ← univ_pi_ite s.toSet t] - simp +def squareCylinders_of_prop (p : (i : ι) → Set (α i) → Prop) : Set (Set (Π i, α i)) := + ⋃ (s) (t) (_ : ∀ i ∈ s, p i (t i)), {squareCylinder s t} variable {α} @[simp] -theorem mem_closedCompactSquareCylinders' (S : Set (Π i, α i)) : - S ∈ closedCompactSquareCylinders' α +theorem mem_compactClosedSquareCylinders_iff (S : Set (Π i, α i)) : + S ∈ compactClosedSquareCylinders α ↔ ∃ (s t : _) (_ : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)), - squareCylinder s t = S := by - refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ <;> - simp only [closedCompactSquareCylinders', squareCylinder, - mem_iUnion, mem_image, mem_pi, Finset.mem_coe, exists_prop] at h ⊢ <;> - · exact h - -@[simp] -theorem mem_closedCompactSquareCylinders (S : Set (Π i, α i)) : - S ∈ closedCompactSquareCylinders α - ↔ ∃ (s t : _) (_ : ∀ i ∈ s, IsClosed (t i)) (_ : ∀ i ∈ s, IsCompact (t i)), S = squareCylinder s t := by - simp_rw [closedCompactSquareCylinders, mem_iUnion, mem_singleton_iff] + simp_rw [compactClosedSquareCylinders, mem_iUnion, mem_singleton_iff] + variable {S : Set (Π i, α i)} /-- Given a closed compact cylinder, choose a finset of variables such that it only depends on these variables. -/ -noncomputable def closedCompactSquareCylinders.finset (hS : S ∈ closedCompactSquareCylinders α) : +noncomputable def compactClosedSquareCylinders.finset (hS : S ∈ compactClosedSquareCylinders α) : Finset ι := - ((mem_closedCompactSquareCylinders S).mp hS).choose + ((mem_compactClosedSquareCylinders_iff S).mp hS).choose /-- Given a closed compact square cylinder `S`, choose a dependent function `(i : ι) → Set (α i)` of which it is a lift. -/ -def closedCompactSquareCylinders.func (hS : S ∈ closedCompactSquareCylinders α) : +def closedCompactSquareCylinders.func (hS : S ∈ compactClosedSquareCylinders α) : (i : ι) → Set (α i) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose - -theorem closedCompactSquareCylinders.isClosed (hS : S ∈ closedCompactSquareCylinders α) : - ∀ i ∈ closedCompactSquareCylinders.finset hS, - IsClosed (closedCompactSquareCylinders.func hS i) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose + ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose -theorem closedCompactSquareCylinders.isCompact (hS : S ∈ closedCompactSquareCylinders α) : - ∀ i ∈ closedCompactSquareCylinders.finset hS, - IsCompact (closedCompactSquareCylinders.func hS i) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose +theorem compactClosedSquareCylinders.isCompact_isClosed (hS : S ∈ compactClosedSquareCylinders α) : + ∀ i ∈ compactClosedSquareCylinders.finset hS, + IsCompact (closedCompactSquareCylinders.func hS i) ∧ + IsClosed (closedCompactSquareCylinders.func hS i) := + ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose_spec.choose -theorem closedCompactSquareCylinders.eq_squareCylinder (hS : S ∈ closedCompactSquareCylinders α) : - S = squareCylinder (closedCompactSquareCylinders.finset hS) +theorem closedCompactSquareCylinders.eq_squareCylinder (hS : S ∈ compactClosedSquareCylinders α) : + S = squareCylinder (compactClosedSquareCylinders.finset hS) (closedCompactSquareCylinders.func hS) := - ((mem_closedCompactSquareCylinders S).mp hS).choose_spec.choose_spec.choose_spec.choose_spec + ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose_spec.choose_spec theorem squareCylinder_mem_closedCompactSquareCylinders (s : Finset ι) (t : (i : ι) → Set (α i)) - (hS_closed : ∀ i ∈ s, IsClosed (t i)) (hS_compact : ∀ i ∈ s, IsCompact (t i)) : - squareCylinder s t ∈ closedCompactSquareCylinders α := by - rw [mem_closedCompactSquareCylinders] - exact ⟨s, t, hS_closed, hS_compact, rfl⟩ + (h : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)) : + squareCylinder s t ∈ compactClosedSquareCylinders α := by + rw [mem_compactClosedSquareCylinders_iff] + exact ⟨s, t, h, rfl⟩ -theorem IsCompactSystem.CompactClosedOrUniv_pi : +theorem CompactClosedOrUniv_pi : IsCompactSystem (univ.pi '' univ.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by apply IsCompactSystem.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ))) - <| fun i ↦ IsCompactSystem.isClosedCompactOrUnivs (α i) + <| fun i ↦ IsCompactSystem.of_isCompact_isClosed_or_univ /-- In `closedCompactSquareCylinders α`, the set of dependent variables is a finset, but not necessarily in `univ.pi '' univ.pi _`, where `_` are closed compact set, or `univ`. -/ -theorem closedCompactSquareCylinders_supset (S : _) : - S ∈ closedCompactSquareCylinders α → S ∈ (univ.pi '' univ.pi +theorem compactClosedSquareCylinders_supset (S : _) : + S ∈ compactClosedSquareCylinders α → S ∈ (univ.pi '' univ.pi (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by classical intro hS - simp_rw [mem_closedCompactSquareCylinders, squareCylinder] at hS + simp_rw [mem_compactClosedSquareCylinders_iff, squareCylinder] at hS simp only [mem_image, mem_pi, mem_univ, forall_const] obtain ⟨s, t, h_cl, h_co, h_pi⟩ := hS let t' := fun (i : ι) ↦ if (i ∈ s) then (t i) else univ - refine ⟨t', ?_, ?_⟩ - · intro i - by_cases hi : i ∈ s + refine ⟨t', fun i ↦ ?_, ?_⟩ + · by_cases hi : i ∈ s · simp only [hi, ↓reduceIte, t'] - exact Or.inl ⟨h_co i hi, h_cl i hi⟩ + exact Or.inl (h_cl i hi) · simp only [hi, ↓reduceIte, t'] apply Or.inr rfl - · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = S - rw [h_pi, univ_pi_ite s t] + · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = (s : Set ι).pi t + rw [univ_pi_ite s t] /-- Closed and compact square cylinders form a compact system. -/ -theorem IsCompactSystem.closedCompactSquareCylinders : - IsCompactSystem (closedCompactSquareCylinders α) := - IsCompactSystem.of_supset IsCompactSystem.CompactClosedOrUniv_pi - closedCompactSquareCylinders_supset +theorem isCompactSystem.compactClosedSquareCylinders : + IsCompactSystem (compactClosedSquareCylinders α) := + IsCompactSystem.mono CompactClosedOrUniv_pi + compactClosedSquareCylinders_supset end ClosedCompactSquareCylinders From b607c038b301b4aff354dc864ce37ca227678150 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Sun, 1 Jun 2025 22:26:00 +0200 Subject: [PATCH 113/129] runs half --- .../Topology/Compactness/CompactSystem.lean | 426 ++++++++++++++++++ 1 file changed, 426 insertions(+) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 1fd9d0c72a7f1e..590453f2465455 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -282,6 +282,432 @@ theorem of_isCompact [T2Space α] : end IsCompactIsClosed +end IsCompactSystem + +section PrefixInduction + +variable {β : Type*} +variable (q : ∀ n, (k : Fin n → β) → Prop) +variable (step0 : q 0 Fin.elim0) +variable (step : + ∀ n (k : Fin n → β) (_ : q n k), + { a : β // q (n+1) (Fin.snoc k a)}) + +/-- In this section, we prove a general induction principle, which we need for the construction +`Nat.prefixInduction q step0 step : ℕ → β` based on some `q : (n : ℕ) → (Fin n → β) → Prop`. For +the inducation start, `step0 : q 0 _` requires that `Fin 0` cannot be satisfied, and +`step : (n : ℕ) → (k : Fin n → β) → q n k → { a : β // q (n + 1) (Fin.snoc k a) }) (n : ℕ) : β` +constructs the next element satisfying `q (n + 1) _` from a proof of `q n k` and finding the next +element. + +In comparisong to other induction principles, the proofs of `q n k` are needed in order to find +the next element. -/ + +def Nat.prefixInduction.aux : ∀ (n : Nat), { k : Fin n → β // q n k } + | 0 => ⟨Fin.elim0, step0⟩ + | n+1 => + let ⟨k, hk⟩ := aux n + let ⟨a, ha⟩ := step n k hk + ⟨Fin.snoc k a, ha⟩ + +theorem Nat.prefixInduction.auxConsistent : + ∀ n (i : Fin n), + (Nat.prefixInduction.aux q step0 step (i+1)).1 (Fin.last i) = + (Nat.prefixInduction.aux q step0 step n).1 i := by + intro n + induction n + next => simp + next n ih => + apply Fin.lastCases + case last => simp + case cast => + intro i + simp only [Fin.coe_castSucc] + rw [ih, aux] + simp + +def Nat.prefixInduction (n : Nat) : β := + (Nat.prefixInduction.aux q step0 step (n+1)).1 (Fin.last n) + +theorem Nat.prefixInduction_spec (n : Nat) : q n (Nat.prefixInduction q step0 step ·) := by + cases n + next => + convert step0 + next n => + have hk := (Nat.prefixInduction.aux q step0 step (n+1)).2 + convert hk with i + apply Nat.prefixInduction.auxConsistent + +/- Often, `step` can only be proved by showing an `∃` statement. For this case, we use `step'`. -/ +variable (step' : ∀ n (k : Fin n → β) (_ : q n k), ∃ a, q (n + 1) (Fin.snoc k a)) + +noncomputable def step_of : (n : ℕ) → (k : Fin n → β) → (hn : q n k) → + { a : β // q (n + 1) (Fin.snoc k a) } := + fun n k hn ↦ ⟨(step' n k hn).choose, (step' n k hn).choose_spec⟩ + +noncomputable def Nat.prefixInduction' (n : Nat) : β := + (Nat.prefixInduction.aux q step0 (fun n k hn ↦ step_of q step' n k hn) (n+1)).1 (Fin.last n) + +theorem Nat.prefixInduction'_spec (n : Nat) : q n (Nat.prefixInduction' q step0 step' ·) := by + apply prefixInduction_spec + +end PrefixInduction + +namespace IsCompactSystem + +section Union + +-- (hp : IsCompactSystem p) +-- (L : ℕ → Finset (Set α)) +-- (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) + +/-- `q n K` is the joint property that `∀ (k : Fin n), K k ∈ L k` and +`∀ N, (⋂ (j : Fin n), K j) ∩ (⋂ (k < N), ⋃₀ (L (n + k)).toSet) ≠ ∅`.` holds. -/ +def q (L : ℕ → Finset (Set α)) + : ∀ n, (Fin n → Set α) → Prop := fun n K ↦ (∀ (k : Fin n), K k ∈ L k ∧ + (∀ N, (⋂ j, K j) ∩ (⋂ (k < N), ⋃₀ (L (n + k)).toSet) ≠ ∅)) + +lemma step0 {L : ℕ → Finset (Set α)} : q L 0 Fin.elim0 := by + simp [q] + +lemma step' (hp : IsCompactSystem p) {L : ℕ → Finset (Set α)} + (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) + : ∀ n (k : Fin n → Set α), (q L n k) → ∃ a, q L (n + 1) (Fin.snoc k a) := by + sorry + +noncomputable def mem_of_union (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) + (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) : ℕ → Set α := by + exact Nat.prefixInduction' (q L) step0 (step' hp hL) + +theorem mem_of_union_spec (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) + (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) (n : ℕ) : + q (L := L) n (mem_of_union hp L hL · ) := + Nat.prefixInduction'_spec (q L) step0 (step' hp hL) n + + + + +def get_element_zero (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : + { K : Fin 0 → Set α // (q L) 0 K} := by + exists fun _ => ∅ + simp [q, h] + +#check Fin.snoc_castSucc + +example {n : ℕ} (f : Fin n → α) (a : α) (k : Fin n) : Fin.snoc (α := fun _ ↦ α) + f a k.castSucc = f k := by + exact Fin.snoc_castSucc (α := fun _ ↦ α) a f k + +example {n : ℕ} (f : Fin n → α) (a : α) : (Fin.snoc (α := fun _ ↦ Set α) f a) (Fin.last _) = a := by + sorry + +def find0 (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : (q L) 0 Fin.elim0 := by + sorry + +def findSucc (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : ∀ n (k : Fin n → Set α) + (_ : (q L) n k), { a : Set α // (q L) (n + 1) (Fin.snoc k a) } := by + sorry +-- ∀ n (k : Fin n → α) (_ : q n k), { a : α // q (n+1) (Fin.snoc k a)}) + + +/-- For `L : ℕ → Finset (Set α)` such that `∀ K ∈ L n, p K` and +`h : ∀ N, ⋂ k < N, ⋃₀ L k ≠ ∅`, `mem_of_union h n` is some `K : ℕ → Set α` such that `K n ∈ L n` +for all `n` (this is `prop₀`) and `∀ N, ⋂ (j < n, K j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ≠ ∅` +(this is `prop₁`.) -/ +noncomputable def mem_of_union (L : ℕ → Finset (Set α)) (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) := + Nat.prefixInduction (α := (fun _ ↦ Set α)) (q L) (find0 L h) (findSucc L h) + + +#exit + + + + +lemma l2 {ι : Type*} (s t : Set α) (u : Set ι) (L : (i : ι) → (hi : i ∈ u) → Set α) + (h : s ⊆ ⋃ (n : ι) (hn : n ∈ u), L n hn) (h' : ∀ (n : ι) (hn : n ∈ u), t ∩ (L n hn) = ∅) : + t ∩ s = ∅ := by + have j : ⋃ (n : ι) (hn : n ∈ u), t ∩ (L n hn) = ∅ := by + simp_rw [iUnion_eq_empty] + exact h' + simp_rw [← subset_empty_iff] at h' j ⊢ + have j' : ⋃ (n : u), t ∩ L n.val n.prop = ⋃ n, ⋃ (hn : n ∈ u), t ∩ L n hn := by + exact iUnion_coe_set u fun i ↦ t ∩ L (↑i) (Subtype.prop i) + rw [← j', ← inter_iUnion, iUnion_coe_set] at j + have gf := inter_subset_inter (t₁ := t) (fun ⦃a_1⦄ a ↦ a) h + apply le_trans gf j + + +-- variable (p : {n : ℕ} → ((k : Fin (n + 1)) → (β k)) → Prop) + +/-- `r n K` is the property which must hold for compact systems: +`∀ N, (⋂ (j < n), (K j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅`. -/ +noncomputable def r (n : ℕ) (K : ℕ → Set α) : Prop := + ∀ N, (⋂ (j < n), (K j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ + +-- h0 -> (get_element_zero hL hc) +-- (h0 : ∃ x : (ℕ → α), x 0 ∈ β 0 ∧ p 0 x) + +lemma nonempty' (n : ℕ) (K : ℕ → Set α) + (hc : ∀ N, (⋂ (k < n), K k) ∩ (⋂ k < N, ⋃₀ (L (n + k))) ≠ ∅) : (L n).Nonempty := by + specialize hc 1 + by_contra! h + simp only [Finset.not_nonempty_iff_eq_empty] at h + apply hc + simp [h] + +lemma nonempty (k : ℕ) (hc : ∀ N, ⋂ k < N, ⋃₀ (L k : Set (Set α)) ≠ ∅) : (L k).Nonempty := by + specialize hc (k + 1) + by_contra! h + simp only [Finset.not_nonempty_iff_eq_empty] at h + apply hc + apply iInter_eq_empty_iff.mpr fun x ↦ ⟨k, ?_⟩ + -- simp only [Nat.lt_add_one, iInter_true, mem_sUnion, Finset.mem_coe, not_exists, not_and] + simp only [Nat.lt_add_one, iInter_true, Finset.mem_coe, not_exists, not_and] + have hg : ⋃₀ (L k : Set (Set α)) = ∅ := by + rw [h] + simp only [Finset.coe_empty, sUnion_empty] + exact of_eq_false (congrFun hg x) + +/-- `q n K` is the joint property that `(∀ k < n, K k ∈ L k)` and `r n K)` holds. -/ +def q : ℕ → (ℕ → Set α) → Prop := fun n K ↦ (∀ k < n, K k ∈ L k) ∧ (r L n K) + +lemma get_element_zero' (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : + ∃ (K : ℕ → Set α), q L 0 K := by + simp [q, r, h] + +def get_element_zero (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : + { K : ℕ → Set α // q L 0 K} := by + exists fun _ => ∅ + simp [q, r, h] + +lemma get_element_succ' (n : ℕ) + (K : ℕ → Set α) (hK : q L n K) : ∃ y, q L (n + 1) (Function.update K n y) := by + simp_rw [q, r] at hK ⊢ + by_contra! h + choose b hb using h + have hn : ∀ y ∈ L n, ∀ k < n + 1, Function.update K n y k ∈ L k := by + intro y hy k hk + by_cases d : n = k + · rw [d] + simp only [Function.update_self] + exact d ▸ hy + · have d' : k < n := by + by_contra h + apply d + simp only [not_lt] at h + apply Eq.symm + exact Nat.eq_of_le_of_lt_succ h hk + simp only [ne_eq, d'.ne, not_false_eq_true, Function.update_of_ne] + exact hK.1 k d' + classical + let b' := fun y ↦ dite (y ∈ L n) (fun hy ↦ (b y (hn y hy))) (fun _ ↦ 0) + have hb' := fun y hy ↦ hb y (hn y hy) + have hb'' (y : Set α) (hy : y ∈ L n) : b y (hn y hy) = b' y := by + simp [b', hy] + obtain ⟨K0Max, ⟨hK0₁, hK0₂⟩⟩ := Finset.exists_max_image (L n) b' (nonempty' L n K hK.2) + apply hK.2 (b' K0Max + 1) + have h₁ (y s : Set α): (⋂ j, ⋂ (_ : j < n + 1), Function.update K n y j) ∩ s = + (⋂ j, ⋂ (_ : j < n), K j) ∩ y ∩ s := by + apply congrFun (congrArg Inter.inter _) s + ext x + refine ⟨fun h ↦ ⟨?_, ?_⟩, fun h ↦ ?_⟩ <;> simp only [mem_iInter, mem_inter_iff] at h ⊢ + · intro i hi + have h' := h i (le_trans hi (le_succ n)) + simp only [ne_eq, hi.ne, not_false_eq_true, Function.update_of_ne] at h' + exact h' + · have h'' := h n (Nat.lt_add_one n) + simp only [Function.update_self] at h'' + exact h'' + · intro i hi + by_cases h₁ : i < n + · simp only [ne_eq, h₁.ne, not_false_eq_true, Function.update_of_ne] + exact h.1 i h₁ + · simp only [not_lt] at h₁ + have h₂ := Nat.eq_of_le_of_lt_succ h₁ hi + rw [h₂] + simp only [Function.update_self] + exact h.2 + simp_rw [h₁] at hb' + + have h₂ : ⋂ k < b' K0Max + 1, ⋃₀ (L (n + k)).toSet ⊆ + ⋃ (y : Set α) (hy : y ∈ L n), y ∩ ⋂ (k < b y (hn y hy)), ⋃₀ (L (n + 1 + k)).toSet := by + obtain ⟨y, hy⟩ := nonempty' L n K hK.2 + intro x hx + simp only [mem_iInter, mem_sUnion, Finset.mem_coe, mem_iUnion, mem_inter_iff, + exists_and_left] at hx ⊢ + obtain ⟨i, hi⟩ := hx 0 (zero_lt_succ (b' K0Max)) + rw [add_zero] at hi + use i, hi.2, hi.1 + intro k hk + have hk' : 1 + k < b' K0Max + 1:= by + rw [add_comm] + simp only [Nat.add_lt_add_iff_right] + apply lt_of_lt_of_le hk + rw [hb''] + apply hK0₂ i hi.1 + exact hi.1 + obtain ⟨t, ht⟩ := hx (1 + k) hk' + rw [← add_assoc] at ht + use t, ht.1, ht.2 + simp_rw [inter_assoc] at hb' + apply l2 (s := ⋂ k < b' K0Max + 1, ⋃₀ (L (n + k)).toSet) (t := (⋂ j < n, K j)) (u := L n) + (L := fun (y : Set α) (hy : y ∈ L n) ↦ (y ∩ ⋂ k, ⋂ (hk : k < b y (hn y hy)), + ⋃₀ (L (n + 1 + k)).toSet)) h₂ hb' + +/-- `mem_of_union_aux h n` is the product of some `K : ℕ → Set α)` and `q n K`. +Constructing `(mem_of_union_aux h n).1` works inductively. When constructing +`(mem_of_union_aux h (n + 1)).1`, we update `(mem_of_union_aux h n).1` only at position `n`. -/ +noncomputable def mem_of_union_aux (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : + (n : ℕ) → {K : ℕ → Set α | q L n K} + | 0 => get_element_zero L h + | n + 1 => by + have g := (get_element_succ' L) n (mem_of_union_aux h n).1 (mem_of_union_aux h n).2 + exact ⟨Function.update (mem_of_union_aux h n).1 n g.choose, g.choose_spec⟩ + +namespace mem_of_union + +lemma constantEventually (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n k : ℕ) (hkn : k < n) : + (mem_of_union_aux L h n).1 k = (mem_of_union_aux L h (n + 1)).1 k := by + simp [mem_of_union_aux, hkn.ne] + +lemma constantEventually' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n k : ℕ) (hkn : k < n) : + (mem_of_union_aux L h n).1 k = (mem_of_union_aux L h (k + 1)).1 k := by + induction n with + | zero => + cases hkn + | succ n hn => + by_cases h' : k < n + · rw [← hn h'] + exact (constantEventually L h n k h').symm + · have hkn' : k = n := by + exact Nat.eq_of_lt_succ_of_not_lt hkn h' + rw [hkn'] + +lemma constantEventually'' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (m n k : ℕ) + (hkn : k < n) (hkm : k < m) : (mem_of_union_aux L h n).1 k + = (mem_of_union_aux L h m).1 k := by + rw [constantEventually' L h n k hkn, constantEventually' L h m k hkm] + +end mem_of_union + +/-- For `L : ℕ → Finset (Set α)` such that `∀ K ∈ L n, p K` and +`h : ∀ N, ⋂ k < N, ⋃₀ L k ≠ ∅`, `mem_of_union h n` is some `K : ℕ → Set α` such that `K n ∈ L n` +for all `n` (this is `prop₀`) and `∀ N, ⋂ (j < n, K j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ≠ ∅` +(this is `prop₁`.) -/ +noncomputable def mem_of_union (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) := + fun n ↦ (mem_of_union_aux L h (n + 1)).1 n + +namespace mem_of_union + +lemma prop₀ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : mem_of_union L h n ∈ L n := by + exact (mem_of_union_aux L h (n + 1)).2.1 n (Nat.lt_add_one n) + +lemma isSubset (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n N : ℕ) : + (⋂ j < n, mem_of_union L h j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ⊆ + ⋂ (k < n + N), (⋃₀ (L k).toSet) := by + have h' : ⋂ (k < n + N), (⋃₀ (L k).toSet) = + (⋂ (k < n), (⋃₀ (L k).toSet)) ∩ ⋂ (k < N), (⋃₀ (L (n + k)).toSet) := by + ext x + simp only [mem_iInter, mem_sUnion, Finset.mem_coe, mem_inter_iff] + refine ⟨fun h ↦ ⟨fun i hi ↦ ?_, fun i hi ↦ ?_⟩, fun h i hi ↦ ?_⟩ + · refine h i (lt_of_lt_of_le hi (Nat.le_add_right n N)) + · refine h (n + i) (Nat.add_lt_add_left hi n) + · by_cases hin : i < n + · exact h.1 i hin + · have h₁ : i - n < N := Nat.sub_lt_left_of_lt_add (Nat.le_of_not_lt hin) hi + have h₂ : n + (i - n) = i := by + exact add_sub_of_le <| Nat.le_of_not_lt hin + exact h₂ ▸ h.2 (i - n) h₁ + rw [h'] + apply inter_subset_inter _ fun ⦃a⦄ a ↦ a + have h'' (j : ℕ) (hj : j < n) : mem_of_union L h j ⊆ ⋃₀ (L j).toSet := by + exact subset_sUnion_of_mem <| prop₀ L h j + exact iInter₂_mono h'' + +lemma isSubsetN0 (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : + (⋂ j, mem_of_union L h j) ⊆ + ⋂ k, (⋃₀ (L k).toSet) := by + exact iInter_mono <| fun n ↦ + subset_sUnion_of_subset (↑(L n)) (mem_of_union L h n) (fun ⦃a⦄ a ↦ a) (prop₀ L h n) + +lemma has_p (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) + (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : p (mem_of_union L h n) := by + exact hL n (mem_of_union L h n) (prop₀ L h n) + +lemma prop₁ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : + ∀ N, (⋂ (j < n), (mem_of_union L h j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ := by + have h' : r L n (mem_of_union_aux L h n).val := (mem_of_union_aux L h n).2.2 + simp only [r] at h' + simp only [mem_of_union] + intro N + specialize h' N + conv at h' => + lhs + enter [1,1] + intro j + enter[1] + intro hj + rw [constantEventually' L h n j hj] + exact h' + +lemma prop₁N0 (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : + (⋂ (j < n), (mem_of_union L h j)) ≠ ∅ := by + have h' : (⋂ (k < 0), (⋃₀ (L (n + k)).toSet)) = univ := by + simp + have d (s : Set α) : s = s ∩ univ := by exact left_eq_inter.mpr fun ⦃a⦄ a ↦ trivial + rw [d (⋂ j, ⋂ (_ : j < n), mem_of_union L h j)] + rw [← h'] + exact prop₁ L h n 0 + +end mem_of_union + +/-- Finite unions of sets in a compact system. -/ +def union (p : Set α → Prop) : Set α → Prop := + (sUnion '' ({ L : Set (Set α) | L.Finite ∧ ∀ K ∈ L, p K})) + +namespace union + +lemma mem_iff (s : Set α) : union p s ↔ ∃ L : Finset (Set α), s = ⋃₀ L ∧ ∀ K ∈ L, p K := by + refine ⟨fun ⟨L, hL⟩ ↦ ?_, fun h ↦ ?_⟩ + · simp only [mem_setOf_eq] at hL + let L' := (hL.1.1).toFinset + use L' + rw [← hL.2, Finite.coe_toFinset] + refine ⟨rfl, fun K hK ↦ ?_⟩ + rw [Finite.mem_toFinset] at hK + apply hL.1.2 K hK + · obtain ⟨L, hL⟩ := h + use L + simp only [mem_setOf_eq, Finset.finite_toSet, Finset.mem_coe, true_and] + refine ⟨hL.2, hL.1.symm⟩ + +theorem isCompactSystem (p : Set α → Prop)(hp : IsCompactSystem p) : IsCompactSystem (union p) := by + have hp' := (IsCompactSystem.iff_of_not_empty p).mp hp + rw [IsCompactSystem.iff_of_not_empty] + intro C hi + simp_rw [mem_iff] at hi + choose L' hL' using hi + have hL'1 := fun n ↦ (hL' n).1 + have hL'2 := fun n ↦ (hL' n).2 + simp_rw [hL'1] + intro hL + let K := mem_of_union L' hL + have h₁ : ⋂ i, K i ⊆ ⋂ i, ⋃₀ (L' i).toSet := by + apply mem_of_union.isSubsetN0 L' + have h₂ : ⋂ i, K i ≠ ∅ := by + apply hp' _ + · apply mem_of_union.has_p + exact hL'2 + · apply mem_of_union.prop₁N0 + rw [← nonempty_iff_ne_empty] at h₂ ⊢ + exact Nonempty.mono h₁ h₂ + +end union + +end Union + +end IsCompactSystem + section pi variable {ι : Type*} {α : ι → Type*} From 85ffbdb99154179165d3b31c2a9de3bfdf6fd0e1 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Mon, 9 Jun 2025 22:53:48 +0200 Subject: [PATCH 114/129] reworked recursion --- .../Topology/Compactness/CompactSystem.lean | 500 +++++++----------- 1 file changed, 190 insertions(+), 310 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 590453f2465455..43a622f37cfc96 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -87,6 +87,16 @@ lemma iff_nonempty_iInter_of_lt (p : Set α → Prop) : IsCompactSystem p ↔ rw [mem_iInter₂, mem_iInter₂] exact fun h i hi ↦ h i hi.le +lemma k (s : ℕ → Set α) (n : ℕ) : ⋂ (j < n), s j = ⋂ (j : Fin n), s j := by + ext x + simp only [mem_iInter] + refine ⟨fun h i ↦ h i.val i.prop, fun h i hi ↦ h ⟨i, hi⟩⟩ + +lemma iff_nonempty_iInter_of_lt' (p : Set α → Prop) : IsCompactSystem p ↔ + ∀ C : ℕ → Set α, (∀ i, p (C i)) → (∀ n, (⋂ k : Fin n, C k).Nonempty) → (⋂ i, C i).Nonempty := by + rw [iff_nonempty_iInter_of_lt] + simp_rw [← k] + /-- Any subset of a compact system is a compact system. -/ theorem mono {C D : (Set α) → Prop} (hD : IsCompactSystem D) (hCD : ∀ s, C s → D s) : IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs @@ -286,25 +296,29 @@ end IsCompactSystem section PrefixInduction -variable {β : Type*} -variable (q : ∀ n, (k : Fin n → β) → Prop) -variable (step0 : q 0 Fin.elim0) +def Fin.elim0'.{u} {α : ℕ → Sort u} : (i : Fin 0) → (α i) + | ⟨_, h⟩ => absurd h (Nat.not_lt_zero _) + +variable {β : ℕ → Type*} +variable (q : ∀ n, (k : (i : Fin n) → (β i)) → Prop) +variable (step0 : q 0 Fin.elim0') variable (step : - ∀ n (k : Fin n → β) (_ : q n k), - { a : β // q (n+1) (Fin.snoc k a)}) + ∀ n (k : (i : Fin n) → (β i)) (_ : q n k), + { a : β n // q (n+1) (Fin.snoc k a)}) /-- In this section, we prove a general induction principle, which we need for the construction -`Nat.prefixInduction q step0 step : ℕ → β` based on some `q : (n : ℕ) → (Fin n → β) → Prop`. For +`Nat.prefixInduction q step0 step : (k : ℕ) → (β k)` based on some +`q : (n : ℕ) → (k : (i : Fin n) → (β i)) → Prop`. For the inducation start, `step0 : q 0 _` requires that `Fin 0` cannot be satisfied, and -`step : (n : ℕ) → (k : Fin n → β) → q n k → { a : β // q (n + 1) (Fin.snoc k a) }) (n : ℕ) : β` -constructs the next element satisfying `q (n + 1) _` from a proof of `q n k` and finding the next -element. +`step : (n : ℕ) → (k : (i : Fin n) → β i) → q n k → { a : β n // q (n + 1) (Fin.snoc k a) })` +`(n : ℕ) : β n` constructs the next element satisfying `q (n + 1) _` from a proof of `q n k` +and finding the next element. In comparisong to other induction principles, the proofs of `q n k` are needed in order to find the next element. -/ -def Nat.prefixInduction.aux : ∀ (n : Nat), { k : Fin n → β // q n k } - | 0 => ⟨Fin.elim0, step0⟩ +def Nat.prefixInduction.aux : ∀ (n : Nat), { k : (i : Fin n) → (β i) // q n k } + | 0 => ⟨Fin.elim0', step0⟩ | n+1 => let ⟨k, hk⟩ := aux n let ⟨a, ha⟩ := step n k hk @@ -326,26 +340,25 @@ theorem Nat.prefixInduction.auxConsistent : rw [ih, aux] simp -def Nat.prefixInduction (n : Nat) : β := +def Nat.prefixInduction (n : Nat) : β n := (Nat.prefixInduction.aux q step0 step (n+1)).1 (Fin.last n) theorem Nat.prefixInduction_spec (n : Nat) : q n (Nat.prefixInduction q step0 step ·) := by cases n - next => - convert step0 - next n => + · convert step0 + · next n => have hk := (Nat.prefixInduction.aux q step0 step (n+1)).2 convert hk with i apply Nat.prefixInduction.auxConsistent /- Often, `step` can only be proved by showing an `∃` statement. For this case, we use `step'`. -/ -variable (step' : ∀ n (k : Fin n → β) (_ : q n k), ∃ a, q (n + 1) (Fin.snoc k a)) +variable (step' : ∀ n (k : (i : Fin n) → (β i)) (_ : q n k), ∃ a, q (n + 1) (Fin.snoc k a)) -noncomputable def step_of : (n : ℕ) → (k : Fin n → β) → (hn : q n k) → - { a : β // q (n + 1) (Fin.snoc k a) } := +noncomputable def step_of : (n : ℕ) → (k : (i : Fin n) → (β i)) → (hn : q n k) → + { a : β n // q (n + 1) (Fin.snoc k a) } := fun n k hn ↦ ⟨(step' n k hn).choose, (step' n k hn).choose_spec⟩ -noncomputable def Nat.prefixInduction' (n : Nat) : β := +noncomputable def Nat.prefixInduction' (n : Nat) : β n := (Nat.prefixInduction.aux q step0 (fun n k hn ↦ step_of q step' n k hn) (n+1)).1 (Fin.last n) theorem Nat.prefixInduction'_spec (n : Nat) : q n (Nat.prefixInduction' q step0 step' ·) := by @@ -364,300 +377,173 @@ section Union /-- `q n K` is the joint property that `∀ (k : Fin n), K k ∈ L k` and `∀ N, (⋂ (j : Fin n), K j) ∩ (⋂ (k < N), ⋃₀ (L (n + k)).toSet) ≠ ∅`.` holds. -/ def q (L : ℕ → Finset (Set α)) - : ∀ n, (Fin n → Set α) → Prop := fun n K ↦ (∀ (k : Fin n), K k ∈ L k ∧ - (∀ N, (⋂ j, K j) ∩ (⋂ (k < N), ⋃₀ (L (n + k)).toSet) ≠ ∅)) - -lemma step0 {L : ℕ → Finset (Set α)} : q L 0 Fin.elim0 := by - simp [q] - -lemma step' (hp : IsCompactSystem p) {L : ℕ → Finset (Set α)} - (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) - : ∀ n (k : Fin n → Set α), (q L n k) → ∃ a, q L (n + 1) (Fin.snoc k a) := by - sorry - -noncomputable def mem_of_union (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) - (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) : ℕ → Set α := by - exact Nat.prefixInduction' (q L) step0 (step' hp hL) - -theorem mem_of_union_spec (hp : IsCompactSystem p) (L : ℕ → Finset (Set α)) - (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) (n : ℕ) : - q (L := L) n (mem_of_union hp L hL · ) := - Nat.prefixInduction'_spec (q L) step0 (step' hp hL) n - - - - -def get_element_zero (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : - { K : Fin 0 → Set α // (q L) 0 K} := by - exists fun _ => ∅ - simp [q, h] - -#check Fin.snoc_castSucc - -example {n : ℕ} (f : Fin n → α) (a : α) (k : Fin n) : Fin.snoc (α := fun _ ↦ α) - f a k.castSucc = f k := by - exact Fin.snoc_castSucc (α := fun _ ↦ α) a f k + : ∀ n, (K : (k : Fin n) → (L k)) → Prop := fun n K ↦ + (∀ N, ((⋂ j, K j) ∩ (⋂ (k < N), ⋃₀ (L (n + k)).toSet)).Nonempty) -example {n : ℕ} (f : Fin n → α) (a : α) : (Fin.snoc (α := fun _ ↦ Set α) f a) (Fin.last _) = a := by +example (n : ℕ) (K : (k : Fin n) → Set α) : + ⋂ i, K i = ⋂ (i : ℕ) (hi : i < n), K ⟨i, hi⟩ := by sorry -def find0 (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : (q L) 0 Fin.elim0 := by - sorry - -def findSucc (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : ∀ n (k : Fin n → Set α) - (_ : (q L) n k), { a : Set α // (q L) (n + 1) (Fin.snoc k a) } := by - sorry --- ∀ n (k : Fin n → α) (_ : q n k), { a : α // q (n+1) (Fin.snoc k a)}) - - -/-- For `L : ℕ → Finset (Set α)` such that `∀ K ∈ L n, p K` and -`h : ∀ N, ⋂ k < N, ⋃₀ L k ≠ ∅`, `mem_of_union h n` is some `K : ℕ → Set α` such that `K n ∈ L n` -for all `n` (this is `prop₀`) and `∀ N, ⋂ (j < n, K j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ≠ ∅` -(this is `prop₁`.) -/ -noncomputable def mem_of_union (L : ℕ → Finset (Set α)) (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) := - Nat.prefixInduction (α := (fun _ ↦ Set α)) (q L) (find0 L h) (findSucc L h) - - -#exit - - - - -lemma l2 {ι : Type*} (s t : Set α) (u : Set ι) (L : (i : ι) → (hi : i ∈ u) → Set α) - (h : s ⊆ ⋃ (n : ι) (hn : n ∈ u), L n hn) (h' : ∀ (n : ι) (hn : n ∈ u), t ∩ (L n hn) = ∅) : - t ∩ s = ∅ := by - have j : ⋃ (n : ι) (hn : n ∈ u), t ∩ (L n hn) = ∅ := by - simp_rw [iUnion_eq_empty] - exact h' - simp_rw [← subset_empty_iff] at h' j ⊢ - have j' : ⋃ (n : u), t ∩ L n.val n.prop = ⋃ n, ⋃ (hn : n ∈ u), t ∩ L n hn := by - exact iUnion_coe_set u fun i ↦ t ∩ L (↑i) (Subtype.prop i) - rw [← j', ← inter_iUnion, iUnion_coe_set] at j - have gf := inter_subset_inter (t₁ := t) (fun ⦃a_1⦄ a ↦ a) h - apply le_trans gf j - - --- variable (p : {n : ℕ} → ((k : Fin (n + 1)) → (β k)) → Prop) - -/-- `r n K` is the property which must hold for compact systems: -`∀ N, (⋂ (j < n), (K j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅`. -/ -noncomputable def r (n : ℕ) (K : ℕ → Set α) : Prop := - ∀ N, (⋂ (j < n), (K j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ - --- h0 -> (get_element_zero hL hc) --- (h0 : ∃ x : (ℕ → α), x 0 ∈ β 0 ∧ p 0 x) - -lemma nonempty' (n : ℕ) (K : ℕ → Set α) - (hc : ∀ N, (⋂ (k < n), K k) ∩ (⋂ k < N, ⋃₀ (L (n + k))) ≠ ∅) : (L n).Nonempty := by - specialize hc 1 - by_contra! h - simp only [Finset.not_nonempty_iff_eq_empty] at h - apply hc - simp [h] +lemma q_iff_iInter (L : ℕ → Finset (Set α)) (n : ℕ) (K : (k : Fin n) → (L k)) : + q L n K ↔ (∀ (N : ℕ), ((⋂ (j : ℕ) (hj : j < n), K ⟨j, hj⟩) ∩ (⋂ (k < N), + ⋃₀ (L (n + k)).toSet)).Nonempty) := by + simp [q] + refine ⟨fun h N ↦ ?_, fun h N ↦ ?_⟩ <;> + specialize h N <;> + rw [Set.inter_nonempty_iff_exists_left] at h ⊢ <;> + obtain ⟨x, ⟨hx1, hx2⟩⟩ := h <;> + refine ⟨x, ⟨?_, hx2⟩⟩ <;> + simp only [mem_iInter] at hx1 ⊢ + · exact fun i hi ↦ hx1 ⟨i, hi⟩ + · exact fun i ↦ hx1 i.val i.prop + +example (i : ℕ) (hi : i ≠ 0) : ∃ j, j + 1 = i := by + exact exists_add_one_eq.mpr (zero_lt_of_ne_zero hi) + +lemma q_iff_iInter' (L : ℕ → Finset (Set α)) (n : ℕ) (K : (k : Fin n) → (L k)) (y : L n) : + q L (n + 1) (Fin.snoc K y) ↔ (∀ (N : ℕ), ((⋂ (j : ℕ) (hj : j < n), K ⟨j, hj⟩) ∩ y.val ∩ + (⋂ (k < N), ⋃₀ (L (n + k)).toSet)).Nonempty) := by + simp [q] + refine ⟨fun h N ↦ ?_, fun h N ↦ ?_⟩ + · specialize h N + rw [Set.inter_nonempty_iff_exists_left] at h ⊢ + obtain ⟨x, ⟨hx1, hx2⟩⟩ := h + use x + simp at hx1 hx2 ⊢ + refine ⟨⟨?_, ?_⟩, ?_⟩ + · intro i hi + specialize hx1 ⟨i, le_trans hi (le_succ n)⟩ + simp [Fin.snoc, hi] at hx1 + exact hx1 + · specialize hx1 ⟨n, Nat.lt_add_one n⟩ + simp [Fin.snoc] at hx1 + exact hx1 + · intro i hi + by_cases h : i = 0 + · specialize hx1 ⟨n, Nat.lt_add_one n⟩ + simp [Fin.snoc] at hx1 + simp [h] + refine ⟨y, y.prop, hx1⟩ + · obtain ⟨j, hj⟩ := exists_add_one_eq.mpr (zero_lt_of_ne_zero h) + have hj' : j < N := by + have f : 0 < i := by exact zero_lt_of_ne_zero h + rw [← hj] at hi + exact lt_of_succ_lt hi + specialize hx2 j hj' + rw [add_comm] at hj + rw [add_assoc, hj] at hx2 + exact hx2 + · specialize h (N + 1) + rw [Set.inter_nonempty_iff_exists_left] at h ⊢ + obtain ⟨x, ⟨hx1, hx2⟩⟩ := h + use x + simp at hx1 hx2 ⊢ + refine ⟨?_, ?_⟩ + · intro i + simp [Fin.snoc] + refine Fin.lastCases ?_ (fun i ↦ ?_) i + · simp [Fin.snoc_last] + exact hx1.2 + · simp [Fin.snoc_castSucc] + exact hx1.1 i.val i.prop + · intro i hi + specialize hx2 (i + 1) (Nat.add_lt_add_right hi 1) + rw [add_assoc, add_comm 1 i] + exact hx2 -lemma nonempty (k : ℕ) (hc : ∀ N, ⋂ k < N, ⋃₀ (L k : Set (Set α)) ≠ ∅) : (L k).Nonempty := by - specialize hc (k + 1) - by_contra! h - simp only [Finset.not_nonempty_iff_eq_empty] at h - apply hc - apply iInter_eq_empty_iff.mpr fun x ↦ ⟨k, ?_⟩ - -- simp only [Nat.lt_add_one, iInter_true, mem_sUnion, Finset.mem_coe, not_exists, not_and] - simp only [Nat.lt_add_one, iInter_true, Finset.mem_coe, not_exists, not_and] - have hg : ⋃₀ (L k : Set (Set α)) = ∅ := by - rw [h] - simp only [Finset.coe_empty, sUnion_empty] - exact of_eq_false (congrFun hg x) - -/-- `q n K` is the joint property that `(∀ k < n, K k ∈ L k)` and `r n K)` holds. -/ -def q : ℕ → (ℕ → Set α) → Prop := fun n K ↦ (∀ k < n, K k ∈ L k) ∧ (r L n K) - -lemma get_element_zero' (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : - ∃ (K : ℕ → Set α), q L 0 K := by - simp [q, r, h] - -def get_element_zero (h : ∀ N, ⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet ≠ ∅) : - { K : ℕ → Set α // q L 0 K} := by - exists fun _ => ∅ - simp [q, r, h] - -lemma get_element_succ' (n : ℕ) - (K : ℕ → Set α) (hK : q L n K) : ∃ y, q L (n + 1) (Function.update K n y) := by - simp_rw [q, r] at hK ⊢ +lemma step0 {L : ℕ → Finset (Set α)} (hL : ∀ N, (⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet).Nonempty) : + q L 0 (Fin.elim0' (α := fun n ↦ {a : Set α // a ∈ L n})) := by + intro N + simp only [iInter_of_empty, zero_add, univ_inter] + exact hL N + +lemma inter_sUnion_eq_empty (s : Set α) (L : Set (Set α)) : + (∀ a ∈ L, s ∩ a = ∅) ↔ s ∩ ⋃₀ L = ∅ := by + simp_rw [← disjoint_iff_inter_eq_empty] + rw [disjoint_sUnion_right] + +lemma step' {L : ℕ → Finset (Set α)} + (hL : ∀ N, (⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet).Nonempty) + : ∀ n (K : (k : Fin n) → L k), (q L n K) → ∃ a, q L (n + 1) (Fin.snoc K a) := by + intro n K hK + simp_rw [q_iff_iInter] at hK + simp_rw [q_iff_iInter'] at ⊢ by_contra! h choose b hb using h - have hn : ∀ y ∈ L n, ∀ k < n + 1, Function.update K n y k ∈ L k := by - intro y hy k hk - by_cases d : n = k - · rw [d] - simp only [Function.update_self] - exact d ▸ hy - · have d' : k < n := by - by_contra h - apply d - simp only [not_lt] at h - apply Eq.symm - exact Nat.eq_of_le_of_lt_succ h hk - simp only [ne_eq, d'.ne, not_false_eq_true, Function.update_of_ne] - exact hK.1 k d' classical - let b' := fun y ↦ dite (y ∈ L n) (fun hy ↦ (b y (hn y hy))) (fun _ ↦ 0) - have hb' := fun y hy ↦ hb y (hn y hy) - have hb'' (y : Set α) (hy : y ∈ L n) : b y (hn y hy) = b' y := by - simp [b', hy] - obtain ⟨K0Max, ⟨hK0₁, hK0₂⟩⟩ := Finset.exists_max_image (L n) b' (nonempty' L n K hK.2) - apply hK.2 (b' K0Max + 1) - have h₁ (y s : Set α): (⋂ j, ⋂ (_ : j < n + 1), Function.update K n y j) ∩ s = - (⋂ j, ⋂ (_ : j < n), K j) ∩ y ∩ s := by - apply congrFun (congrArg Inter.inter _) s - ext x - refine ⟨fun h ↦ ⟨?_, ?_⟩, fun h ↦ ?_⟩ <;> simp only [mem_iInter, mem_inter_iff] at h ⊢ - · intro i hi - have h' := h i (le_trans hi (le_succ n)) - simp only [ne_eq, hi.ne, not_false_eq_true, Function.update_of_ne] at h' - exact h' - · have h'' := h n (Nat.lt_add_one n) - simp only [Function.update_self] at h'' - exact h'' - · intro i hi - by_cases h₁ : i < n - · simp only [ne_eq, h₁.ne, not_false_eq_true, Function.update_of_ne] - exact h.1 i h₁ - · simp only [not_lt] at h₁ - have h₂ := Nat.eq_of_le_of_lt_succ h₁ hi - rw [h₂] - simp only [Function.update_self] - exact h.2 - simp_rw [h₁] at hb' - - have h₂ : ⋂ k < b' K0Max + 1, ⋃₀ (L (n + k)).toSet ⊆ - ⋃ (y : Set α) (hy : y ∈ L n), y ∩ ⋂ (k < b y (hn y hy)), ⋃₀ (L (n + 1 + k)).toSet := by - obtain ⟨y, hy⟩ := nonempty' L n K hK.2 + let b' := fun x ↦ dite (x ∈ (L n)) (fun c ↦ b ⟨x, c⟩) (fun _ ↦ 0) + have hs : (L n).toSet.Nonempty := by + specialize hK 1 + rw [nonempty_def] at hK ⊢ + simp only [lt_one_iff, iInter_iInter_eq_left, add_zero, mem_inter_iff, mem_iInter, mem_sUnion, + Finset.mem_coe] at hK ⊢ + obtain ⟨x, ⟨hx1, ⟨t, ⟨ht1, ht2⟩⟩⟩⟩ := hK + use t + obtain ⟨K0Max, ⟨hK0₁, hK0₂⟩⟩ := Finset.exists_max_image (L (Fin.last n)) b' hs + simp_rw [nonempty_iff_ne_empty] at hK + apply hK (b' K0Max + 1) + have h₂ (a : L n) : ⋂ k < b' K0Max, ⋃₀ (L (n + k)) ⊆ ⋂ k, ⋂ (_ : k < b a), + ⋃₀ (L (n + k)).toSet := by intro x hx - simp only [mem_iInter, mem_sUnion, Finset.mem_coe, mem_iUnion, mem_inter_iff, - exists_and_left] at hx ⊢ - obtain ⟨i, hi⟩ := hx 0 (zero_lt_succ (b' K0Max)) - rw [add_zero] at hi - use i, hi.2, hi.1 - intro k hk - have hk' : 1 + k < b' K0Max + 1:= by - rw [add_comm] - simp only [Nat.add_lt_add_iff_right] - apply lt_of_lt_of_le hk - rw [hb''] - apply hK0₂ i hi.1 - exact hi.1 - obtain ⟨t, ht⟩ := hx (1 + k) hk' - rw [← add_assoc] at ht - use t, ht.1, ht.2 - simp_rw [inter_assoc] at hb' - apply l2 (s := ⋂ k < b' K0Max + 1, ⋃₀ (L (n + k)).toSet) (t := (⋂ j < n, K j)) (u := L n) - (L := fun (y : Set α) (hy : y ∈ L n) ↦ (y ∩ ⋂ k, ⋂ (hk : k < b y (hn y hy)), - ⋃₀ (L (n + 1 + k)).toSet)) h₂ hb' - -/-- `mem_of_union_aux h n` is the product of some `K : ℕ → Set α)` and `q n K`. -Constructing `(mem_of_union_aux h n).1` works inductively. When constructing -`(mem_of_union_aux h (n + 1)).1`, we update `(mem_of_union_aux h n).1` only at position `n`. -/ -noncomputable def mem_of_union_aux (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : - (n : ℕ) → {K : ℕ → Set α | q L n K} - | 0 => get_element_zero L h - | n + 1 => by - have g := (get_element_succ' L) n (mem_of_union_aux h n).1 (mem_of_union_aux h n).2 - exact ⟨Function.update (mem_of_union_aux h n).1 n g.choose, g.choose_spec⟩ - -namespace mem_of_union - -lemma constantEventually (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n k : ℕ) (hkn : k < n) : - (mem_of_union_aux L h n).1 k = (mem_of_union_aux L h (n + 1)).1 k := by - simp [mem_of_union_aux, hkn.ne] - -lemma constantEventually' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n k : ℕ) (hkn : k < n) : - (mem_of_union_aux L h n).1 k = (mem_of_union_aux L h (k + 1)).1 k := by - induction n with - | zero => - cases hkn - | succ n hn => - by_cases h' : k < n - · rw [← hn h'] - exact (constantEventually L h n k h').symm - · have hkn' : k = n := by - exact Nat.eq_of_lt_succ_of_not_lt hkn h' - rw [hkn'] - -lemma constantEventually'' (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (m n k : ℕ) - (hkn : k < n) (hkm : k < m) : (mem_of_union_aux L h n).1 k - = (mem_of_union_aux L h m).1 k := by - rw [constantEventually' L h n k hkn, constantEventually' L h m k hkm] - -end mem_of_union + simp at hx ⊢ + have f : b' a = b a := by + simp [b'] + exact fun i hi ↦ hx i (lt_of_lt_of_le hi (f ▸ hK0₂ a.val a.prop)) + have h₃ : ∀ (a : { x // x ∈ L ↑(Fin.last n) }), (⋂ j, ⋂ (hj : j < n), ↑(K ⟨j, hj⟩)) ∩ ↑a ∩ + ⋂ k, ⋂ (_ : k < b' K0Max), ⋃₀ (L (n + k)).toSet = ∅ := by + intro a + rw [← subset_empty_iff, ← hb a] + apply inter_subset_inter (fun ⦃a⦄ a ↦ a) (h₂ a) + simp_rw [inter_comm, inter_assoc] at h₃ + simp_rw [← disjoint_iff_inter_eq_empty] at h₃ ⊢ + simp at h₃ + have h₃' := disjoint_sUnion_left.mpr h₃ + rw [disjoint_iff_inter_eq_empty, inter_comm, inter_assoc, ← disjoint_iff_inter_eq_empty] at h₃' + apply disjoint_of_subset (fun ⦃a⦄ a ↦ a) _ h₃' + simp only [subset_inter_iff, subset_iInter_iff] + refine ⟨fun i hi x hx ↦ ?_, fun x hx ↦ ?_⟩ + · simp at hx ⊢ + obtain ⟨t, ht⟩ := hx i (lt_trans hi (Nat.lt_add_one _)) + use t + · simp at hx ⊢ + obtain ⟨t, ht⟩ := hx 0 (zero_lt_succ _) + simp at ht + use t + exact ht /-- For `L : ℕ → Finset (Set α)` such that `∀ K ∈ L n, p K` and `h : ∀ N, ⋂ k < N, ⋃₀ L k ≠ ∅`, `mem_of_union h n` is some `K : ℕ → Set α` such that `K n ∈ L n` for all `n` (this is `prop₀`) and `∀ N, ⋂ (j < n, K j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ≠ ∅` (this is `prop₁`.) -/ -noncomputable def mem_of_union (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) := - fun n ↦ (mem_of_union_aux L h (n + 1)).1 n +noncomputable def mem_of_union (L : ℕ → Finset (Set α)) + (hL : ∀ N, (⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet).Nonempty) : (k : ℕ) → L k := + Nat.prefixInduction' (q L) (step0 hL) (step' hL) namespace mem_of_union -lemma prop₀ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : mem_of_union L h n ∈ L n := by - exact (mem_of_union_aux L h (n + 1)).2.1 n (Nat.lt_add_one n) - -lemma isSubset (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n N : ℕ) : - (⋂ j < n, mem_of_union L h j) ∩ ⋂ (k < N), (⋃₀ L (n + k)) ⊆ - ⋂ (k < n + N), (⋃₀ (L k).toSet) := by - have h' : ⋂ (k < n + N), (⋃₀ (L k).toSet) = - (⋂ (k < n), (⋃₀ (L k).toSet)) ∩ ⋂ (k < N), (⋃₀ (L (n + k)).toSet) := by - ext x - simp only [mem_iInter, mem_sUnion, Finset.mem_coe, mem_inter_iff] - refine ⟨fun h ↦ ⟨fun i hi ↦ ?_, fun i hi ↦ ?_⟩, fun h i hi ↦ ?_⟩ - · refine h i (lt_of_lt_of_le hi (Nat.le_add_right n N)) - · refine h (n + i) (Nat.add_lt_add_left hi n) - · by_cases hin : i < n - · exact h.1 i hin - · have h₁ : i - n < N := Nat.sub_lt_left_of_lt_add (Nat.le_of_not_lt hin) hi - have h₂ : n + (i - n) = i := by - exact add_sub_of_le <| Nat.le_of_not_lt hin - exact h₂ ▸ h.2 (i - n) h₁ - rw [h'] - apply inter_subset_inter _ fun ⦃a⦄ a ↦ a - have h'' (j : ℕ) (hj : j < n) : mem_of_union L h j ⊆ ⋃₀ (L j).toSet := by - exact subset_sUnion_of_mem <| prop₀ L h j - exact iInter₂_mono h'' - -lemma isSubsetN0 (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) : - (⋂ j, mem_of_union L h j) ⊆ - ⋂ k, (⋃₀ (L k).toSet) := by - exact iInter_mono <| fun n ↦ - subset_sUnion_of_subset (↑(L n)) (mem_of_union L h n) (fun ⦃a⦄ a ↦ a) (prop₀ L h n) +theorem spec (L : ℕ → Finset (Set α)) + (hL : ∀ N, (⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet).Nonempty) (n : ℕ) : + (∀ N, ((⋂ (j : Fin n), (mem_of_union L hL) j) ∩ (⋂ (k < N), ⋃₀ (L (n + k)).toSet)).Nonempty) := + Nat.prefixInduction'_spec (β := fun n ↦ {a // a ∈ L n}) (q L) (step0 hL) (step' hL) n -lemma has_p (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) - (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : p (mem_of_union L h n) := by - exact hL n (mem_of_union L h n) (prop₀ L h n) +lemma l1 (L : ℕ → Finset (Set α)) + (hL : ∀ N, (⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet).Nonempty) (k : ℕ) : + (mem_of_union L hL k).val ∈ (L k).toSet := by + exact (mem_of_union L hL k).prop -lemma prop₁ (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : - ∀ N, (⋂ (j < n), (mem_of_union L h j)) ∩ (⋂ (k < N), (⋃₀ (L (n + k)).toSet)) ≠ ∅ := by - have h' : r L n (mem_of_union_aux L h n).val := (mem_of_union_aux L h n).2.2 - simp only [r] at h' - simp only [mem_of_union] - intro N - specialize h' N - conv at h' => - lhs - enter [1,1] - intro j - enter[1] - intro hj - rw [constantEventually' L h n j hj] - exact h' - -lemma prop₁N0 (h : ∀ N, ⋂ k < N, ⋃₀ (L k).toSet ≠ ∅) (n : ℕ) : - (⋂ (j < n), (mem_of_union L h j)) ≠ ∅ := by - have h' : (⋂ (k < 0), (⋃₀ (L (n + k)).toSet)) = univ := by - simp - have d (s : Set α) : s = s ∩ univ := by exact left_eq_inter.mpr fun ⦃a⦄ a ↦ trivial - rw [d (⋂ j, ⋂ (_ : j < n), mem_of_union L h j)] - rw [← h'] - exact prop₁ L h n 0 + +lemma l2 (L : ℕ → Finset (Set α)) + (hL : ∀ N, (⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet).Nonempty) (n : ℕ) : + (⋂ (j : Fin n), (mem_of_union L hL j).val).Nonempty := by + have h := spec L hL n 0 + simp only [not_lt_zero, iInter_of_empty, iInter_univ, inter_univ] at h + exact h + +lemma isSubsetN0 (L : ℕ → Finset (Set α)) (hL : ∀ N, (⋂ k < N, ⋃₀ (L k).toSet).Nonempty) : + (⋂ j, (mem_of_union L hL j)) ⊆ + ⋂ k, (⋃₀ (L k).toSet) := by + exact iInter_mono <| fun n ↦ + subset_sUnion_of_subset (↑(L n)) (mem_of_union L hL n).val (fun ⦃a⦄ a ↦ a) (l1 L hL n) end mem_of_union @@ -682,25 +568,19 @@ lemma mem_iff (s : Set α) : union p s ↔ ∃ L : Finset (Set α), s = ⋃₀ L refine ⟨hL.2, hL.1.symm⟩ theorem isCompactSystem (p : Set α → Prop)(hp : IsCompactSystem p) : IsCompactSystem (union p) := by - have hp' := (IsCompactSystem.iff_of_not_empty p).mp hp - rw [IsCompactSystem.iff_of_not_empty] + have hp' := (iff_nonempty_iInter_of_lt p).mp hp + rw [iff_nonempty_iInter_of_lt] intro C hi simp_rw [mem_iff] at hi choose L' hL' using hi - have hL'1 := fun n ↦ (hL' n).1 - have hL'2 := fun n ↦ (hL' n).2 - simp_rw [hL'1] + simp_rw [hL'] intro hL - let K := mem_of_union L' hL - have h₁ : ⋂ i, K i ⊆ ⋂ i, ⋃₀ (L' i).toSet := by - apply mem_of_union.isSubsetN0 L' - have h₂ : ⋂ i, K i ≠ ∅ := by - apply hp' _ - · apply mem_of_union.has_p - exact hL'2 - · apply mem_of_union.prop₁N0 - rw [← nonempty_iff_ne_empty] at h₂ ⊢ - exact Nonempty.mono h₁ h₂ + have h₁ := mem_of_union.l2 L' hL + have h₂ : (∀ (i : ℕ), p ↑(mem_of_union L' hL i)) := + fun i ↦ (hL' i).2 (mem_of_union L' hL i).val (mem_of_union L' hL i).prop + have h₃ := (iff_nonempty_iInter_of_lt' p).mp hp (fun k ↦ (mem_of_union L' hL k).val) h₂ h₁ + have h₄ : ⋂ i, (mem_of_union L' hL) i ⊆ ⋂ i, ⋃₀ (L' i).toSet := mem_of_union.isSubsetN0 L' hL + exact Nonempty.mono h₄ h₃ end union From 0ca28816b2c381ecc933faa1eec837f5dbe17625 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:04:59 +0200 Subject: [PATCH 115/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index 547729242ba1d4..417e9dcd4a8d71 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -5703,6 +5703,7 @@ import Mathlib.RingTheory.Spectrum.Prime.Jacobson import Mathlib.RingTheory.Spectrum.Prime.LTSeries import Mathlib.RingTheory.Spectrum.Prime.Module import Mathlib.RingTheory.Spectrum.Prime.Noetherian +import Mathlib.RingTheory.Spectrum.Prime.LTSeries import Mathlib.RingTheory.Spectrum.Prime.Polynomial import Mathlib.RingTheory.Spectrum.Prime.RingHom import Mathlib.RingTheory.Spectrum.Prime.TensorProduct From 60a88cc8badfeb69502630b028c5d7b83442d832 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:05:07 +0200 Subject: [PATCH 116/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index 417e9dcd4a8d71..86043c70411572 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -5890,6 +5890,7 @@ import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Tactic.CategoryTheory.IsoReassoc import Mathlib.Tactic.CategoryTheory.Monoidal.Basic import Mathlib.Tactic.CategoryTheory.Monoidal.Datatypes +import Mathlib.Tactic.CategoryTheory.IsoReassoc import Mathlib.Tactic.CategoryTheory.Monoidal.Normalize import Mathlib.Tactic.CategoryTheory.Monoidal.PureCoherence import Mathlib.Tactic.CategoryTheory.MonoidalComp From f156de2f0138925966d945f61844ec03f7795e0f Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:05:19 +0200 Subject: [PATCH 117/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index 86043c70411572..f2f43c3409371e 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6204,6 +6204,7 @@ import Mathlib.Topology.Algebra.IsUniformGroup.Defs import Mathlib.Topology.Algebra.IsUniformGroup.Order import Mathlib.Topology.Algebra.LinearTopology import Mathlib.Topology.Algebra.Localization +import Mathlib.Topology.Algebra.IsUniformGroup.Order import Mathlib.Topology.Algebra.MetricSpace.Lipschitz import Mathlib.Topology.Algebra.Module.Alternating.Basic import Mathlib.Topology.Algebra.Module.Alternating.Topology From f908659dbd0c9401d15b9ac464f843e1e9a8e592 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:05:29 +0200 Subject: [PATCH 118/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Mathlib.lean b/Mathlib.lean index f2f43c3409371e..1a4aea5ba2480f 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6375,6 +6375,8 @@ import Mathlib.Topology.Compactification.OnePoint.Sphere import Mathlib.Topology.Compactification.OnePointEquiv import Mathlib.Topology.Compactification.StoneCech import Mathlib.Topology.Compactness.Bases +import Mathlib.Topology.Compactification.OnePoint.Basic +import Mathlib.Topology.Compactification.OnePoint.ProjectiveLine import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.CompactlyCoherentSpace From 67b98cfcf04c989edf86e526c415b2a7d967ddb6 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:05:40 +0200 Subject: [PATCH 119/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Mathlib.lean b/Mathlib.lean index 1a4aea5ba2480f..f1ce6ac78e92c9 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -6384,6 +6384,7 @@ import Mathlib.Topology.Compactness.CompactlyGeneratedSpace import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.CompactlyGeneratedSpace import Mathlib.Topology.Compactness.DeltaGeneratedSpace +import Mathlib.Topology.Compactness.CompactlyCoherentSpace import Mathlib.Topology.Compactness.Exterior import Mathlib.Topology.Compactness.HilbertCubeEmbedding import Mathlib.Topology.Compactness.Lindelof From f1d3dd3bed2aab6201218553106b14c59fd54086 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:08:31 +0200 Subject: [PATCH 120/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index f1ce6ac78e92c9..b596a4eb4030f8 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -1816,7 +1816,8 @@ import Mathlib.Analysis.NormedSpace.Multilinear.Curry import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn import Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic -import Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear +import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn +import Mathlib.Analysis.NormedSpace.Multilinear.Basic import Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness import Mathlib.Analysis.NormedSpace.OperatorNorm.Mul import Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm From fee2ef1c070463ca0fbd3b4bc50a01e53fcc7270 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:09:05 +0200 Subject: [PATCH 121/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index b596a4eb4030f8..ff70607ce1b2d6 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -2603,7 +2603,8 @@ import Mathlib.CategoryTheory.Shift.InducedShiftSequence import Mathlib.CategoryTheory.Shift.Linear import Mathlib.CategoryTheory.Shift.Localization import Mathlib.CategoryTheory.Shift.Opposite -import Mathlib.CategoryTheory.Shift.Pullback +import Mathlib.CategoryTheory.Shift.Linear +import Mathlib.CategoryTheory.Shift.Induced import Mathlib.CategoryTheory.Shift.Quotient import Mathlib.CategoryTheory.Shift.ShiftSequence import Mathlib.CategoryTheory.Shift.ShiftedHom From c49c47a28961c497d75c0311dad6ac57978c19a5 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:09:16 +0200 Subject: [PATCH 122/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index ff70607ce1b2d6..7f438fb7bf0fe7 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -3286,7 +3286,8 @@ import Mathlib.Data.Matrix.RowCol import Mathlib.Data.Matrix.Vec import Mathlib.Data.Matroid.Basic import Mathlib.Data.Matroid.Circuit -import Mathlib.Data.Matroid.Closure +import Mathlib.Data.Matrix.Vec +import Mathlib.Data.Matrix.Reflection import Mathlib.Data.Matroid.Constructions import Mathlib.Data.Matroid.Dual import Mathlib.Data.Matroid.IndepAxioms From 82b00edf0a6935808e41d70b3d4d235769d8e634 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:09:24 +0200 Subject: [PATCH 123/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index 7f438fb7bf0fe7..55a41713ea1744 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -4029,7 +4029,8 @@ import Mathlib.LinearAlgebra.Alternating.DomCoprod import Mathlib.LinearAlgebra.Alternating.Uncurry.Fin import Mathlib.LinearAlgebra.AnnihilatingPolynomial import Mathlib.LinearAlgebra.Basis.Basic -import Mathlib.LinearAlgebra.Basis.Bilinear +import Mathlib.LinearAlgebra.Alternating.Uncurry.Fin +import Mathlib.LinearAlgebra.Alternating.Curry import Mathlib.LinearAlgebra.Basis.Cardinality import Mathlib.LinearAlgebra.Basis.Defs import Mathlib.LinearAlgebra.Basis.Exact From fe704d72835b3dd3f2c275e5eafd28c721fc23a5 Mon Sep 17 00:00:00 2001 From: Peter Pfaffelhuber <41927422+pfaffelh@users.noreply.github.com> Date: Thu, 5 Jun 2025 00:09:31 +0200 Subject: [PATCH 124/129] Update Mathlib.lean Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Mathlib.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mathlib.lean b/Mathlib.lean index 55a41713ea1744..65975e856faad6 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -4256,7 +4256,8 @@ import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Relations import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Semisimple import Mathlib.LinearAlgebra.RootSystem.Hom import Mathlib.LinearAlgebra.RootSystem.Irreducible -import Mathlib.LinearAlgebra.RootSystem.IsValuedIn +import Mathlib.LinearAlgebra.RootSystem.GeckConstruction +import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas import Mathlib.LinearAlgebra.RootSystem.OfBilinear import Mathlib.LinearAlgebra.RootSystem.Reduced import Mathlib.LinearAlgebra.RootSystem.RootPairingCat From 0f130e4b40b90d80bdf3c6a874f8f027228b7b68 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Mon, 9 Jun 2025 23:09:02 +0200 Subject: [PATCH 125/129] fix namespaces --- Mathlib/Topology/Compactness/CompactSystem.lean | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 43a622f37cfc96..e4b70fd759374d 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -370,20 +370,12 @@ namespace IsCompactSystem section Union --- (hp : IsCompactSystem p) --- (L : ℕ → Finset (Set α)) --- (hL : ∀ (n : ℕ) (d : Set α) (_ : d ∈ (L n : Set (Set α))), p d) - /-- `q n K` is the joint property that `∀ (k : Fin n), K k ∈ L k` and `∀ N, (⋂ (j : Fin n), K j) ∩ (⋂ (k < N), ⋃₀ (L (n + k)).toSet) ≠ ∅`.` holds. -/ def q (L : ℕ → Finset (Set α)) : ∀ n, (K : (k : Fin n) → (L k)) → Prop := fun n K ↦ (∀ N, ((⋂ j, K j) ∩ (⋂ (k < N), ⋃₀ (L (n + k)).toSet)).Nonempty) -example (n : ℕ) (K : (k : Fin n) → Set α) : - ⋂ i, K i = ⋂ (i : ℕ) (hi : i < n), K ⟨i, hi⟩ := by - sorry - lemma q_iff_iInter (L : ℕ → Finset (Set α)) (n : ℕ) (K : (k : Fin n) → (L k)) : q L n K ↔ (∀ (N : ℕ), ((⋂ (j : ℕ) (hj : j < n), K ⟨j, hj⟩) ∩ (⋂ (k < N), ⋃₀ (L (n + k)).toSet)).Nonempty) := by @@ -463,7 +455,6 @@ lemma inter_sUnion_eq_empty (s : Set α) (L : Set (Set α)) : rw [disjoint_sUnion_right] lemma step' {L : ℕ → Finset (Set α)} - (hL : ∀ N, (⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet).Nonempty) : ∀ n (K : (k : Fin n) → L k), (q L n K) → ∃ a, q L (n + 1) (Fin.snoc K a) := by intro n K hK simp_rw [q_iff_iInter] at hK @@ -517,14 +508,14 @@ for all `n` (this is `prop₀`) and `∀ N, ⋂ (j < n, K j) ∩ ⋂ (k < N), ( (this is `prop₁`.) -/ noncomputable def mem_of_union (L : ℕ → Finset (Set α)) (hL : ∀ N, (⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet).Nonempty) : (k : ℕ) → L k := - Nat.prefixInduction' (q L) (step0 hL) (step' hL) + Nat.prefixInduction' (q L) (step0 hL) (step') namespace mem_of_union theorem spec (L : ℕ → Finset (Set α)) (hL : ∀ N, (⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet).Nonempty) (n : ℕ) : (∀ N, ((⋂ (j : Fin n), (mem_of_union L hL) j) ∩ (⋂ (k < N), ⋃₀ (L (n + k)).toSet)).Nonempty) := - Nat.prefixInduction'_spec (β := fun n ↦ {a // a ∈ L n}) (q L) (step0 hL) (step' hL) n + Nat.prefixInduction'_spec (β := fun n ↦ {a // a ∈ L n}) (q L) (step0 hL) (step') n lemma l1 (L : ℕ → Finset (Set α)) (hL : ∀ N, (⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet).Nonempty) (k : ℕ) : @@ -586,8 +577,6 @@ end union end Union -end IsCompactSystem - section pi variable {ι : Type*} {α : ι → Type*} From a748aec9573565dcad7e613af3cbd5cf923db8df Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Mon, 9 Jun 2025 23:32:55 +0200 Subject: [PATCH 126/129] no errors --- Mathlib/Topology/Compactness/CompactSystem.lean | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index e4b70fd759374d..d95abad0186d28 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -296,6 +296,7 @@ end IsCompactSystem section PrefixInduction +/-- A version of `Fin.elim` using even more dependent types. -/ def Fin.elim0'.{u} {α : ℕ → Sort u} : (i : Fin 0) → (α i) | ⟨_, h⟩ => absurd h (Nat.not_lt_zero _) @@ -317,6 +318,7 @@ and finding the next element. In comparisong to other induction principles, the proofs of `q n k` are needed in order to find the next element. -/ +/- An auxiliary definition for `Nat.prefixInduction`. -/ def Nat.prefixInduction.aux : ∀ (n : Nat), { k : (i : Fin n) → (β i) // q n k } | 0 => ⟨Fin.elim0', step0⟩ | n+1 => @@ -340,6 +342,10 @@ theorem Nat.prefixInduction.auxConsistent : rw [ih, aux] simp +/-- An induction principle showing that `q : (n : ℕ) → (k : (i : Fin n) → (β i)) → Prop` holds +for all `n`. `step0` is satisfied by construction since `Fin 0` is empty. +In the induction `step`, we use that `q n k` holds for showing that `q (n + 1) (Fin.snoc k a)` +holds for some `a : β n`. -/ def Nat.prefixInduction (n : Nat) : β n := (Nat.prefixInduction.aux q step0 step (n+1)).1 (Fin.last n) @@ -354,10 +360,16 @@ theorem Nat.prefixInduction_spec (n : Nat) : q n (Nat.prefixInduction q step0 st /- Often, `step` can only be proved by showing an `∃` statement. For this case, we use `step'`. -/ variable (step' : ∀ n (k : (i : Fin n) → (β i)) (_ : q n k), ∃ a, q (n + 1) (Fin.snoc k a)) +/-- For `Nat.prefixIndution`, this transforms an exists-statement in the induction step to choosing +an element. -/ noncomputable def step_of : (n : ℕ) → (k : (i : Fin n) → (β i)) → (hn : q n k) → { a : β n // q (n + 1) (Fin.snoc k a) } := fun n k hn ↦ ⟨(step' n k hn).choose, (step' n k hn).choose_spec⟩ +/-- An induction principle showing that `q : (n : ℕ) → (k : (i : Fin n) → (β i)) → Prop` holds +for all `n`. `step0` is satisfied by construction since `Fin 0` is empty. +In the induction `step`, we use that `q n k` holds for showing that `q (n + 1) (Fin.snoc k a)` +holds for some `a : β n`. This version is noncomputable since it relies on an `∃`-statement -/ noncomputable def Nat.prefixInduction' (n : Nat) : β n := (Nat.prefixInduction.aux q step0 (fun n k hn ↦ step_of q step' n k hn) (n+1)).1 (Fin.last n) @@ -418,7 +430,6 @@ lemma q_iff_iInter' (L : ℕ → Finset (Set α)) (n : ℕ) (K : (k : Fin n) → refine ⟨y, y.prop, hx1⟩ · obtain ⟨j, hj⟩ := exists_add_one_eq.mpr (zero_lt_of_ne_zero h) have hj' : j < N := by - have f : 0 < i := by exact zero_lt_of_ne_zero h rw [← hj] at hi exact lt_of_succ_lt hi specialize hx2 j hj' @@ -559,7 +570,6 @@ lemma mem_iff (s : Set α) : union p s ↔ ∃ L : Finset (Set α), s = ⋃₀ L refine ⟨hL.2, hL.1.symm⟩ theorem isCompactSystem (p : Set α → Prop)(hp : IsCompactSystem p) : IsCompactSystem (union p) := by - have hp' := (iff_nonempty_iInter_of_lt p).mp hp rw [iff_nonempty_iInter_of_lt] intro C hi simp_rw [mem_iff] at hi @@ -720,3 +730,4 @@ theorem isCompactSystem.compactClosedSquareCylinders : compactClosedSquareCylinders_supset end ClosedCompactSquareCylinders +#lint From 4ba8b59effcf30dc8d5f4ddcd5c4a471c8400dfe Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Mon, 9 Jun 2025 23:56:56 +0200 Subject: [PATCH 127/129] no errors2 --- .../Topology/Compactness/CompactSystem.lean | 120 ++++-------------- 1 file changed, 24 insertions(+), 96 deletions(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index d95abad0186d28..b0bea8ddf727f2 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -1,7 +1,7 @@ /- Copyright (c) 2025 Peter Pfaffelhuber. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. -Authors: Rémy Degenne, Peter Pfaffelhuber +Authors: Rémy Degenne, Peter Pfaffelhuber, Joachim Breitner -/ import Mathlib.Data.Set.Dissipate import Mathlib.Logic.IsEmpty @@ -12,7 +12,9 @@ import Mathlib.Topology.Separation.Hausdorff /-! # Compact systems. -This file defines compact systems of sets. +This file defines compact systems of sets. These are set systems `p : Set α → Prop` with the +following property: If `C : ℕ → Set α` is such that `∀ n, p (C n)` and `⋂ n, C n = ∅`, then +there is some `N : ℕ` with `⋂ n < N, C n = ∅`. ## Main definitions @@ -521,9 +523,7 @@ noncomputable def mem_of_union (L : ℕ → Finset (Set α)) (hL : ∀ N, (⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet).Nonempty) : (k : ℕ) → L k := Nat.prefixInduction' (q L) (step0 hL) (step') -namespace mem_of_union - -theorem spec (L : ℕ → Finset (Set α)) +theorem mem_of_union.spec (L : ℕ → Finset (Set α)) (hL : ∀ N, (⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet).Nonempty) (n : ℕ) : (∀ N, ((⋂ (j : Fin n), (mem_of_union L hL) j) ∩ (⋂ (k < N), ⋃₀ (L (n + k)).toSet)).Nonempty) := Nat.prefixInduction'_spec (β := fun n ↦ {a // a ∈ L n}) (q L) (step0 hL) (step') n @@ -533,29 +533,24 @@ lemma l1 (L : ℕ → Finset (Set α)) (mem_of_union L hL k).val ∈ (L k).toSet := by exact (mem_of_union L hL k).prop - -lemma l2 (L : ℕ → Finset (Set α)) +lemma sInter_memOfUnion_nonempty (L : ℕ → Finset (Set α)) (hL : ∀ N, (⋂ k, ⋂ (_ : k < N), ⋃₀ (L k).toSet).Nonempty) (n : ℕ) : (⋂ (j : Fin n), (mem_of_union L hL j).val).Nonempty := by - have h := spec L hL n 0 + have h := mem_of_union.spec L hL n 0 simp only [not_lt_zero, iInter_of_empty, iInter_univ, inter_univ] at h exact h -lemma isSubsetN0 (L : ℕ → Finset (Set α)) (hL : ∀ N, (⋂ k < N, ⋃₀ (L k).toSet).Nonempty) : - (⋂ j, (mem_of_union L hL j)) ⊆ - ⋂ k, (⋃₀ (L k).toSet) := by +lemma sInter_memOfUnion_isSubset (L : ℕ → Finset (Set α)) + (hL : ∀ N, (⋂ k < N, ⋃₀ (L k).toSet).Nonempty) : + (⋂ j, (mem_of_union L hL j)) ⊆ ⋂ k, (⋃₀ (L k).toSet) := by exact iInter_mono <| fun n ↦ subset_sUnion_of_subset (↑(L n)) (mem_of_union L hL n).val (fun ⦃a⦄ a ↦ a) (l1 L hL n) -end mem_of_union - /-- Finite unions of sets in a compact system. -/ def union (p : Set α → Prop) : Set α → Prop := (sUnion '' ({ L : Set (Set α) | L.Finite ∧ ∀ K ∈ L, p K})) -namespace union - -lemma mem_iff (s : Set α) : union p s ↔ ∃ L : Finset (Set α), s = ⋃₀ L ∧ ∀ K ∈ L, p K := by +lemma union.mem_iff (s : Set α) : union p s ↔ ∃ L : Finset (Set α), s = ⋃₀ L ∧ ∀ K ∈ L, p K := by refine ⟨fun ⟨L, hL⟩ ↦ ?_, fun h ↦ ?_⟩ · simp only [mem_setOf_eq] at hL let L' := (hL.1.1).toFinset @@ -569,22 +564,21 @@ lemma mem_iff (s : Set α) : union p s ↔ ∃ L : Finset (Set α), s = ⋃₀ L simp only [mem_setOf_eq, Finset.finite_toSet, Finset.mem_coe, true_and] refine ⟨hL.2, hL.1.symm⟩ -theorem isCompactSystem (p : Set α → Prop)(hp : IsCompactSystem p) : IsCompactSystem (union p) := by +theorem union.isCompactSystem (p : Set α → Prop)(hp : IsCompactSystem p) : + IsCompactSystem (union p) := by rw [iff_nonempty_iInter_of_lt] intro C hi simp_rw [mem_iff] at hi choose L' hL' using hi simp_rw [hL'] intro hL - have h₁ := mem_of_union.l2 L' hL + have h₁ := sInter_memOfUnion_nonempty L' hL have h₂ : (∀ (i : ℕ), p ↑(mem_of_union L' hL i)) := fun i ↦ (hL' i).2 (mem_of_union L' hL i).val (mem_of_union L' hL i).prop have h₃ := (iff_nonempty_iInter_of_lt' p).mp hp (fun k ↦ (mem_of_union L' hL k).val) h₂ h₁ - have h₄ : ⋂ i, (mem_of_union L' hL) i ⊆ ⋂ i, ⋃₀ (L' i).toSet := mem_of_union.isSubsetN0 L' hL + have h₄ : ⋂ i, (mem_of_union L' hL) i ⊆ ⋂ i, ⋃₀ (L' i).toSet := sInter_memOfUnion_isSubset L' hL exact Nonempty.mono h₄ h₃ -end union - end Union section pi @@ -650,84 +644,18 @@ variable [∀ i, TopologicalSpace (α i)] variable (α) /-- The set of sets of the form `s.pi t`, where `s : Finset ι` and `t i` is both, closed and compact, for all `i ∈ s`. -/ -def compactClosedSquareCylinders : Set (Set (Π i, α i)) := - ⋃ (s) (t) (_ : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)), {squareCylinder s t} - -def squareCylinders_of_prop (p : (i : ι) → Set (α i) → Prop) : Set (Set (Π i, α i)) := - ⋃ (s) (t) (_ : ∀ i ∈ s, p i (t i)), {squareCylinder s t} - -variable {α} -@[simp] -theorem mem_compactClosedSquareCylinders_iff (S : Set (Π i, α i)) : - S ∈ compactClosedSquareCylinders α - ↔ ∃ (s t : _) (_ : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)), - S = squareCylinder s t := by - simp_rw [compactClosedSquareCylinders, mem_iUnion, mem_singleton_iff] - - -variable {S : Set (Π i, α i)} - -/-- Given a closed compact cylinder, choose a finset of variables such that it only depends on -these variables. -/ -noncomputable def compactClosedSquareCylinders.finset (hS : S ∈ compactClosedSquareCylinders α) : - Finset ι := - ((mem_compactClosedSquareCylinders_iff S).mp hS).choose - -/-- Given a closed compact square cylinder `S`, choose a dependent function `(i : ι) → Set (α i)` -of which it is a lift. -/ -def closedCompactSquareCylinders.func (hS : S ∈ compactClosedSquareCylinders α) : - (i : ι) → Set (α i) := - ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose - -theorem compactClosedSquareCylinders.isCompact_isClosed (hS : S ∈ compactClosedSquareCylinders α) : - ∀ i ∈ compactClosedSquareCylinders.finset hS, - IsCompact (closedCompactSquareCylinders.func hS i) ∧ - IsClosed (closedCompactSquareCylinders.func hS i) := - ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose_spec.choose - -theorem closedCompactSquareCylinders.eq_squareCylinder (hS : S ∈ compactClosedSquareCylinders α) : - S = squareCylinder (compactClosedSquareCylinders.finset hS) - (closedCompactSquareCylinders.func hS) := - ((mem_compactClosedSquareCylinders_iff S).mp hS).choose_spec.choose_spec.choose_spec - -theorem squareCylinder_mem_closedCompactSquareCylinders (s : Finset ι) (t : (i : ι) → Set (α i)) - (h : ∀ i ∈ s, IsCompact (t i) ∧ IsClosed (t i)) : - squareCylinder s t ∈ compactClosedSquareCylinders α := by - rw [mem_compactClosedSquareCylinders_iff] - exact ⟨s, t, h, rfl⟩ - -theorem CompactClosedOrUniv_pi : - IsCompactSystem (univ.pi '' univ.pi - (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by - apply IsCompactSystem.pi - (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ))) - <| fun i ↦ IsCompactSystem.of_isCompact_isClosed_or_univ - -/-- In `closedCompactSquareCylinders α`, the set of dependent variables is a finset, - but not necessarily in `univ.pi '' univ.pi _`, where `_` are closed compact set, or `univ`. -/ -theorem compactClosedSquareCylinders_supset (S : _) : - S ∈ compactClosedSquareCylinders α → S ∈ (univ.pi '' univ.pi - (fun (i : ι) ↦ (fun (s : Set (α i)) ↦ (IsCompact s ∧ IsClosed s) ∨ (s = univ)))) := by - classical - intro hS - simp_rw [mem_compactClosedSquareCylinders_iff, squareCylinder] at hS - simp only [mem_image, mem_pi, mem_univ, forall_const] - obtain ⟨s, t, h_cl, h_co, h_pi⟩ := hS - let t' := fun (i : ι) ↦ if (i ∈ s) then (t i) else univ - refine ⟨t', fun i ↦ ?_, ?_⟩ - · by_cases hi : i ∈ s - · simp only [hi, ↓reduceIte, t'] - exact Or.inl (h_cl i hi) - · simp only [hi, ↓reduceIte, t'] - apply Or.inr rfl - · change (pi univ fun i => if i ∈ (s : Set ι) then t i else univ) = (s : Set ι).pi t - rw [univ_pi_ite s t] - -/-- Closed and compact square cylinders form a compact system. -/ +def MeasureTheory.compactClosedSquareCylinders : Set (Set (Π i, α i)) := + MeasureTheory.squareCylinders (fun i ↦ { t : Set (α i) | IsCompact t ∧ IsClosed t }) + +/-- Products of compact and closed sets form a compact system. -/ +theorem IsCompactSystem.compactClosedPi : + IsCompactSystem (univ.pi '' univ.pi (fun i ↦ { t : Set (α i) | IsCompact t ∧ IsClosed t })) := + IsCompactSystem.pi _ (fun _ ↦ IsCompactSystem.of_isCompact_isClosed) + +/-- Compact and closed square cylinders are a compact system. -/ theorem isCompactSystem.compactClosedSquareCylinders : IsCompactSystem (compactClosedSquareCylinders α) := IsCompactSystem.mono CompactClosedOrUniv_pi compactClosedSquareCylinders_supset end ClosedCompactSquareCylinders -#lint From 662f427ab57b6a8b4a0aff4a0bc5bc47bf4f1498 Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Mon, 9 Jun 2025 23:58:43 +0200 Subject: [PATCH 128/129] no errors3 --- Mathlib/Topology/Compactness/CompactSystem.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index b0bea8ddf727f2..86dba0d841c6f7 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -312,7 +312,7 @@ variable (step : /-- In this section, we prove a general induction principle, which we need for the construction `Nat.prefixInduction q step0 step : (k : ℕ) → (β k)` based on some `q : (n : ℕ) → (k : (i : Fin n) → (β i)) → Prop`. For -the inducation start, `step0 : q 0 _` requires that `Fin 0` cannot be satisfied, and +the inducation start, `step0 : q 0 _` always holds since `Fin 0` cannot be satisfied, and `step : (n : ℕ) → (k : (i : Fin n) → β i) → q n k → { a : β n // q (n + 1) (Fin.snoc k a) })` `(n : ℕ) : β n` constructs the next element satisfying `q (n + 1) _` from a proof of `q n k` and finding the next element. From f58cc10ea6f1fef35bb06bc6143714c6604166ac Mon Sep 17 00:00:00 2001 From: pfaffelh Date: Thu, 21 Aug 2025 14:47:05 +0200 Subject: [PATCH 129/129] compiles --- Mathlib.lean | 23 ++------ Mathlib/Data/Set/Prod.lean | 6 +- .../Constructions/Cylinders.lean | 37 ++++++++----- .../Topology/Compactness/CompactSystem.lean | 55 +++++++++++-------- 4 files changed, 60 insertions(+), 61 deletions(-) diff --git a/Mathlib.lean b/Mathlib.lean index 65975e856faad6..5b4751deecfa23 100644 --- a/Mathlib.lean +++ b/Mathlib.lean @@ -1816,8 +1816,7 @@ import Mathlib.Analysis.NormedSpace.Multilinear.Curry import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn import Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic -import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn -import Mathlib.Analysis.NormedSpace.Multilinear.Basic +import Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear import Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness import Mathlib.Analysis.NormedSpace.OperatorNorm.Mul import Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm @@ -2603,8 +2602,7 @@ import Mathlib.CategoryTheory.Shift.InducedShiftSequence import Mathlib.CategoryTheory.Shift.Linear import Mathlib.CategoryTheory.Shift.Localization import Mathlib.CategoryTheory.Shift.Opposite -import Mathlib.CategoryTheory.Shift.Linear -import Mathlib.CategoryTheory.Shift.Induced +import Mathlib.CategoryTheory.Shift.Pullback import Mathlib.CategoryTheory.Shift.Quotient import Mathlib.CategoryTheory.Shift.ShiftSequence import Mathlib.CategoryTheory.Shift.ShiftedHom @@ -3286,8 +3284,7 @@ import Mathlib.Data.Matrix.RowCol import Mathlib.Data.Matrix.Vec import Mathlib.Data.Matroid.Basic import Mathlib.Data.Matroid.Circuit -import Mathlib.Data.Matrix.Vec -import Mathlib.Data.Matrix.Reflection +import Mathlib.Data.Matroid.Closure import Mathlib.Data.Matroid.Constructions import Mathlib.Data.Matroid.Dual import Mathlib.Data.Matroid.IndepAxioms @@ -4029,8 +4026,7 @@ import Mathlib.LinearAlgebra.Alternating.DomCoprod import Mathlib.LinearAlgebra.Alternating.Uncurry.Fin import Mathlib.LinearAlgebra.AnnihilatingPolynomial import Mathlib.LinearAlgebra.Basis.Basic -import Mathlib.LinearAlgebra.Alternating.Uncurry.Fin -import Mathlib.LinearAlgebra.Alternating.Curry +import Mathlib.LinearAlgebra.Basis.Bilinear import Mathlib.LinearAlgebra.Basis.Cardinality import Mathlib.LinearAlgebra.Basis.Defs import Mathlib.LinearAlgebra.Basis.Exact @@ -4256,8 +4252,7 @@ import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Relations import Mathlib.LinearAlgebra.RootSystem.GeckConstruction.Semisimple import Mathlib.LinearAlgebra.RootSystem.Hom import Mathlib.LinearAlgebra.RootSystem.Irreducible -import Mathlib.LinearAlgebra.RootSystem.GeckConstruction -import Mathlib.LinearAlgebra.RootSystem.Finite.Lemmas +import Mathlib.LinearAlgebra.RootSystem.IsValuedIn import Mathlib.LinearAlgebra.RootSystem.OfBilinear import Mathlib.LinearAlgebra.RootSystem.Reduced import Mathlib.LinearAlgebra.RootSystem.RootPairingCat @@ -5708,7 +5703,6 @@ import Mathlib.RingTheory.Spectrum.Prime.Jacobson import Mathlib.RingTheory.Spectrum.Prime.LTSeries import Mathlib.RingTheory.Spectrum.Prime.Module import Mathlib.RingTheory.Spectrum.Prime.Noetherian -import Mathlib.RingTheory.Spectrum.Prime.LTSeries import Mathlib.RingTheory.Spectrum.Prime.Polynomial import Mathlib.RingTheory.Spectrum.Prime.RingHom import Mathlib.RingTheory.Spectrum.Prime.TensorProduct @@ -5895,7 +5889,6 @@ import Mathlib.Tactic.CategoryTheory.Elementwise import Mathlib.Tactic.CategoryTheory.IsoReassoc import Mathlib.Tactic.CategoryTheory.Monoidal.Basic import Mathlib.Tactic.CategoryTheory.Monoidal.Datatypes -import Mathlib.Tactic.CategoryTheory.IsoReassoc import Mathlib.Tactic.CategoryTheory.Monoidal.Normalize import Mathlib.Tactic.CategoryTheory.Monoidal.PureCoherence import Mathlib.Tactic.CategoryTheory.MonoidalComp @@ -6209,7 +6202,6 @@ import Mathlib.Topology.Algebra.IsUniformGroup.Defs import Mathlib.Topology.Algebra.IsUniformGroup.Order import Mathlib.Topology.Algebra.LinearTopology import Mathlib.Topology.Algebra.Localization -import Mathlib.Topology.Algebra.IsUniformGroup.Order import Mathlib.Topology.Algebra.MetricSpace.Lipschitz import Mathlib.Topology.Algebra.Module.Alternating.Basic import Mathlib.Topology.Algebra.Module.Alternating.Topology @@ -6380,16 +6372,11 @@ import Mathlib.Topology.Compactification.OnePoint.Sphere import Mathlib.Topology.Compactification.OnePointEquiv import Mathlib.Topology.Compactification.StoneCech import Mathlib.Topology.Compactness.Bases -import Mathlib.Topology.Compactification.OnePoint.Basic -import Mathlib.Topology.Compactification.OnePoint.ProjectiveLine import Mathlib.Topology.Compactness.Compact import Mathlib.Topology.Compactness.CompactSystem import Mathlib.Topology.Compactness.CompactlyCoherentSpace import Mathlib.Topology.Compactness.CompactlyGeneratedSpace -import Mathlib.Topology.Compactness.CompactSystem -import Mathlib.Topology.Compactness.CompactlyGeneratedSpace import Mathlib.Topology.Compactness.DeltaGeneratedSpace -import Mathlib.Topology.Compactness.CompactlyCoherentSpace import Mathlib.Topology.Compactness.Exterior import Mathlib.Topology.Compactness.HilbertCubeEmbedding import Mathlib.Topology.Compactness.Lindelof diff --git a/Mathlib/Data/Set/Prod.lean b/Mathlib/Data/Set/Prod.lean index 35c038b5b35270..d54422551382c2 100644 --- a/Mathlib/Data/Set/Prod.lean +++ b/Mathlib/Data/Set/Prod.lean @@ -684,7 +684,7 @@ theorem pi_eq_empty_iff' : s.pi t = ∅ ↔ ∃ i ∈ s, t i = ∅ := by simp [p theorem disjoint_pi : Disjoint (s.pi t₁) (s.pi t₂) ↔ ∃ i ∈ s, Disjoint (t₁ i) (t₂ i) := by simp only [disjoint_iff_inter_eq_empty, ← pi_inter_distrib, pi_eq_empty_iff'] -theorem pi_nonempty_iff' [∀ i, Decidable (i ∈ s)] : +theorem pi_nonempty_iff' [∀ i, Decidable (i ∈ s)] : (s.pi t).Nonempty ↔ ∀ i ∈ s, (t i).Nonempty := by classical rw [pi_nonempty_iff] @@ -736,10 +736,6 @@ theorem pi_antitone (h : s₁ ⊆ s₂) : s₂.pi t ⊆ s₁.pi t := by rw [← union_diff_cancel h, union_pi] exact Set.inter_subset_left -theorem pi_antitone (h : s₁ ⊆ s₂) : s₂.pi t ⊆ s₁.pi t := by - rw [← union_diff_cancel h, union_pi] - exact Set.inter_subset_left - theorem union_pi_inter (ht₁ : ∀ i ∉ s₁, t₁ i = univ) (ht₂ : ∀ i ∉ s₂, t₂ i = univ) : (s₁ ∪ s₂).pi (fun i ↦ t₁ i ∩ t₂ i) = s₁.pi t₁ ∩ s₂.pi t₂ := by diff --git a/Mathlib/MeasureTheory/Constructions/Cylinders.lean b/Mathlib/MeasureTheory/Constructions/Cylinders.lean index ccfc91603cdd76..27c852b1decf37 100644 --- a/Mathlib/MeasureTheory/Constructions/Cylinders.lean +++ b/Mathlib/MeasureTheory/Constructions/Cylinders.lean @@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Rémy Degenne, Peter Pfaffelhuber, Yaël Dillies, Kin Yau James Wong -/ import Mathlib.Data.Finset.Lattice.Basic +import Mathlib.MeasureTheory.MeasurableSpace.Constructions import Mathlib.MeasureTheory.SetSemiring import Mathlib.Topology.Constructions import Mathlib.MeasureTheory.SetAlgebra @@ -53,12 +54,6 @@ variable {ι : Type _} {α : ι → Type _} section squareCylinders -/-- Given a finite set `s` of indices, a square cylinder is the product of sets `t i : Set (α i)` -for `i ∈ s` and of `univ` on the other indices. -/ -def squareCylinder (s : Finset ι) (t : ∀ i, Set (α i)) : Set (∀ i, α i) := - (s : Set ι).pi t - -/-- The set `S` is a product of sets `t i` such that /-- Given a finite set `s` of indices, a square cylinder is the product of sets `t i : Set (α i)` for `i ∈ s` and of `univ` on the other indices. -/ def squareCylinder (s : Finset ι) (t : ∀ i, Set (α i)) : Set (∀ i, α i) := @@ -69,12 +64,11 @@ for all `i : s`, `t i ∈ C i`. `squareCylinders` is the set of all such squareCylinders. -/ def squareCylinders (C : ∀ i, Set (Set (α i))) : Set (Set (∀ i, α i)) := {S | ∃ s : Finset ι, ∃ t ∈ univ.pi C, S = squareCylinder s t} - {S | ∃ s : Finset ι, ∃ t ∈ univ.pi C, S = squareCylinder s t} theorem squareCylinders_eq_iUnion_image (C : ∀ i, Set (Set (α i))) : squareCylinders C = ⋃ s : Finset ι, (s : Set ι).pi '' univ.pi C := by ext1 f - simp only [squareCylinder, squareCylinders, mem_iUnion, mem_image, mem_univ_pi, exists_prop, + simp only [squareCylinder, squareCylinders, mem_iUnion, mem_image, mem_univ_pi, mem_setOf_eq, eq_comm (a := f)] theorem squareCylinders_eq_iUnion_image' (C : ∀ i, Set (Set (α i))) (hC : ∀ i, Nonempty (C i)) : @@ -86,13 +80,28 @@ theorem squareCylinders_eq_iUnion_image' (C : ∀ i, Set (Set (α i))) (hC : ∀ refine pi_image_eq_of_subset hC (subset_univ s) simp_rw [← mem_image, h] +def squareCylinders_subset_of_or_univ (C : ∀ i, Set (Set (α i))) : + squareCylinders C ⊆ (univ.pi '' univ.pi (fun i ↦ C i ∪ {univ})) := by + classical + intro x hx + simp only [squareCylinders, squareCylinder, mem_pi, mem_univ, forall_const, mem_setOf_eq] at hx + obtain ⟨s, t, ⟨ht, hx⟩⟩ := hx + simp only [union_singleton, mem_image, mem_pi, mem_univ, mem_insert_iff, forall_const] + use fun i ↦ (if (i ∈ s) then (t i) else univ) + refine ⟨?_, ?_⟩ + · intro i + by_cases h : i ∈ s + · right + simp [h, ht] + · left + simp [h] + · exact hx ▸ univ_pi_ite s t + theorem isPiSystem_squareCylinders [∀ i, Inhabited (α i)] {C : ∀ i, Set (Set (α i))} (hC : ∀ i, IsPiSystem (C i)) (hC_univ : ∀ i, univ ∈ C i) : IsPiSystem (squareCylinders C) := by classical haveI h_nempty : ∀ i, Nonempty (C i) := fun i ↦ Nonempty.intro ⟨Set.univ, hC_univ i⟩ rintro S₁ ⟨s₁, t₁, h₁, rfl⟩ S₂ ⟨s₂, t₂, h₂, rfl⟩ hst_nonempty - haveI h_nempty : ∀ i, Nonempty (C i) := fun i ↦ Nonempty.intro ⟨Set.univ, hC_univ i⟩ - rintro S₁ ⟨s₁, t₁, h₁, rfl⟩ S₂ ⟨s₂, t₂, h₂, rfl⟩ hst_nonempty let t₁' := s₁.piecewise t₁ (fun i ↦ univ) simp only [Set.mem_pi, Set.mem_univ, forall_const] at h₁ h₂ have ht₁ (i : ι) : t₁' i ∈ C i := by @@ -100,7 +109,7 @@ theorem isPiSystem_squareCylinders [∀ i, Inhabited (α i)] {C : ∀ i, Set (Se · simp only [h, Finset.piecewise_eq_of_mem, t₁'] exact h₁ i · simp only [t₁'] - rw [Finset.piecewise_eq_of_not_mem s₁ t₁ (fun i ↦ univ) h] + rw [Finset.piecewise_eq_of_notMem s₁ t₁ (fun i ↦ univ) h] exact hC_univ i let t₂' := s₂.piecewise t₂ (fun i ↦ univ) have ht₂ (i : ι) : t₂' i ∈ C i := by @@ -108,7 +117,7 @@ theorem isPiSystem_squareCylinders [∀ i, Inhabited (α i)] {C : ∀ i, Set (Se · simp only [h, Finset.piecewise_eq_of_mem, t₂'] exact h₂ i · simp only [t₂'] - rw [Finset.piecewise_eq_of_not_mem s₂ t₂ (fun i ↦ univ) h] + rw [Finset.piecewise_eq_of_notMem s₂ t₂ (fun i ↦ univ) h] exact hC_univ i have h₁ : (s₁ : Set ι).pi t₁' = (s₁ : Set ι).pi t₁ := by refine Set.pi_congr rfl ?_ @@ -120,7 +129,7 @@ theorem isPiSystem_squareCylinders [∀ i, Inhabited (α i)] {C : ∀ i, Set (Se (fun i ↦ t₁' i ∩ t₂' i) := by rw [squareCylinder, squareCylinder, squareCylinder, Finset.coe_union, union_pi_inter, h₁, h₂] <;> - exact fun i a ↦ Finset.piecewise_eq_of_not_mem _ _ (fun i ↦ Set.univ) a + exact fun i a ↦ Finset.piecewise_eq_of_notMem _ _ (fun i ↦ Set.univ) a rw [h] at hst_nonempty ⊢ rw [squareCylinder, squareCylinders_eq_iUnion_image' C, mem_iUnion] · use (s₁ ∪ s₂), (fun i ↦ t₁' i ∩ t₂' i) @@ -150,7 +159,7 @@ theorem comap_eval_le_generateFrom_squareCylinders_singleton · simp only [hji, not_false_iff, dif_neg, MeasurableSet.univ] · simp only [eq_mpr_eq_cast, ← h] ext1 x - simp only [singleton_pi, Function.eval, cast_eq, dite_eq_ite, ite_true, Set.mem_preimage] + simp only [Function.eval, cast_eq, dite_eq_ite, ite_true, Set.mem_preimage] /-- The square cylinders formed from measurable sets generate the product σ-algebra. -/ theorem generateFrom_squareCylinders [∀ i, MeasurableSpace (α i)] : diff --git a/Mathlib/Topology/Compactness/CompactSystem.lean b/Mathlib/Topology/Compactness/CompactSystem.lean index 86dba0d841c6f7..280459fdd148b7 100644 --- a/Mathlib/Topology/Compactness/CompactSystem.lean +++ b/Mathlib/Topology/Compactness/CompactSystem.lean @@ -23,7 +23,7 @@ there is some `N : ℕ` with `⋂ n < N, C n = ∅`. ## Main results -* `IsCompactSystemiff_isCompactSystem_of_or_univ`: A set system is a compact +* `IsCompactSystem.iff_isCompactSystem_of_or_univ`: A set system is a compact system iff inserting `univ` gives a compact system. * `IsClosedCompact.isCompactSystem`: The set of closed and compact sets is a compact system. * `IsClosedCompact.isCompactSystem_of_T2Space`: In a `T2Space α`, the set of compact sets @@ -58,7 +58,7 @@ def finite_of_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) open Classical in lemma dissipate_eq_empty (hp : IsCompactSystem p) (hC : ∀ i, p (C i)) (hC_empty : ⋂ i, C i = ∅) : - Dissipate C (hp.finite_of_empty hC hC_empty) = ∅ := by + dissipate C (hp.finite_of_empty hC hC_empty) = ∅ := by apply Nat.find_spec (hp C hC hC_empty) theorem iff_nonempty_iInter (p : Set α → Prop) : @@ -123,7 +123,7 @@ lemma iff_isCompactSystem_of_or_empty : IsCompactSystem p ↔ exact h s hj hd lemma of_IsEmpty (h : IsEmpty α) (p : Set α → Prop) : IsCompactSystem p := - fun s _ _ ↦ ⟨0, Set.eq_empty_of_isEmpty (Dissipate s 0)⟩ + fun s _ _ ↦ ⟨0, Set.eq_empty_of_isEmpty (dissipate s 0)⟩ /-- A set system is a compact system iff adding `univ` gives a compact system. -/ lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ @@ -153,17 +153,17 @@ lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ ext x simp only [mem_iInter] refine ⟨fun h i ↦ ?_, fun h i ↦ ?_⟩ - · by_cases h' : p (s i) <;> simp only [h', ↓reduceIte, h, s', n] + · by_cases h' : p (s i) <;> simp only [h', ↓reduceIte, h, n] · specialize h' i specialize h i rcases h' with a | b - · simp only [a, ↓reduceIte, s', n] at h + · simp only [a, ↓reduceIte] at h exact h · simp only [b, Set.mem_univ] apply h₂ ▸ h s' h₁ by_contra! a obtain ⟨j, hj⟩ := a - have h₂ (v : ℕ) (hv : n ≤ v) : Dissipate s v = Dissipate s' v:= by + have h₂ (v : ℕ) (hv : n ≤ v) : dissipate s v = dissipate s' v:= by ext x refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ <;> simp only [dissipate_def, mem_iInter] at h ⊢ <;> intro i hi @@ -177,7 +177,7 @@ lemma iff_isCompactSystem_of_or_univ : IsCompactSystem p ↔ simp only [h₅, false_or] at h' exact h' simp only [h₆, Set.mem_univ] - have h₇ : Dissipate s' (max j n) = ∅ := by + have h₇ : dissipate s' (max j n) = ∅ := by rw [← subset_empty_iff] at hj ⊢ exact le_trans (antitone_dissipate (Nat.le_max_left j n)) hj specialize h₂ (max j n) (Nat.le_max_right j n) @@ -206,21 +206,21 @@ theorem iff_directed (hpi : IsPiSystem p) : right rfl rw [← biInter_le_eq_iInter] at h2 - obtain h' := h (Dissipate C) directed_dissipate - have h₀ : (∀ (n : ℕ), p (Dissipate C n) ∨ Dissipate C n = ∅) → ⋂ n, Dissipate C n = ∅ → - ∃ n, Dissipate C n = ∅ := by + obtain h' := h (dissipate C) directed_dissipate + have h₀ : (∀ (n : ℕ), p (dissipate C n) ∨ dissipate C n = ∅) → ⋂ n, dissipate C n = ∅ → + ∃ n, dissipate C n = ∅ := by intro h₀ h₁ - by_cases f : ∀ n, p (Dissipate C n) + by_cases f : ∀ n, p (dissipate C n) · apply h' f h₁ · push_neg at f obtain ⟨n, hn⟩ := f use n specialize h₀ n simp_all only [false_or] - obtain h'' := dissipate_of_piSystem hpi' h1 - have h₁ : ∀ (n : ℕ), p (Dissipate C n) ∨ Dissipate C n = ∅ := by + obtain h'' := IsPiSystem.dissipate_mem hpi' h1 + have h₁ : ∀ (n : ℕ), p (dissipate C n) ∨ dissipate C n = ∅ := by intro n - by_cases g : (Dissipate C n).Nonempty + by_cases g : (dissipate C n).Nonempty · exact h'' n g · right exact Set.not_nonempty_iff_eq_empty.mp g @@ -275,8 +275,8 @@ theorem of_isCompact_isClosed : simp only [Set.mem_univ] apply g <| IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed s' hs' (fun j ↦ h2 j) htco htcl - · simp only [ne_eq, coe_setOf, nonempty_subtype, not_exists, not_not, s'] at h - simp [s', h] + · simp only [ne_eq, coe_setOf, nonempty_subtype, not_exists, not_not] at h + simp [h] /-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ theorem of_isCompact_isClosed_or_univ : @@ -447,9 +447,10 @@ lemma q_iff_iInter' (L : ℕ → Finset (Set α)) (n : ℕ) (K : (k : Fin n) → · intro i simp [Fin.snoc] refine Fin.lastCases ?_ (fun i ↦ ?_) i - · simp [Fin.snoc_last] + · simp only [Fin.val_last, lt_self_iff_false, ↓reduceDIte, cast_eq] exact hx1.2 - · simp [Fin.snoc_castSucc] + · simp only [Fin.coe_castSucc, Fin.is_lt, ↓reduceDIte, Fin.castSucc_ne_last, + not_false_eq_true, Fin.castLT_eq_castPred, Fin.castPred_castSucc] exact hx1.1 i.val i.prop · intro i hi specialize hx2 (i + 1) (Nat.add_lt_add_right hi 1) @@ -564,7 +565,7 @@ lemma union.mem_iff (s : Set α) : union p s ↔ ∃ L : Finset (Set α), s = simp only [mem_setOf_eq, Finset.finite_toSet, Finset.mem_coe, true_and] refine ⟨hL.2, hL.1.symm⟩ -theorem union.isCompactSystem (p : Set α → Prop)(hp : IsCompactSystem p) : +theorem union.isCompactSystem (p : Set α → Prop) (hp : IsCompactSystem p) : IsCompactSystem (union p) := by rw [iff_nonempty_iInter_of_lt] intro C hi @@ -583,7 +584,7 @@ end Union section pi -variable {ι : Type*} {α : ι → Type*} +variable {ι : Type*} {α : ι → Type*} /- In a product space, the intersection of square cylinders is empty iff there is a coordinate `i` such that the projections to `i` have empty intersection. -/ @@ -602,7 +603,7 @@ theorem iInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i rw [iInter_pi_empty_iff] simp only [mem_univ, iInter_true] -theorem biInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) (p : β → Prop): +theorem biInter_univ_pi_empty_iff {β : Type*} (t : β → (i : ι) → Set (α i)) (p : β → Prop) : ( ⋂ (b : β), ⋂ (_ : p b), (univ.pi (t b)) = ∅) ↔ (∃ i : ι, ⋂ (b : β), ⋂ (_ : p b), (t b i) = ∅) := by have h : ⋂ (b : β), ⋂ (_ : p b), (univ.pi (t b)) = @@ -627,7 +628,7 @@ theorem pi (C : (i : ι) → Set (Set (α i))) (hC : ∀ i, IsCompactSystem (C i exact hx1 b i have ⟨n, hn⟩ := (hC i) y hy hi use n - simp_rw [Dissipate, ← hx2] at hn ⊢ + simp_rw [dissipate, ← hx2] at hn ⊢ rw [biInter_univ_pi_empty_iff x] use i @@ -651,11 +652,17 @@ def MeasureTheory.compactClosedSquareCylinders : Set (Set (Π i, α i)) := theorem IsCompactSystem.compactClosedPi : IsCompactSystem (univ.pi '' univ.pi (fun i ↦ { t : Set (α i) | IsCompact t ∧ IsClosed t })) := IsCompactSystem.pi _ (fun _ ↦ IsCompactSystem.of_isCompact_isClosed) +/-- Products of compact and closed sets form a compact system. -/ + +theorem IsCompactSystem.compactClosedOrUnivPi : + IsCompactSystem (univ.pi '' univ.pi (fun i ↦ { t : Set (α i) | IsCompact t ∧ IsClosed t } + ∪ { univ })) := + IsCompactSystem.pi _ (fun _ ↦ IsCompactSystem.of_isCompact_isClosed_or_univ) /-- Compact and closed square cylinders are a compact system. -/ theorem isCompactSystem.compactClosedSquareCylinders : IsCompactSystem (compactClosedSquareCylinders α) := - IsCompactSystem.mono CompactClosedOrUniv_pi - compactClosedSquareCylinders_supset + IsCompactSystem.mono (IsCompactSystem.compactClosedOrUnivPi _) + (squareCylinders_subset_of_or_univ _) end ClosedCompactSquareCylinders