Theorem: isCompact_pi_infinite
File: Mathlib/Topology/SubsetProperties.lean

tactic: simp only [isCompact_iff_ultrafilter_le_nhds, nhds_pi, Filter.pi, exists_prop, mem_setOf_eq,
  le_iInf_iff, le_principal_iff]
state_before: α : Type u
β : Type v
ι : Type u_2
π : ι → Type u_1
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
s✝ t : Set α
inst✝ : (i : ι) → TopologicalSpace (π i)
s : (i : ι) → Set (π i)
⊢ (∀ (i : ι), IsCompact (s i)) → IsCompact {x | ∀ (i : ι), x i ∈ s i}

tactic: intro h f hfs
state_before: α : Type u
β : Type v
ι : Type u_2
π : ι → Type u_1
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
s✝ t : Set α
inst✝ : (i : ι) → TopologicalSpace (π i)
s : (i : ι) → Set (π i)
⊢ (∀ (i : ι) (f : Ultrafilter (π i)), s i ∈ ↑f → ∃ a, a ∈ s i ∧ ↑f ≤ 𝓝 a) →
    ∀ (f : Ultrafilter ((i : ι) → π i)),
      {x | ∀ (i : ι), x i ∈ s i} ∈ ↑f → ∃ a, (∀ (i : ι), a i ∈ s i) ∧ ∀ (i : ι), ↑f ≤ comap (Function.eval i) (𝓝 (a i))

tactic: have : ∀ i : ι, ∃ a, a ∈ s i ∧ Tendsto (Function.eval i) f (𝓝 a) := by
  refine fun i => h i (f.map _) (mem_map.2 ?_)
  exact mem_of_superset hfs fun x hx => hx i
state_before: α : Type u
β : Type v
ι : Type u_2
π : ι → Type u_1
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
s✝ t : Set α
inst✝ : (i : ι) → TopologicalSpace (π i)
s : (i : ι) → Set (π i)
h : ∀ (i : ι) (f : Ultrafilter (π i)), s i ∈ ↑f → ∃ a, a ∈ s i ∧ ↑f ≤ 𝓝 a
f : Ultrafilter ((i : ι) → π i)
hfs : {x | ∀ (i : ι), x i ∈ s i} ∈ ↑f
⊢ ∃ a, (∀ (i : ι), a i ∈ s i) ∧ ∀ (i : ι), ↑f ≤ comap (Function.eval i) (𝓝 (a i))

tactic: choose a ha using this
state_before: α : Type u
β : Type v
ι : Type u_2
π : ι → Type u_1
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
s✝ t : Set α
inst✝ : (i : ι) → TopologicalSpace (π i)
s : (i : ι) → Set (π i)
h : ∀ (i : ι) (f : Ultrafilter (π i)), s i ∈ ↑f → ∃ a, a ∈ s i ∧ ↑f ≤ 𝓝 a
f : Ultrafilter ((i : ι) → π i)
hfs : {x | ∀ (i : ι), x i ∈ s i} ∈ ↑f
this : ∀ (i : ι), ∃ a, a ∈ s i ∧ Tendsto (Function.eval i) (↑f) (𝓝 a)
⊢ ∃ a, (∀ (i : ι), a i ∈ s i) ∧ ∀ (i : ι), ↑f ≤ comap (Function.eval i) (𝓝 (a i))

tactic: exact ⟨a, fun i => (ha i).left, fun i => (ha i).right.le_comap⟩
state_before: α : Type u
β : Type v
ι : Type u_2
π : ι → Type u_1
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
s✝ t : Set α
inst✝ : (i : ι) → TopologicalSpace (π i)
s : (i : ι) → Set (π i)
h : ∀ (i : ι) (f : Ultrafilter (π i)), s i ∈ ↑f → ∃ a, a ∈ s i ∧ ↑f ≤ 𝓝 a
f : Ultrafilter ((i : ι) → π i)
hfs : {x | ∀ (i : ι), x i ∈ s i} ∈ ↑f
a : (i : ι) → π i
ha : ∀ (i : ι), a i ∈ s i ∧ Tendsto (Function.eval i) (↑f) (𝓝 (a i))
⊢ ∃ a, (∀ (i : ι), a i ∈ s i) ∧ ∀ (i : ι), ↑f ≤ comap (Function.eval i) (𝓝 (a i))

tactic: refine fun i => h i (f.map _) (mem_map.2 ?_)
state_before: α : Type u
β : Type v
ι : Type u_2
π : ι → Type u_1
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
s✝ t : Set α
inst✝ : (i : ι) → TopologicalSpace (π i)
s : (i : ι) → Set (π i)
h : ∀ (i : ι) (f : Ultrafilter (π i)), s i ∈ ↑f → ∃ a, a ∈ s i ∧ ↑f ≤ 𝓝 a
f : Ultrafilter ((i : ι) → π i)
hfs : {x | ∀ (i : ι), x i ∈ s i} ∈ ↑f
⊢ ∀ (i : ι), ∃ a, a ∈ s i ∧ Tendsto (Function.eval i) (↑f) (𝓝 a)

tactic: exact mem_of_superset hfs fun x hx => hx i
state_before: α : Type u
β : Type v
ι : Type u_2
π : ι → Type u_1
inst✝² : TopologicalSpace α
inst✝¹ : TopologicalSpace β
s✝ t : Set α
inst✝ : (i : ι) → TopologicalSpace (π i)
s : (i : ι) → Set (π i)
h : ∀ (i : ι) (f : Ultrafilter (π i)), s i ∈ ↑f → ∃ a, a ∈ s i ∧ ↑f ≤ 𝓝 a
f : Ultrafilter ((i : ι) → π i)
hfs : {x | ∀ (i : ι), x i ∈ s i} ∈ ↑f
i : ι
⊢ Function.eval i ⁻¹' s i ∈ ↑f