l3lab/ntp-mathlib huggingface dataset:
/-- If `M` is a topological module over `R` and `0` is a limit of invertible elements of `R`, then
`⊤` is the only submodule of `M` with a nonempty interior.
This is the case, e.g., if `R` is a nontrivially normed field. -/
theorem Submodule.eq_top_of_nonempty_interior' [NeBot (𝓝[{ x : R | IsUnit x }] 0)]
    (s : Submodule R M) (hs : (interior (s : Set M)).Nonempty) : s = ⊤ := by
  rcases hs with ⟨y, hy⟩
  refine' Submodule.eq_top_iff'.2 fun x => _
  rw [mem_interior_iff_mem_nhds] at hy
  have : Tendsto (fun c : R => y + c • x) (𝓝[{ x : R | IsUnit x }] 0) (𝓝 (y + (0 : R) • x)) :=
    tendsto_const_nhds.add ((tendsto_nhdsWithin_of_tendsto_nhds tendsto_id).smul tendsto_const_nhds)
  rw [zero_smul, add_zero] at this
  obtain ⟨_, hu : y + _ • _ ∈ s, u, rfl⟩ :=
    nonempty_of_mem (inter_mem (Filter.mem_map.1 (this hy)) self_mem_nhdsWithin)
  have hy' : y ∈ ↑s := mem_of_mem_nhds hy
  

Proof state:
case intro.intro.intro.intro
R : Type u_1
M : Type u_2
inst✝⁷ : Ring R
inst✝⁶ : TopologicalSpace R
inst✝⁵ : TopologicalSpace M
inst✝⁴ : AddCommGroup M
inst✝³ : ContinuousAdd M
inst✝² : Module R M
inst✝¹ : ContinuousSMul R M
inst✝ : NeBot (𝓝[{x | IsUnit x}] 0)
s : Submodule R M
y : M
hy : ↑s ∈ 𝓝 y
x : M
this : Tendsto (fun c => y + c • x) (𝓝[{x | IsUnit x}] 0) (𝓝 y)
u : Rˣ
hu : y + ↑u • x ∈ s
hy' : y ∈ ↑s
⊢ x ∈ s

Next tactic:
rwa [s.add_mem_iff_right hy', ← Units.smul_def, s.smul_mem_iff' u] at hu
/-- Let `R` be a topological ring such that zero is not an isolated point (e.g., a nontrivially
normed field, see `NormedField.punctured_nhds_neBot`). Let `M` be a nontrivial module over `R`
such that `c • x = 0` implies `c = 0 ∨ x = 0`. Then `M` has no isolated points. We formulate this
using `NeBot (𝓝[≠] x)`.

This lemma is not an instance because Lean would need to find `[ContinuousSMul ?m_1 M]` with
unknown `?m_1`. We register this as an instance for `R = ℝ` in `Real.punctured_nhds_module_neBot`.
One can also use `haveI := Module.punctured_nhds_neBot R M` in a proof.
-/
theorem Module.punctured_nhds_neBot [Nontrivial M] [NeBot (𝓝[≠] (0 : R))] [NoZeroSMulDivisors R M]
    (x : M) : NeBot (𝓝[≠] x) := by
  

Proof state:
R : Type u_1
M : Type u_2
inst✝⁹ : Ring R
inst✝⁸ : TopologicalSpace R
inst✝⁷ : TopologicalSpace M
inst✝⁶ : AddCommGroup M
inst✝⁵ : ContinuousAdd M
inst✝⁴ : Module R M
inst✝³ : ContinuousSMul R M
inst✝² : Nontrivial M
inst✝¹ : NeBot (𝓝[≠] 0)
inst✝ : NoZeroSMulDivisors R M
x : M
⊢ NeBot (𝓝[≠] x)

Next tactic:
rcases exists_ne (0 : M) with ⟨y, hy⟩
/-- Let `R` be a topological ring such that zero is not an isolated point (e.g., a nontrivially
normed field, see `NormedField.punctured_nhds_neBot`). Let `M` be a nontrivial module over `R`
such that `c • x = 0` implies `c = 0 ∨ x = 0`. Then `M` has no isolated points. We formulate this
using `NeBot (𝓝[≠] x)`.

This lemma is not an instance because Lean would need to find `[ContinuousSMul ?m_1 M]` with
unknown `?m_1`. We register this as an instance for `R = ℝ` in `Real.punctured_nhds_module_neBot`.
One can also use `haveI := Module.punctured_nhds_neBot R M` in a proof.
-/
theorem Module.punctured_nhds_neBot [Nontrivial M] [NeBot (𝓝[≠] (0 : R))] [NoZeroSMulDivisors R M]
    (x : M) : NeBot (𝓝[≠] x) := by
  rcases exists_ne (0 : M) with ⟨y, hy⟩
  

Proof state:
case intro
R : Type u_1
M : Type u_2
inst✝⁹ : Ring R
inst✝⁸ : TopologicalSpace R
inst✝⁷ : TopologicalSpace M
inst✝⁶ : AddCommGroup M
inst✝⁵ : ContinuousAdd M
inst✝⁴ : Module R M
inst✝³ : ContinuousSMul R M
inst✝² : Nontrivial M
inst✝¹ : NeBot (𝓝[≠] 0)
inst✝ : NoZeroSMulDivisors R M
x y : M
hy : y ≠ 0
⊢ NeBot (𝓝[≠] x)

Next tactic:
suffices : Tendsto (fun c : R => x + c • y) (𝓝[≠] 0) (𝓝[≠] x)
/-- Let `R` be a topological ring such that zero is not an isolated point (e.g., a nontrivially
normed field, see `NormedField.punctured_nhds_neBot`). Let `M` be a nontrivial module over `R`
such that `c • x = 0` implies `c = 0 ∨ x = 0`. Then `M` has no isolated points. We formulate this
using `NeBot (𝓝[≠] x)`.

This lemma is not an instance because Lean would need to find `[ContinuousSMul ?m_1 M]` with
unknown `?m_1`. We register this as an instance for `R = ℝ` in `Real.punctured_nhds_module_neBot`.
One can also use `haveI := Module.punctured_nhds_neBot R M` in a proof.
-/
theorem Module.punctured_nhds_neBot [Nontrivial M] [NeBot (𝓝[≠] (0 : R))] [NoZeroSMulDivisors R M]
    (x : M) : NeBot (𝓝[≠] x) := by
  rcases exists_ne (0 : M) with ⟨y, hy⟩
  suffices : Tendsto (fun c : R => x + c • y) (𝓝[≠] 0) (𝓝[≠] x); 

Proof state:
case intro
R : Type u_1
M : Type u_2
inst✝⁹ : Ring R
inst✝⁸ : TopologicalSpace R
inst✝⁷ : TopologicalSpace M
inst✝⁶ : AddCommGroup M
inst✝⁵ : ContinuousAdd M
inst✝⁴ : Module R M
inst✝³ : ContinuousSMul R M
inst✝² : Nontrivial M
inst✝¹ : NeBot (𝓝[≠] 0)
inst✝ : NoZeroSMulDivisors R M
x y : M
hy : y ≠ 0
this : Tendsto (fun c => x + c • y) (𝓝[≠] 0) (𝓝[≠] x)
⊢ NeBot (𝓝[≠] x)
case this
R : Type u_1
M : Type u_2
inst✝⁹ : Ring R
inst✝⁸ : TopologicalSpace R
inst✝⁷ : TopologicalSpace M
inst✝⁶ : AddCommGroup M
inst✝⁵ : ContinuousAdd M
inst✝⁴ : Module R M
inst✝³ : ContinuousSMul R M
inst✝² : Nontrivial M
inst✝¹ : NeBot (𝓝[≠] 0)
inst✝ : NoZeroSMulDivisors R M
x y : M
hy : y ≠ 0
⊢ Tendsto (fun c => x + c • y) (𝓝[≠] 0) (𝓝[≠] x)

Next tactic:
exact this.neBot
/-- Let `R` be a topological ring such that zero is not an isolated point (e.g., a nontrivially
normed field, see `NormedField.punctured_nhds_neBot`). Let `M` be a nontrivial module over `R`
such that `c • x = 0` implies `c = 0 ∨ x = 0`. Then `M` has no isolated points. We formulate this
using `NeBot (𝓝[≠] x)`.

This lemma is not an instance because Lean would need to find `[ContinuousSMul ?m_1 M]` with
unknown `?m_1`. We register this as an instance for `R = ℝ` in `Real.punctured_nhds_module_neBot`.
One can also use `haveI := Module.punctured_nhds_neBot R M` in a proof.
-/
theorem Module.punctured_nhds_neBot [Nontrivial M] [NeBot (𝓝[≠] (0 : R))] [NoZeroSMulDivisors R M]
    (x : M) : NeBot (𝓝[≠] x) := by
  rcases exists_ne (0 : M) with ⟨y, hy⟩
  suffices : Tendsto (fun c : R => x + c • y) (𝓝[≠] 0) (𝓝[≠] x); exact this.neBot
  

Proof state:
case this
R : Type u_1
M : Type u_2
inst✝⁹ : Ring R
inst✝⁸ : TopologicalSpace R
inst✝⁷ : TopologicalSpace M
inst✝⁶ : AddCommGroup M
inst✝⁵ : ContinuousAdd M
inst✝⁴ : Module R M
inst✝³ : ContinuousSMul R M
inst✝² : Nontrivial M
inst✝¹ : NeBot (𝓝[≠] 0)
inst✝ : NoZeroSMulDivisors R M
x y : M
hy : y ≠ 0
⊢ Tendsto (fun c => x + c • y) (𝓝[≠] 0) (𝓝[≠] x)

Next tactic:
refine' Tendsto.inf _ (tendsto_principal_principal.2 <| _)
/-- Let `R` be a topological ring such that zero is not an isolated point (e.g., a nontrivially
normed field, see `NormedField.punctured_nhds_neBot`). Let `M` be a nontrivial module over `R`
such that `c • x = 0` implies `c = 0 ∨ x = 0`. Then `M` has no isolated points. We formulate this
using `NeBot (𝓝[≠] x)`.

This lemma is not an instance because Lean would need to find `[ContinuousSMul ?m_1 M]` with
unknown `?m_1`. We register this as an instance for `R = ℝ` in `Real.punctured_nhds_module_neBot`.
One can also use `haveI := Module.punctured_nhds_neBot R M` in a proof.
-/
theorem Module.punctured_nhds_neBot [Nontrivial M] [NeBot (𝓝[≠] (0 : R))] [NoZeroSMulDivisors R M]
    (x : M) : NeBot (𝓝[≠] x) := by
  rcases exists_ne (0 : M) with ⟨y, hy⟩
  suffices : Tendsto (fun c : R => x + c • y) (𝓝[≠] 0) (𝓝[≠] x); exact this.neBot
  refine' Tendsto.inf _ (tendsto_principal_principal.2 <| _)
  · 

Proof state:
case this.refine'_1
R : Type u_1
M : Type u_2
inst✝⁹ : Ring R
inst✝⁸ : TopologicalSpace R
inst✝⁷ : TopologicalSpace M
inst✝⁶ : AddCommGroup M
inst✝⁵ : ContinuousAdd M
inst✝⁴ : Module R M
inst✝³ : ContinuousSMul R M
inst✝² : Nontrivial M
inst✝¹ : NeBot (𝓝[≠] 0)
inst✝ : NoZeroSMulDivisors R M
x y : M
hy : y ≠ 0
⊢ Tendsto (fun c => x + c • y) (𝓝 0) (𝓝 x)

Next tactic:
convert tendsto_const_nhds.add ((@tendsto_id R _).smul_const y)
/-- Let `R` be a topological ring such that zero is not an isolated point (e.g., a nontrivially
normed field, see `NormedField.punctured_nhds_neBot`). Let `M` be a nontrivial module over `R`
such that `c • x = 0` implies `c = 0 ∨ x = 0`. Then `M` has no isolated points. We formulate this
using `NeBot (𝓝[≠] x)`.

This lemma is not an instance because Lean would need to find `[ContinuousSMul ?m_1 M]` with
unknown `?m_1`. We register this as an instance for `R = ℝ` in `Real.punctured_nhds_module_neBot`.
One can also use `haveI := Module.punctured_nhds_neBot R M` in a proof.
-/
theorem Module.punctured_nhds_neBot [Nontrivial M] [NeBot (𝓝[≠] (0 : R))] [NoZeroSMulDivisors R M]
    (x : M) : NeBot (𝓝[≠] x) := by
  rcases exists_ne (0 : M) with ⟨y, hy⟩
  suffices : Tendsto (fun c : R => x + c • y) (𝓝[≠] 0) (𝓝[≠] x); exact this.neBot
  refine' Tendsto.inf _ (tendsto_principal_principal.2 <| _)
  · convert tendsto_const_nhds.add ((@tendsto_id R _).smul_const y)
    

Proof state:
case h.e'_5.h.e'_3
R : Type u_1
M : Type u_2
inst✝⁹ : Ring R
inst✝⁸ : TopologicalSpace R
inst✝⁷ : TopologicalSpace M
inst✝⁶ : AddCommGroup M
inst✝⁵ : ContinuousAdd M
inst✝⁴ : Module R M
inst✝³ : ContinuousSMul R M
inst✝² : Nontrivial M
inst✝¹ : NeBot (𝓝[≠] 0)
inst✝ : NoZeroSMulDivisors R M
x y : M
hy : y ≠ 0
⊢ x = x + 0 • y

Next tactic:
rw [zero_smul, add_zero]
/-- Let `R` be a topological ring such that zero is not an isolated point (e.g., a nontrivially
normed field, see `NormedField.punctured_nhds_neBot`). Let `M` be a nontrivial module over `R`
such that `c • x = 0` implies `c = 0 ∨ x = 0`. Then `M` has no isolated points. We formulate this
using `NeBot (𝓝[≠] x)`.

This lemma is not an instance because Lean would need to find `[ContinuousSMul ?m_1 M]` with
unknown `?m_1`. We register this as an instance for `R = ℝ` in `Real.punctured_nhds_module_neBot`.
One can also use `haveI := Module.punctured_nhds_neBot R M` in a proof.
-/
theorem Module.punctured_nhds_neBot [Nontrivial M] [NeBot (𝓝[≠] (0 : R))] [NoZeroSMulDivisors R M]
    (x : M) : NeBot (𝓝[≠] x) := by
  rcases exists_ne (0 : M) with ⟨y, hy⟩
  suffices : Tendsto (fun c : R => x + c • y) (𝓝[≠] 0) (𝓝[≠] x); exact this.neBot
  refine' Tendsto.inf _ (tendsto_principal_principal.2 <| _)
  · convert tendsto_const_nhds.add ((@tendsto_id R _).smul_const y)
    rw [zero_smul, add_zero]
  · 

Proof state:
case this.refine'_2
R : Type u_1
M : Type u_2
inst✝⁹ : Ring R
inst✝⁸ : TopologicalSpace R
inst✝⁷ : TopologicalSpace M
inst✝⁶ : AddCommGroup M
inst✝⁵ : ContinuousAdd M
inst✝⁴ : Module R M
inst✝³ : ContinuousSMul R M
inst✝² : Nontrivial M
inst✝¹ : NeBot (𝓝[≠] 0)
inst✝ : NoZeroSMulDivisors R M
x y : M
hy : y ≠ 0
⊢ ∀ a ∈ {0}ᶜ, x + a • y ∈ {x}ᶜ

Next tactic:
intro c hc
/-- Let `R` be a topological ring such that zero is not an isolated point (e.g., a nontrivially
normed field, see `NormedField.punctured_nhds_neBot`). Let `M` be a nontrivial module over `R`
such that `c • x = 0` implies `c = 0 ∨ x = 0`. Then `M` has no isolated points. We formulate this
using `NeBot (𝓝[≠] x)`.

This lemma is not an instance because Lean would need to find `[ContinuousSMul ?m_1 M]` with
unknown `?m_1`. We register this as an instance for `R = ℝ` in `Real.punctured_nhds_module_neBot`.
One can also use `haveI := Module.punctured_nhds_neBot R M` in a proof.
-/
theorem Module.punctured_nhds_neBot [Nontrivial M] [NeBot (𝓝[≠] (0 : R))] [NoZeroSMulDivisors R M]
    (x : M) : NeBot (𝓝[≠] x) := by
  rcases exists_ne (0 : M) with ⟨y, hy⟩
  suffices : Tendsto (fun c : R => x + c • y) (𝓝[≠] 0) (𝓝[≠] x); exact this.neBot
  refine' Tendsto.inf _ (tendsto_principal_principal.2 <| _)
  · convert tendsto_const_nhds.add ((@tendsto_id R _).smul_const y)
    rw [zero_smul, add_zero]
  · intro c hc
    

Proof state:
case this.refine'_2
R : Type u_1
M : Type u_2
inst✝⁹ : Ring R
inst✝⁸ : TopologicalSpace R
inst✝⁷ : TopologicalSpace M
inst✝⁶ : AddCommGroup M
inst✝⁵ : ContinuousAdd M
inst✝⁴ : Module R M
inst✝³ : ContinuousSMul R M
inst✝² : Nontrivial M
inst✝¹ : NeBot (𝓝[≠] 0)
inst✝ : NoZeroSMulDivisors R M
x y : M
hy : y ≠ 0
c : R
hc : c ∈ {0}ᶜ
⊢ x + c • y ∈ {x}ᶜ

Next tactic:
simpa [hy] using hc
theorem continuousSMul_induced : @ContinuousSMul R M₁ _ u (t.induced f) := by
  

Proof state:
ι : Type u_1
R : Type u_2
M₁ : Type u_3
M₂ : Type u_4
inst✝⁵ : Semiring R
inst✝⁴ : AddCommMonoid M₁
inst✝³ : AddCommMonoid M₂
inst✝² : Module R M₁
inst✝¹ : Module R M₂
u : TopologicalSpace R
t : TopologicalSpace M₂
inst✝ : ContinuousSMul R M₂
f : M₁ →ₗ[R] M₂
⊢ ContinuousSMul R M₁

Next tactic:
let _ : TopologicalSpace M₁ := t.induced f
theorem continuousSMul_induced : @ContinuousSMul R M₁ _ u (t.induced f) := by
  let _ : TopologicalSpace M₁ := t.induced f
  

Proof state:
ι : Type u_1
R : Type u_2
M₁ : Type u_3
M₂ : Type u_4
inst✝⁵ : Semiring R
inst✝⁴ : AddCommMonoid M₁
inst✝³ : AddCommMonoid M₂
inst✝² : Module R M₁
inst✝¹ : Module R M₂
u : TopologicalSpace R
t : TopologicalSpace M₂
inst✝ : ContinuousSMul R M₂
f : M₁ →ₗ[R] M₂
x✝ : TopologicalSpace M₁ := TopologicalSpace.induced (⇑f) t
⊢ ContinuousSMul R M₁

Next tactic:
refine' ⟨continuous_induced_rng.2 _⟩
theorem continuousSMul_induced : @ContinuousSMul R M₁ _ u (t.induced f) := by
  let _ : TopologicalSpace M₁ := t.induced f
  refine' ⟨continuous_induced_rng.2 _⟩
  

Proof state:
ι : Type u_1
R : Type u_2
M₁ : Type u_3
M₂ : Type u_4
inst✝⁵ : Semiring R
inst✝⁴ : AddCommMonoid M₁
inst✝³ : AddCommMonoid M₂
inst✝² : Module R M₁
inst✝¹ : Module R M₂
u : TopologicalSpace R
t : TopologicalSpace M₂
inst✝ : ContinuousSMul R M₂
f : M₁ →ₗ[R] M₂
x✝ : TopologicalSpace M₁ := TopologicalSpace.induced (⇑f) t
⊢ Continuous (⇑f ∘ fun p => p.1 • p.2)

Next tactic:
simp_rw [Function.comp, f.map_smul]
theorem continuousSMul_induced : @ContinuousSMul R M₁ _ u (t.induced f) := by
  let _ : TopologicalSpace M₁ := t.induced f
  refine' ⟨continuous_induced_rng.2 _⟩
  simp_rw [Function.comp, f.map_smul]
  

Proof state:
ι : Type u_1
R : Type u_2
M₁ : Type u_3
M₂ : Type u_4
inst✝⁵ : Semiring R
inst✝⁴ : AddCommMonoid M₁
inst✝³ : AddCommMonoid M₂
inst✝² : Module R M₁
inst✝¹ : Module R M₂
u : TopologicalSpace R
t : TopologicalSpace M₂
inst✝ : ContinuousSMul R M₂
f : M₁ →ₗ[R] M₂
x✝ : TopologicalSpace M₁ := TopologicalSpace.induced (⇑f) t
⊢ Continuous fun x => x.1 • f x.2

Next tactic:
exact continuous_fst.smul (continuous_induced_dom.comp continuous_snd)
/-- The span of a separable subset with respect to a separable scalar ring is again separable. -/
lemma TopologicalSpace.IsSeparable.span {R M : Type*} [AddCommMonoid M] [Semiring R] [Module R M]
    [TopologicalSpace M] [TopologicalSpace R] [SeparableSpace R]
    [ContinuousAdd M] [ContinuousSMul R M] {s : Set M} (hs : IsSeparable s) :
    IsSeparable (Submodule.span R s : Set M) := by
  

Proof state:
R : Type u_1
M : Type u_2
inst✝⁷ : AddCommMonoid M
inst✝⁶ : Semiring R
inst✝⁵ : Module R M
inst✝⁴ : TopologicalSpace M
inst✝³ : TopologicalSpace R
inst✝² : SeparableSpace R
inst✝¹ : ContinuousAdd M
inst✝ : ContinuousSMul R M
s : Set M
hs : IsSeparable s
⊢ IsSeparable ↑(Submodule.span R s)

Next tactic:
rw [span_eq_iUnion_nat]
/-- The span of a separable subset with respect to a separable scalar ring is again separable. -/
lemma TopologicalSpace.IsSeparable.span {R M : Type*} [AddCommMonoid M] [Semiring R] [Module R M]
    [TopologicalSpace M] [TopologicalSpace R] [SeparableSpace R]
    [ContinuousAdd M] [ContinuousSMul R M] {s : Set M} (hs : IsSeparable s) :
    IsSeparable (Submodule.span R s : Set M) := by
  rw [span_eq_iUnion_nat]
  

Proof state:
R : Type u_1
M : Type u_2
inst✝⁷ : AddCommMonoid M
inst✝⁶ : Semiring R
inst✝⁵ : Module R M
inst✝⁴ : TopologicalSpace M
inst✝³ : TopologicalSpace R
inst✝² : SeparableSpace R
inst✝¹ : ContinuousAdd M
inst✝ : ContinuousSMul R M
s : Set M
hs : IsSeparable s
⊢ IsSeparable (⋃ n, (fun f => ∑ i : Fin n, (f i).1 • (f i).2) '' {f | ∀ (i : Fin n), (f i).2 ∈ s})

Next tactic:
apply isSeparable_iUnion (fun n ↦ ?_)
/-- The span of a separable subset with respect to a separable scalar ring is again separable. -/
lemma TopologicalSpace.IsSeparable.span {R M : Type*} [AddCommMonoid M] [Semiring R] [Module R M]
    [TopologicalSpace M] [TopologicalSpace R] [SeparableSpace R]
    [ContinuousAdd M] [ContinuousSMul R M] {s : Set M} (hs : IsSeparable s) :
    IsSeparable (Submodule.span R s : Set M) := by
  rw [span_eq_iUnion_nat]
  apply isSeparable_iUnion (fun n ↦ ?_)
  

Proof state:
R : Type u_1
M : Type u_2
inst✝⁷ : AddCommMonoid M
inst✝⁶ : Semiring R
inst✝⁵ : Module R M
inst✝⁴ : TopologicalSpace M
inst✝³ : TopologicalSpace R
inst✝² : SeparableSpace R
inst✝¹ : ContinuousAdd M
inst✝ : ContinuousSMul R M
s : Set M
hs : IsSeparable s
n : ℕ
⊢ IsSeparable ((fun f => ∑ i : Fin n, (f i).1 • (f i).2) '' {f | ∀ (i : Fin n), (f i).2 ∈ s})

Next tactic:
apply IsSeparable.image
/-- The span of a separable subset with respect to a separable scalar ring is again separable. -/
lemma TopologicalSpace.IsSeparable.span {R M : Type*} [AddCommMonoid M] [Semiring R] [Module R M]
    [TopologicalSpace M] [TopologicalSpace R] [SeparableSpace R]
    [ContinuousAdd M] [ContinuousSMul R M] {s : Set M} (hs : IsSeparable s) :
    IsSeparable (Submodule.span R s : Set M) := by
  rw [span_eq_iUnion_nat]
  apply isSeparable_iUnion (fun n ↦ ?_)
  apply IsSeparable.image
  · 

Proof state:
case hs
R : Type u_1
M : Type u_2
inst✝⁷ : AddCommMonoid M
inst✝⁶ : Semiring R
inst✝⁵ : Module R M
inst✝⁴ : TopologicalSpace M
inst✝³ : TopologicalSpace R
inst✝² : SeparableSpace R
inst✝¹ : ContinuousAdd M
inst✝ : ContinuousSMul R M
s : Set M
hs : IsSeparable s
n : ℕ
⊢ IsSeparable {f | ∀ (i : Fin n), (f i).2 ∈ s}

Next tactic:
have : IsSeparable {f : Fin n → R × M | ∀ (i : Fin n), f i ∈ Set.univ ×ˢ s} := by
      apply isSeparable_pi (fun i ↦ (isSeparable_of_separableSpace Set.univ).prod hs)
/-- The span of a separable subset with respect to a separable scalar ring is again separable. -/
lemma TopologicalSpace.IsSeparable.span {R M : Type*} [AddCommMonoid M] [Semiring R] [Module R M]
    [TopologicalSpace M] [TopologicalSpace R] [SeparableSpace R]
    [ContinuousAdd M] [ContinuousSMul R M] {s : Set M} (hs : IsSeparable s) :
    IsSeparable (Submodule.span R s : Set M) := by
  rw [span_eq_iUnion_nat]
  apply isSeparable_iUnion (fun n ↦ ?_)
  apply IsSeparable.image
  · have : IsSeparable {f : Fin n → R × M | ∀ (i : Fin n), f i ∈ Set.univ ×ˢ s} := by
      

Proof state:
R : Type u_1
M : Type u_2
inst✝⁷ : AddCommMonoid M
inst✝⁶ : Semiring R
inst✝⁵ : Module R M
inst✝⁴ : TopologicalSpace M
inst✝³ : TopologicalSpace R
inst✝² : SeparableSpace R
inst✝¹ : ContinuousAdd M
inst✝ : ContinuousSMul R M
s : Set M
hs : IsSeparable s
n : ℕ
⊢ IsSeparable {f | ∀ (i : Fin n), f i ∈ Set.univ ×ˢ s}

Next tactic:
apply isSeparable_pi (fun i ↦ (isSeparable_of_separableSpace Set.univ).prod hs)
/-- The span of a separable subset with respect to a separable scalar ring is again separable. -/
lemma TopologicalSpace.IsSeparable.span {R M : Type*} [AddCommMonoid M] [Semiring R] [Module R M]
    [TopologicalSpace M] [TopologicalSpace R] [SeparableSpace R]
    [ContinuousAdd M] [ContinuousSMul R M] {s : Set M} (hs : IsSeparable s) :
    IsSeparable (Submodule.span R s : Set M) := by
  rw [span_eq_iUnion_nat]
  apply isSeparable_iUnion (fun n ↦ ?_)
  apply IsSeparable.image
  · have : IsSeparable {f : Fin n → R × M | ∀ (i : Fin n), f i ∈ Set.univ ×ˢ s} := by
      apply isSeparable_pi (fun i ↦ (isSeparable_of_separableSpace Set.univ).prod hs)
    

Proof state:
case hs
R : Type u_1
M : Type u_2
inst✝⁷ : AddCommMonoid M
inst✝⁶ : Semiring R
inst✝⁵ : Module R M
inst✝⁴ : TopologicalSpace M
inst✝³ : TopologicalSpace R
inst✝² : SeparableSpace R
inst✝¹ : ContinuousAdd M
inst✝ : ContinuousSMul R M
s : Set M
hs : IsSeparable s
n : ℕ
this : IsSeparable {f | ∀ (i : Fin n), f i ∈ Set.univ ×ˢ s}
⊢ IsSeparable {f | ∀ (i : Fin n), (f i).2 ∈ s}

Next tactic:
convert this
/-- The span of a separable subset with respect to a separable scalar ring is again separable. -/
lemma TopologicalSpace.IsSeparable.span {R M : Type*} [AddCommMonoid M] [Semiring R] [Module R M]
    [TopologicalSpace M] [TopologicalSpace R] [SeparableSpace R]
    [ContinuousAdd M] [ContinuousSMul R M] {s : Set M} (hs : IsSeparable s) :
    IsSeparable (Submodule.span R s : Set M) := by
  rw [span_eq_iUnion_nat]
  apply isSeparable_iUnion (fun n ↦ ?_)
  apply IsSeparable.image
  · have : IsSeparable {f : Fin n → R × M | ∀ (i : Fin n), f i ∈ Set.univ ×ˢ s} := by
      apply isSeparable_pi (fun i ↦ (isSeparable_of_separableSpace Set.univ).prod hs)
    convert this
    

Proof state:
case h.e'_3.h.e'_2.h.h.a
R : Type u_1
M : Type u_2
inst✝⁷ : AddCommMonoid M
inst✝⁶ : Semiring R
inst✝⁵ : Module R M
inst✝⁴ : TopologicalSpace M
inst✝³ : TopologicalSpace R
inst✝² : SeparableSpace R
inst✝¹ : ContinuousAdd M
inst✝ : ContinuousSMul R M
s : Set M
hs : IsSeparable s
n : ℕ
this : IsSeparable {f | ∀ (i : Fin n), f i ∈ Set.univ ×ˢ s}
x✝ : Fin n → R × M
a✝ : Fin n
⊢ (x✝ a✝).2 ∈ s ↔ x✝ a✝ ∈ Set.univ ×ˢ s

Next tactic:
simp
/-- The span of a separable subset with respect to a separable scalar ring is again separable. -/
lemma TopologicalSpace.IsSeparable.span {R M : Type*} [AddCommMonoid M] [Semiring R] [Module R M]
    [TopologicalSpace M] [TopologicalSpace R] [SeparableSpace R]
    [ContinuousAdd M] [ContinuousSMul R M] {s : Set M} (hs : IsSeparable s) :
    IsSeparable (Submodule.span R s : Set M) := by
  rw [span_eq_iUnion_nat]
  apply isSeparable_iUnion (fun n ↦ ?_)
  apply IsSeparable.image
  · have : IsSeparable {f : Fin n → R × M | ∀ (i : Fin n), f i ∈ Set.univ ×ˢ s} := by
      apply isSeparable_pi (fun i ↦ (isSeparable_of_separableSpace Set.univ).prod hs)
    convert this
    simp
  · 

Proof state:
case hf
R : Type u_1
M : Type u_2
inst✝⁷ : AddCommMonoid M
inst✝⁶ : Semiring R
inst✝⁵ : Module R M
inst✝⁴ : TopologicalSpace M
inst✝³ : TopologicalSpace R
inst✝² : SeparableSpace R
inst✝¹ : ContinuousAdd M
inst✝ : ContinuousSMul R M
s : Set M
hs : IsSeparable s
n : ℕ
⊢ Continuous fun f => ∑ i : Fin n, (f i).1 • (f i).2

Next tactic:
apply continuous_finset_sum _ (fun i _ ↦ ?_)
/-- The span of a separable subset with respect to a separable scalar ring is again separable. -/
lemma TopologicalSpace.IsSeparable.span {R M : Type*} [AddCommMonoid M] [Semiring R] [Module R M]
    [TopologicalSpace M] [TopologicalSpace R] [SeparableSpace R]
    [ContinuousAdd M] [ContinuousSMul R M] {s : Set M} (hs : IsSeparable s) :
    IsSeparable (Submodule.span R s : Set M) := by
  rw [span_eq_iUnion_nat]
  apply isSeparable_iUnion (fun n ↦ ?_)
  apply IsSeparable.image
  · have : IsSeparable {f : Fin n → R × M | ∀ (i : Fin n), f i ∈ Set.univ ×ˢ s} := by
      apply isSeparable_pi (fun i ↦ (isSeparable_of_separableSpace Set.univ).prod hs)
    convert this
    simp
  · apply continuous_finset_sum _ (fun i _ ↦ ?_)
    

Proof state:
R : Type u_1
M : Type u_2
inst✝⁷ : AddCommMonoid M
inst✝⁶ : Semiring R
inst✝⁵ : Module R M
inst✝⁴ : TopologicalSpace M
inst✝³ : TopologicalSpace R
inst✝² : SeparableSpace R
inst✝¹ : ContinuousAdd M
inst✝ : ContinuousSMul R M
s : Set M
hs : IsSeparable s
n : ℕ
i : Fin n
x✝ : i ∈ Finset.univ
⊢ Continuous fun a => (a i).1 • (a i).2

Next tactic:
exact (continuous_fst.comp (continuous_apply i)).smul (continuous_snd.comp (continuous_apply i))
theorem Submodule.closure_subset_topologicalClosure_span (s : Set M) :
    closure s ⊆ (span R s).topologicalClosure := by
  

Proof state:
R R' : Type u
M M' : Type v
inst✝¹⁰ : Semiring R
inst✝⁹ : Ring R'
inst✝⁸ : TopologicalSpace M
inst✝⁷ : AddCommMonoid M
inst✝⁶ : TopologicalSpace M'
inst✝⁵ : AddCommGroup M'
inst✝⁴ : Module R M
inst✝³ : ContinuousConstSMul R M
inst✝² : Module R' M'
inst✝¹ : ContinuousConstSMul R' M'
inst✝ : ContinuousAdd M
s : Set M
⊢ closure s ⊆ ↑(topologicalClosure (span R s))

Next tactic:
rw [Submodule.topologicalClosure_coe]
theorem Submodule.closure_subset_topologicalClosure_span (s : Set M) :
    closure s ⊆ (span R s).topologicalClosure := by
  rw [Submodule.topologicalClosure_coe]
  

Proof state:
R R' : Type u
M M' : Type v
inst✝¹⁰ : Semiring R
inst✝⁹ : Ring R'
inst✝⁸ : TopologicalSpace M
inst✝⁷ : AddCommMonoid M
inst✝⁶ : TopologicalSpace M'
inst✝⁵ : AddCommGroup M'
inst✝⁴ : Module R M
inst✝³ : ContinuousConstSMul R M
inst✝² : Module R' M'
inst✝¹ : ContinuousConstSMul R' M'
inst✝ : ContinuousAdd M
s : Set M
⊢ closure s ⊆ closure ↑(span R s)

Next tactic:
exact closure_mono subset_span