l3lab/ntp-mathlib huggingface dataset:
/-- A subspace is dense iff its topological closure is the entire space. -/
theorem Submodule.dense_iff_topologicalClosure_eq_top {s : Submodule R M} :
    Dense (s : Set M) ↔ 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 : Submodule R M
⊢ Dense ↑s ↔ topologicalClosure s = ⊤

Next tactic:
rw [← SetLike.coe_set_eq, dense_iff_closure_eq]
/-- A subspace is dense iff its topological closure is the entire space. -/
theorem Submodule.dense_iff_topologicalClosure_eq_top {s : Submodule R M} :
    Dense (s : Set M) ↔ s.topologicalClosure = ⊤ := by
  rw [← SetLike.coe_set_eq, dense_iff_closure_eq]
  

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 : Submodule R M
⊢ closure ↑s = Set.univ ↔ ↑(topologicalClosure s) = ↑⊤

Next tactic:
simp
/-- A maximal proper subspace of a topological module (i.e a `Submodule` satisfying `IsCoatom`)
is either closed or dense. -/
theorem Submodule.isClosed_or_dense_of_isCoatom (s : Submodule R M) (hs : IsCoatom s) :
    IsClosed (s : Set M) ∨ Dense (s : Set M) := 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 : Submodule R M
hs : IsCoatom s
⊢ IsClosed ↑s ∨ Dense ↑s

Next tactic:
refine (hs.le_iff.mp s.le_topologicalClosure).symm.imp ?_ dense_iff_topologicalClosure_eq_top.mpr
/-- A maximal proper subspace of a topological module (i.e a `Submodule` satisfying `IsCoatom`)
is either closed or dense. -/
theorem Submodule.isClosed_or_dense_of_isCoatom (s : Submodule R M) (hs : IsCoatom s) :
    IsClosed (s : Set M) ∨ Dense (s : Set M) := by
  refine (hs.le_iff.mp s.le_topologicalClosure).symm.imp ?_ dense_iff_topologicalClosure_eq_top.mpr
  

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 : Submodule R M
hs : IsCoatom s
⊢ topologicalClosure s = s → IsClosed ↑s

Next tactic:
exact fun h ↦ h ▸ isClosed_closure
theorem LinearMap.continuous_on_pi {ι : Type*} {R : Type*} {M : Type*} [Finite ι] [Semiring R]
    [TopologicalSpace R] [AddCommMonoid M] [Module R M] [TopologicalSpace M] [ContinuousAdd M]
    [ContinuousSMul R M] (f : (ι → R) →ₗ[R] M) : Continuous f := by
  

Proof state:
ι : Type u_1
R : Type u_2
M : Type u_3
inst✝⁷ : Finite ι
inst✝⁶ : Semiring R
inst✝⁵ : TopologicalSpace R
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : TopologicalSpace M
inst✝¹ : ContinuousAdd M
inst✝ : ContinuousSMul R M
f : (ι → R) →ₗ[R] M
⊢ Continuous ⇑f

Next tactic:
cases nonempty_fintype ι
theorem LinearMap.continuous_on_pi {ι : Type*} {R : Type*} {M : Type*} [Finite ι] [Semiring R]
    [TopologicalSpace R] [AddCommMonoid M] [Module R M] [TopologicalSpace M] [ContinuousAdd M]
    [ContinuousSMul R M] (f : (ι → R) →ₗ[R] M) : Continuous f := by
  cases nonempty_fintype ι
  

Proof state:
case intro
ι : Type u_1
R : Type u_2
M : Type u_3
inst✝⁷ : Finite ι
inst✝⁶ : Semiring R
inst✝⁵ : TopologicalSpace R
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : TopologicalSpace M
inst✝¹ : ContinuousAdd M
inst✝ : ContinuousSMul R M
f : (ι → R) →ₗ[R] M
val✝ : Fintype ι
⊢ Continuous ⇑f

Next tactic:
classical
    -- for the proof, write `f` in the standard basis, and use that each coordinate is a continuous
    -- function.
    have : (f : (ι → R) → M) = fun x => ∑ i : ι, x i • f fun j => if i = j then 1 else 0 := by
      ext x
      exact f.pi_apply_eq_sum_univ x
    rw [this]
    refine continuous_finset_sum _ fun i _ => ?_
    exact (continuous_apply i).smul continuous_const
theorem LinearMap.continuous_on_pi {ι : Type*} {R : Type*} {M : Type*} [Finite ι] [Semiring R]
    [TopologicalSpace R] [AddCommMonoid M] [Module R M] [TopologicalSpace M] [ContinuousAdd M]
    [ContinuousSMul R M] (f : (ι → R) →ₗ[R] M) : Continuous f := by
  cases nonempty_fintype ι
  classical
    -- for the proof, write `f` in the standard basis, and use that each coordinate is a continuous
    -- function.
    

Proof state:
case intro
ι : Type u_1
R : Type u_2
M : Type u_3
inst✝⁷ : Finite ι
inst✝⁶ : Semiring R
inst✝⁵ : TopologicalSpace R
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : TopologicalSpace M
inst✝¹ : ContinuousAdd M
inst✝ : ContinuousSMul R M
f : (ι → R) →ₗ[R] M
val✝ : Fintype ι
⊢ Continuous ⇑f

Next tactic:
have : (f : (ι → R) → M) = fun x => ∑ i : ι, x i • f fun j => if i = j then 1 else 0 := by
      ext x
      exact f.pi_apply_eq_sum_univ x
theorem LinearMap.continuous_on_pi {ι : Type*} {R : Type*} {M : Type*} [Finite ι] [Semiring R]
    [TopologicalSpace R] [AddCommMonoid M] [Module R M] [TopologicalSpace M] [ContinuousAdd M]
    [ContinuousSMul R M] (f : (ι → R) →ₗ[R] M) : Continuous f := by
  cases nonempty_fintype ι
  classical
    -- for the proof, write `f` in the standard basis, and use that each coordinate is a continuous
    -- function.
    have : (f : (ι → R) → M) = fun x => ∑ i : ι, x i • f fun j => if i = j then 1 else 0 := by
      

Proof state:
ι : Type u_1
R : Type u_2
M : Type u_3
inst✝⁷ : Finite ι
inst✝⁶ : Semiring R
inst✝⁵ : TopologicalSpace R
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : TopologicalSpace M
inst✝¹ : ContinuousAdd M
inst✝ : ContinuousSMul R M
f : (ι → R) →ₗ[R] M
val✝ : Fintype ι
⊢ ⇑f = fun x => ∑ i : ι, x i • f fun j => if i = j then 1 else 0

Next tactic:
ext x
theorem LinearMap.continuous_on_pi {ι : Type*} {R : Type*} {M : Type*} [Finite ι] [Semiring R]
    [TopologicalSpace R] [AddCommMonoid M] [Module R M] [TopologicalSpace M] [ContinuousAdd M]
    [ContinuousSMul R M] (f : (ι → R) →ₗ[R] M) : Continuous f := by
  cases nonempty_fintype ι
  classical
    -- for the proof, write `f` in the standard basis, and use that each coordinate is a continuous
    -- function.
    have : (f : (ι → R) → M) = fun x => ∑ i : ι, x i • f fun j => if i = j then 1 else 0 := by
      ext x
      

Proof state:
case h
ι : Type u_1
R : Type u_2
M : Type u_3
inst✝⁷ : Finite ι
inst✝⁶ : Semiring R
inst✝⁵ : TopologicalSpace R
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : TopologicalSpace M
inst✝¹ : ContinuousAdd M
inst✝ : ContinuousSMul R M
f : (ι → R) →ₗ[R] M
val✝ : Fintype ι
x : ι → R
⊢ f x = ∑ i : ι, x i • f fun j => if i = j then 1 else 0

Next tactic:
exact f.pi_apply_eq_sum_univ x
theorem LinearMap.continuous_on_pi {ι : Type*} {R : Type*} {M : Type*} [Finite ι] [Semiring R]
    [TopologicalSpace R] [AddCommMonoid M] [Module R M] [TopologicalSpace M] [ContinuousAdd M]
    [ContinuousSMul R M] (f : (ι → R) →ₗ[R] M) : Continuous f := by
  cases nonempty_fintype ι
  classical
    -- for the proof, write `f` in the standard basis, and use that each coordinate is a continuous
    -- function.
    have : (f : (ι → R) → M) = fun x => ∑ i : ι, x i • f fun j => if i = j then 1 else 0 := by
      ext x
      exact f.pi_apply_eq_sum_univ x
    

Proof state:
case intro
ι : Type u_1
R : Type u_2
M : Type u_3
inst✝⁷ : Finite ι
inst✝⁶ : Semiring R
inst✝⁵ : TopologicalSpace R
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : TopologicalSpace M
inst✝¹ : ContinuousAdd M
inst✝ : ContinuousSMul R M
f : (ι → R) →ₗ[R] M
val✝ : Fintype ι
this : ⇑f = fun x => ∑ i : ι, x i • f fun j => if i = j then 1 else 0
⊢ Continuous ⇑f

Next tactic:
rw [this]
theorem LinearMap.continuous_on_pi {ι : Type*} {R : Type*} {M : Type*} [Finite ι] [Semiring R]
    [TopologicalSpace R] [AddCommMonoid M] [Module R M] [TopologicalSpace M] [ContinuousAdd M]
    [ContinuousSMul R M] (f : (ι → R) →ₗ[R] M) : Continuous f := by
  cases nonempty_fintype ι
  classical
    -- for the proof, write `f` in the standard basis, and use that each coordinate is a continuous
    -- function.
    have : (f : (ι → R) → M) = fun x => ∑ i : ι, x i • f fun j => if i = j then 1 else 0 := by
      ext x
      exact f.pi_apply_eq_sum_univ x
    rw [this]
    

Proof state:
case intro
ι : Type u_1
R : Type u_2
M : Type u_3
inst✝⁷ : Finite ι
inst✝⁶ : Semiring R
inst✝⁵ : TopologicalSpace R
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : TopologicalSpace M
inst✝¹ : ContinuousAdd M
inst✝ : ContinuousSMul R M
f : (ι → R) →ₗ[R] M
val✝ : Fintype ι
this : ⇑f = fun x => ∑ i : ι, x i • f fun j => if i = j then 1 else 0
⊢ Continuous fun x => ∑ i : ι, x i • f fun j => if i = j then 1 else 0

Next tactic:
refine continuous_finset_sum _ fun i _ => ?_
theorem LinearMap.continuous_on_pi {ι : Type*} {R : Type*} {M : Type*} [Finite ι] [Semiring R]
    [TopologicalSpace R] [AddCommMonoid M] [Module R M] [TopologicalSpace M] [ContinuousAdd M]
    [ContinuousSMul R M] (f : (ι → R) →ₗ[R] M) : Continuous f := by
  cases nonempty_fintype ι
  classical
    -- for the proof, write `f` in the standard basis, and use that each coordinate is a continuous
    -- function.
    have : (f : (ι → R) → M) = fun x => ∑ i : ι, x i • f fun j => if i = j then 1 else 0 := by
      ext x
      exact f.pi_apply_eq_sum_univ x
    rw [this]
    refine continuous_finset_sum _ fun i _ => ?_
    

Proof state:
case intro
ι : Type u_1
R : Type u_2
M : Type u_3
inst✝⁷ : Finite ι
inst✝⁶ : Semiring R
inst✝⁵ : TopologicalSpace R
inst✝⁴ : AddCommMonoid M
inst✝³ : Module R M
inst✝² : TopologicalSpace M
inst✝¹ : ContinuousAdd M
inst✝ : ContinuousSMul R M
f : (ι → R) →ₗ[R] M
val✝ : Fintype ι
this : ⇑f = fun x => ∑ i : ι, x i • f fun j => if i = j then 1 else 0
i : ι
x✝ : i ∈ Finset.univ
⊢ Continuous fun x => x i • f fun j => if i = j then 1 else 0

Next tactic:
exact (continuous_apply i).smul continuous_const
theorem coe_injective : Function.Injective ((↑) : (M₁ →SL[σ₁₂] M₂) → M₁ →ₛₗ[σ₁₂] M₂) := by
  

Proof state:
R₁ : Type u_1
R₂ : Type u_2
R₃ : Type u_3
inst✝¹⁶ : Semiring R₁
inst✝¹⁵ : Semiring R₂
inst✝¹⁴ : Semiring R₃
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
M₁ : Type u_4
inst✝¹³ : TopologicalSpace M₁
inst✝¹² : AddCommMonoid M₁
M'₁ : Type u_5
inst✝¹¹ : TopologicalSpace M'₁
inst✝¹⁰ : AddCommMonoid M'₁
M₂ : Type u_6
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommMonoid M₂
M₃ : Type u_7
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommMonoid M₃
M₄ : Type u_8
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommMonoid M₄
inst✝³ : Module R₁ M₁
inst✝² : Module R₁ M'₁
inst✝¹ : Module R₂ M₂
inst✝ : Module R₃ M₃
⊢ Function.Injective toLinearMap

Next tactic:
intro f g H
theorem coe_injective : Function.Injective ((↑) : (M₁ →SL[σ₁₂] M₂) → M₁ →ₛₗ[σ₁₂] M₂) := by
  intro f g H
  

Proof state:
R₁ : Type u_1
R₂ : Type u_2
R₃ : Type u_3
inst✝¹⁶ : Semiring R₁
inst✝¹⁵ : Semiring R₂
inst✝¹⁴ : Semiring R₃
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
M₁ : Type u_4
inst✝¹³ : TopologicalSpace M₁
inst✝¹² : AddCommMonoid M₁
M'₁ : Type u_5
inst✝¹¹ : TopologicalSpace M'₁
inst✝¹⁰ : AddCommMonoid M'₁
M₂ : Type u_6
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommMonoid M₂
M₃ : Type u_7
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommMonoid M₃
M₄ : Type u_8
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommMonoid M₄
inst✝³ : Module R₁ M₁
inst✝² : Module R₁ M'₁
inst✝¹ : Module R₂ M₂
inst✝ : Module R₃ M₃
f g : M₁ →SL[σ₁₂] M₂
H : ↑f = ↑g
⊢ f = g

Next tactic:
cases f
theorem coe_injective : Function.Injective ((↑) : (M₁ →SL[σ₁₂] M₂) → M₁ →ₛₗ[σ₁₂] M₂) := by
  intro f g H
  cases f
  

Proof state:
case mk
R₁ : Type u_1
R₂ : Type u_2
R₃ : Type u_3
inst✝¹⁶ : Semiring R₁
inst✝¹⁵ : Semiring R₂
inst✝¹⁴ : Semiring R₃
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
M₁ : Type u_4
inst✝¹³ : TopologicalSpace M₁
inst✝¹² : AddCommMonoid M₁
M'₁ : Type u_5
inst✝¹¹ : TopologicalSpace M'₁
inst✝¹⁰ : AddCommMonoid M'₁
M₂ : Type u_6
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommMonoid M₂
M₃ : Type u_7
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommMonoid M₃
M₄ : Type u_8
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommMonoid M₄
inst✝³ : Module R₁ M₁
inst✝² : Module R₁ M'₁
inst✝¹ : Module R₂ M₂
inst✝ : Module R₃ M₃
g : M₁ →SL[σ₁₂] M₂
toLinearMap✝ : M₁ →ₛₗ[σ₁₂] M₂
cont✝ : Continuous toLinearMap✝.toFun
H : ↑(mk toLinearMap✝) = ↑g
⊢ mk toLinearMap✝ = g

Next tactic:
cases g
theorem coe_injective : Function.Injective ((↑) : (M₁ →SL[σ₁₂] M₂) → M₁ →ₛₗ[σ₁₂] M₂) := by
  intro f g H
  cases f
  cases g
  

Proof state:
case mk.mk
R₁ : Type u_1
R₂ : Type u_2
R₃ : Type u_3
inst✝¹⁶ : Semiring R₁
inst✝¹⁵ : Semiring R₂
inst✝¹⁴ : Semiring R₃
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
M₁ : Type u_4
inst✝¹³ : TopologicalSpace M₁
inst✝¹² : AddCommMonoid M₁
M'₁ : Type u_5
inst✝¹¹ : TopologicalSpace M'₁
inst✝¹⁰ : AddCommMonoid M'₁
M₂ : Type u_6
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommMonoid M₂
M₃ : Type u_7
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommMonoid M₃
M₄ : Type u_8
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommMonoid M₄
inst✝³ : Module R₁ M₁
inst✝² : Module R₁ M'₁
inst✝¹ : Module R₂ M₂
inst✝ : Module R₃ M₃
toLinearMap✝¹ : M₁ →ₛₗ[σ₁₂] M₂
cont✝¹ : Continuous toLinearMap✝¹.toFun
toLinearMap✝ : M₁ →ₛₗ[σ₁₂] M₂
cont✝ : Continuous toLinearMap✝.toFun
H : ↑(mk toLinearMap✝¹) = ↑(mk toLinearMap✝)
⊢ mk toLinearMap✝¹ = mk toLinearMap✝

Next tactic:
congr
protected theorem map_smul [Module R₁ M₂] (f : M₁ →L[R₁] M₂) (c : R₁) (x : M₁) :
    f (c • x) = c • f x := by 

Proof state:
R₁ : Type u_1
R₂ : Type u_2
R₃ : Type u_3
inst✝¹⁷ : Semiring R₁
inst✝¹⁶ : Semiring R₂
inst✝¹⁵ : Semiring R₃
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
M₁ : Type u_4
inst✝¹⁴ : TopologicalSpace M₁
inst✝¹³ : AddCommMonoid M₁
M'₁ : Type u_5
inst✝¹² : TopologicalSpace M'₁
inst✝¹¹ : AddCommMonoid M'₁
M₂ : Type u_6
inst✝¹⁰ : TopologicalSpace M₂
inst✝⁹ : AddCommMonoid M₂
M₃ : Type u_7
inst✝⁸ : TopologicalSpace M₃
inst✝⁷ : AddCommMonoid M₃
M₄ : Type u_8
inst✝⁶ : TopologicalSpace M₄
inst✝⁵ : AddCommMonoid M₄
inst✝⁴ : Module R₁ M₁
inst✝³ : Module R₁ M'₁
inst✝² : Module R₂ M₂
inst✝¹ : Module R₃ M₃
inst✝ : Module R₁ M₂
f : M₁ →L[R₁] M₂
c : R₁
x : M₁
⊢ f (c • x) = c • f x

Next tactic:
simp only [RingHom.id_apply, ContinuousLinearMap.map_smulₛₗ]
/-- Under a dense continuous linear map, a submodule whose `TopologicalClosure` is `⊤` is sent to
another such submodule.  That is, the image of a dense set under a map with dense range is dense.
-/
theorem _root_.DenseRange.topologicalClosure_map_submodule [RingHomSurjective σ₁₂]
    [TopologicalSpace R₁] [TopologicalSpace R₂] [ContinuousSMul R₁ M₁] [ContinuousAdd M₁]
    [ContinuousSMul R₂ M₂] [ContinuousAdd M₂] {f : M₁ →SL[σ₁₂] M₂} (hf' : DenseRange f)
    {s : Submodule R₁ M₁} (hs : s.topologicalClosure = ⊤) :
    (s.map (f : M₁ →ₛₗ[σ₁₂] M₂)).topologicalClosure = ⊤ := by
  

Proof state:
R₁ : Type u_1
R₂ : Type u_2
R₃ : Type u_3
inst✝²³ : Semiring R₁
inst✝²² : Semiring R₂
inst✝²¹ : Semiring R₃
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
M₁ : Type u_4
inst✝²⁰ : TopologicalSpace M₁
inst✝¹⁹ : AddCommMonoid M₁
M'₁ : Type u_5
inst✝¹⁸ : TopologicalSpace M'₁
inst✝¹⁷ : AddCommMonoid M'₁
M₂ : Type u_6
inst✝¹⁶ : TopologicalSpace M₂
inst✝¹⁵ : AddCommMonoid M₂
M₃ : Type u_7
inst✝¹⁴ : TopologicalSpace M₃
inst✝¹³ : AddCommMonoid M₃
M₄ : Type u_8
inst✝¹² : TopologicalSpace M₄
inst✝¹¹ : AddCommMonoid M₄
inst✝¹⁰ : Module R₁ M₁
inst✝⁹ : Module R₁ M'₁
inst✝⁸ : Module R₂ M₂
inst✝⁷ : Module R₃ M₃
inst✝⁶ : RingHomSurjective σ₁₂
inst✝⁵ : TopologicalSpace R₁
inst✝⁴ : TopologicalSpace R₂
inst✝³ : ContinuousSMul R₁ M₁
inst✝² : ContinuousAdd M₁
inst✝¹ : ContinuousSMul R₂ M₂
inst✝ : ContinuousAdd M₂
f : M₁ →SL[σ₁₂] M₂
hf' : DenseRange ⇑f
s : Submodule R₁ M₁
hs : Submodule.topologicalClosure s = ⊤
⊢ Submodule.topologicalClosure (Submodule.map (↑f) s) = ⊤

Next tactic:
rw [SetLike.ext'_iff] at hs ⊢
/-- Under a dense continuous linear map, a submodule whose `TopologicalClosure` is `⊤` is sent to
another such submodule.  That is, the image of a dense set under a map with dense range is dense.
-/
theorem _root_.DenseRange.topologicalClosure_map_submodule [RingHomSurjective σ₁₂]
    [TopologicalSpace R₁] [TopologicalSpace R₂] [ContinuousSMul R₁ M₁] [ContinuousAdd M₁]
    [ContinuousSMul R₂ M₂] [ContinuousAdd M₂] {f : M₁ →SL[σ₁₂] M₂} (hf' : DenseRange f)
    {s : Submodule R₁ M₁} (hs : s.topologicalClosure = ⊤) :
    (s.map (f : M₁ →ₛₗ[σ₁₂] M₂)).topologicalClosure = ⊤ := by
  rw [SetLike.ext'_iff] at hs ⊢
  

Proof state:
R₁ : Type u_1
R₂ : Type u_2
R₃ : Type u_3
inst✝²³ : Semiring R₁
inst✝²² : Semiring R₂
inst✝²¹ : Semiring R₃
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
M₁ : Type u_4
inst✝²⁰ : TopologicalSpace M₁
inst✝¹⁹ : AddCommMonoid M₁
M'₁ : Type u_5
inst✝¹⁸ : TopologicalSpace M'₁
inst✝¹⁷ : AddCommMonoid M'₁
M₂ : Type u_6
inst✝¹⁶ : TopologicalSpace M₂
inst✝¹⁵ : AddCommMonoid M₂
M₃ : Type u_7
inst✝¹⁴ : TopologicalSpace M₃
inst✝¹³ : AddCommMonoid M₃
M₄ : Type u_8
inst✝¹² : TopologicalSpace M₄
inst✝¹¹ : AddCommMonoid M₄
inst✝¹⁰ : Module R₁ M₁
inst✝⁹ : Module R₁ M'₁
inst✝⁸ : Module R₂ M₂
inst✝⁷ : Module R₃ M₃
inst✝⁶ : RingHomSurjective σ₁₂
inst✝⁵ : TopologicalSpace R₁
inst✝⁴ : TopologicalSpace R₂
inst✝³ : ContinuousSMul R₁ M₁
inst✝² : ContinuousAdd M₁
inst✝¹ : ContinuousSMul R₂ M₂
inst✝ : ContinuousAdd M₂
f : M₁ →SL[σ₁₂] M₂
hf' : DenseRange ⇑f
s : Submodule R₁ M₁
hs : ↑(Submodule.topologicalClosure s) = ↑⊤
⊢ ↑(Submodule.topologicalClosure (Submodule.map (↑f) s)) = ↑⊤

Next tactic:
simp only [Submodule.topologicalClosure_coe, Submodule.top_coe, ← dense_iff_closure_eq] at hs ⊢
/-- Under a dense continuous linear map, a submodule whose `TopologicalClosure` is `⊤` is sent to
another such submodule.  That is, the image of a dense set under a map with dense range is dense.
-/
theorem _root_.DenseRange.topologicalClosure_map_submodule [RingHomSurjective σ₁₂]
    [TopologicalSpace R₁] [TopologicalSpace R₂] [ContinuousSMul R₁ M₁] [ContinuousAdd M₁]
    [ContinuousSMul R₂ M₂] [ContinuousAdd M₂] {f : M₁ →SL[σ₁₂] M₂} (hf' : DenseRange f)
    {s : Submodule R₁ M₁} (hs : s.topologicalClosure = ⊤) :
    (s.map (f : M₁ →ₛₗ[σ₁₂] M₂)).topologicalClosure = ⊤ := by
  rw [SetLike.ext'_iff] at hs ⊢
  simp only [Submodule.topologicalClosure_coe, Submodule.top_coe, ← dense_iff_closure_eq] at hs ⊢
  

Proof state:
R₁ : Type u_1
R₂ : Type u_2
R₃ : Type u_3
inst✝²³ : Semiring R₁
inst✝²² : Semiring R₂
inst✝²¹ : Semiring R₃
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
M₁ : Type u_4
inst✝²⁰ : TopologicalSpace M₁
inst✝¹⁹ : AddCommMonoid M₁
M'₁ : Type u_5
inst✝¹⁸ : TopologicalSpace M'₁
inst✝¹⁷ : AddCommMonoid M'₁
M₂ : Type u_6
inst✝¹⁶ : TopologicalSpace M₂
inst✝¹⁵ : AddCommMonoid M₂
M₃ : Type u_7
inst✝¹⁴ : TopologicalSpace M₃
inst✝¹³ : AddCommMonoid M₃
M₄ : Type u_8
inst✝¹² : TopologicalSpace M₄
inst✝¹¹ : AddCommMonoid M₄
inst✝¹⁰ : Module R₁ M₁
inst✝⁹ : Module R₁ M'₁
inst✝⁸ : Module R₂ M₂
inst✝⁷ : Module R₃ M₃
inst✝⁶ : RingHomSurjective σ₁₂
inst✝⁵ : TopologicalSpace R₁
inst✝⁴ : TopologicalSpace R₂
inst✝³ : ContinuousSMul R₁ M₁
inst✝² : ContinuousAdd M₁
inst✝¹ : ContinuousSMul R₂ M₂
inst✝ : ContinuousAdd M₂
f : M₁ →SL[σ₁₂] M₂
hf' : DenseRange ⇑f
s : Submodule R₁ M₁
hs : Dense ↑s
⊢ Dense ↑(Submodule.map (↑f) s)

Next tactic:
exact hf'.dense_image f.continuous hs
theorem exists_ne_zero {f : M₁ →SL[σ₁₂] M₂} (hf : f ≠ 0) : ∃ x, f x ≠ 0 := by
  

Proof state:
R₁ : Type u_1
R₂ : Type u_2
R₃ : Type u_3
inst✝¹⁶ : Semiring R₁
inst✝¹⁵ : Semiring R₂
inst✝¹⁴ : Semiring R₃
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
M₁ : Type u_4
inst✝¹³ : TopologicalSpace M₁
inst✝¹² : AddCommMonoid M₁
M'₁ : Type u_5
inst✝¹¹ : TopologicalSpace M'₁
inst✝¹⁰ : AddCommMonoid M'₁
M₂ : Type u_6
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommMonoid M₂
M₃ : Type u_7
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommMonoid M₃
M₄ : Type u_8
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommMonoid M₄
inst✝³ : Module R₁ M₁
inst✝² : Module R₁ M'₁
inst✝¹ : Module R₂ M₂
inst✝ : Module R₃ M₃
f : M₁ →SL[σ₁₂] M₂
hf : f ≠ 0
⊢ ∃ x, f x ≠ 0

Next tactic:
by_contra! h
theorem exists_ne_zero {f : M₁ →SL[σ₁₂] M₂} (hf : f ≠ 0) : ∃ x, f x ≠ 0 := by
  by_contra! h
  

Proof state:
R₁ : Type u_1
R₂ : Type u_2
R₃ : Type u_3
inst✝¹⁶ : Semiring R₁
inst✝¹⁵ : Semiring R₂
inst✝¹⁴ : Semiring R₃
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
M₁ : Type u_4
inst✝¹³ : TopologicalSpace M₁
inst✝¹² : AddCommMonoid M₁
M'₁ : Type u_5
inst✝¹¹ : TopologicalSpace M'₁
inst✝¹⁰ : AddCommMonoid M'₁
M₂ : Type u_6
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommMonoid M₂
M₃ : Type u_7
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommMonoid M₃
M₄ : Type u_8
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommMonoid M₄
inst✝³ : Module R₁ M₁
inst✝² : Module R₁ M'₁
inst✝¹ : Module R₂ M₂
inst✝ : Module R₃ M₃
f : M₁ →SL[σ₁₂] M₂
hf : f ≠ 0
h : ∀ (x : M₁), f x = 0
⊢ False

Next tactic:
exact hf (ContinuousLinearMap.ext h)
@[simp, norm_cast]
theorem coe_eq_id {f : M₁ →L[R₁] M₁} : (f : M₁ →ₗ[R₁] M₁) = LinearMap.id ↔ f = id _ _ := by
  

Proof state:
R₁ : Type u_1
R₂ : Type u_2
R₃ : Type u_3
inst✝¹⁶ : Semiring R₁
inst✝¹⁵ : Semiring R₂
inst✝¹⁴ : Semiring R₃
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
M₁ : Type u_4
inst✝¹³ : TopologicalSpace M₁
inst✝¹² : AddCommMonoid M₁
M'₁ : Type u_5
inst✝¹¹ : TopologicalSpace M'₁
inst✝¹⁰ : AddCommMonoid M'₁
M₂ : Type u_6
inst✝⁹ : TopologicalSpace M₂
inst✝⁸ : AddCommMonoid M₂
M₃ : Type u_7
inst✝⁷ : TopologicalSpace M₃
inst✝⁶ : AddCommMonoid M₃
M₄ : Type u_8
inst✝⁵ : TopologicalSpace M₄
inst✝⁴ : AddCommMonoid M₄
inst✝³ : Module R₁ M₁
inst✝² : Module R₁ M'₁
inst✝¹ : Module R₂ M₂
inst✝ : Module R₃ M₃
f : M₁ →L[R₁] M₁
⊢ ↑f = LinearMap.id ↔ f = id R₁ M₁

Next tactic:
rw [← coe_id, coe_inj]
instance [Nontrivial M₁] : Nontrivial (M₁ →L[R₁] M₁) :=
  ⟨0, 1, fun e ↦ have ⟨x, hx⟩ := exists_ne (0 : M₁); hx (by 

Proof state:
R₁ : Type u_1
R₂ : Type u_2
R₃ : Type u_3
inst✝¹⁷ : Semiring R₁
inst✝¹⁶ : Semiring R₂
inst✝¹⁵ : Semiring R₃
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
M₁ : Type u_4
inst✝¹⁴ : TopologicalSpace M₁
inst✝¹³ : AddCommMonoid M₁
M'₁ : Type u_5
inst✝¹² : TopologicalSpace M'₁
inst✝¹¹ : AddCommMonoid M'₁
M₂ : Type u_6
inst✝¹⁰ : TopologicalSpace M₂
inst✝⁹ : AddCommMonoid M₂
M₃ : Type u_7
inst✝⁸ : TopologicalSpace M₃
inst✝⁷ : AddCommMonoid M₃
M₄ : Type u_8
inst✝⁶ : TopologicalSpace M₄
inst✝⁵ : AddCommMonoid M₄
inst✝⁴ : Module R₁ M₁
inst✝³ : Module R₁ M'₁
inst✝² : Module R₂ M₂
inst✝¹ : Module R₃ M₃
inst✝ : Nontrivial M₁
e : 0 = 1
x : M₁
hx : x ≠ 0
⊢ x = 0

Next tactic:
simpa using FunLike.congr_fun e.symm x
instance addCommMonoid : AddCommMonoid (M₁ →SL[σ₁₂] M₂) where
  zero := (0 : M₁ →SL[σ₁₂] M₂)
  add := (· + ·)
  zero_add := by
    intros
    ext
    apply_rules [zero_add, add_assoc, add_zero, add_left_neg, add_comm]
  add_zero := by
    intros
    ext
    apply_rules [zero_add, add_assoc, add_zero, add_left_neg, add_comm]
  add_comm := by
    intros
    ext
    apply_rules [zero_add, add_assoc, add_zero, add_left_neg, add_comm]
  add_assoc := by
    

Proof state:
R₁ : Type u_1
R₂ : Type u_2
R₃ : Type u_3
inst✝¹⁷ : Semiring R₁
inst✝¹⁶ : Semiring R₂
inst✝¹⁵ : Semiring R₃
σ₁₂ : R₁ →+* R₂
σ₂₃ : R₂ →+* R₃
σ₁₃ : R₁ →+* R₃
M₁ : Type u_4
inst✝¹⁴ : TopologicalSpace M₁
inst✝¹³ : AddCommMonoid M₁
M'₁ : Type u_5
inst✝¹² : TopologicalSpace M'₁
inst✝¹¹ : AddCommMonoid M'₁
M₂ : Type u_6
inst✝¹⁰ : TopologicalSpace M₂
inst✝⁹ : AddCommMonoid M₂
M₃ : Type u_7
inst✝⁸ : TopologicalSpace M₃
inst✝⁷ : AddCommMonoid M₃
M₄ : Type u_8
inst✝⁶ : TopologicalSpace M₄
inst✝⁵ : AddCommMonoid M₄
inst✝⁴ : Module R₁ M₁
inst✝³ : Module R₁ M'₁
inst✝² : Module R₂ M₂
inst✝¹ : Module R₃ M₃
inst✝ : ContinuousAdd M₂
⊢ ∀ (a b c : M₁ →SL[σ₁₂] M₂), a + b + c = a + (b + c)

Next tactic:
intros