l3lab/ntp-mathlib huggingface dataset:
/-- Precomposition of functions into a normed ring by a continuous map is an algebra homomorphism.
-/
@[simps]
def ContinuousMap.compRightAlgHom {α β : Type*} [TopologicalSpace α] [TopologicalSpace β]
    (f : C(α, β)) : C(β, A) →ₐ[R] C(α, A) where
  toFun g := g.comp f
  map_zero' := by
    ext
    rfl
  map_add' g₁ g₂ := by
    ext
    

Proof state:
case h
α✝ : Type u_1
inst✝¹¹ : TopologicalSpace α✝
R : Type u_2
inst✝¹⁰ : CommSemiring R
A : Type u_3
inst✝⁹ : TopologicalSpace A
inst✝⁸ : Semiring A
inst✝⁷ : Algebra R A
inst✝⁶ : TopologicalSemiring A
A₂ : Type u_4
inst✝⁵ : TopologicalSpace A₂
inst✝⁴ : Semiring A₂
inst✝³ : Algebra R A₂
inst✝² : TopologicalSemiring A₂
α : Type u_5
β : Type u_6
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
f : C(α, β)
g₁ g₂ : C(β, A)
a✝ : α
⊢ (OneHom.toFun
        (↑{ toOneHom := { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (g₁ g₂ : C(β, A)),
                  OneHom.toFun { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) } (g₁ * g₂) =
                    OneHom.toFun { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) } g₁ *
                      OneHom.toFun { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) } g₂) })
        (g₁ + g₂))
      a✝ =
    (OneHom.toFun
          (↑{ toOneHom := { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) },
              map_mul' :=
                (_ :
                  ∀ (g₁ g₂ : C(β, A)),
                    OneHom.toFun { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) } (g₁ * g₂) =
                      OneHom.toFun { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) } g₁ *
                        OneHom.toFun { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) } g₂) })
          g₁ +
        OneHom.toFun
          (↑{ toOneHom := { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) },
              map_mul' :=
                (_ :
                  ∀ (g₁ g₂ : C(β, A)),
                    OneHom.toFun { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) } (g₁ * g₂) =
                      OneHom.toFun { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) } g₁ *
                        OneHom.toFun { toFun := fun g => comp g f, map_one' := (_ : (fun g => comp g f) 1 = 1) } g₂) })
          g₂)
      a✝

Next tactic:
rfl
theorem Subalgebra.separatesPoints_monotone :
    Monotone fun s : Subalgebra R C(α, A) => s.SeparatesPoints := fun s s' r h x y n => by
  

Proof state:
α : Type u_1
inst✝⁹ : TopologicalSpace α
R : Type u_2
inst✝⁸ : CommSemiring R
A : Type u_3
inst✝⁷ : TopologicalSpace A
inst✝⁶ : Semiring A
inst✝⁵ : Algebra R A
inst✝⁴ : TopologicalSemiring A
A₂ : Type u_4
inst✝³ : TopologicalSpace A₂
inst✝² : Semiring A₂
inst✝¹ : Algebra R A₂
inst✝ : TopologicalSemiring A₂
s s' : Subalgebra R C(α, A)
r : s ≤ s'
h : (fun s => SeparatesPoints s) s
x y : α
n : x ≠ y
⊢ ∃ f ∈ (fun f => ⇑f) '' ↑s', f x ≠ f y

Next tactic:
obtain ⟨f, m, w⟩ := h n
theorem Subalgebra.separatesPoints_monotone :
    Monotone fun s : Subalgebra R C(α, A) => s.SeparatesPoints := fun s s' r h x y n => by
  obtain ⟨f, m, w⟩ := h n
  

Proof state:
case intro.intro
α : Type u_1
inst✝⁹ : TopologicalSpace α
R : Type u_2
inst✝⁸ : CommSemiring R
A : Type u_3
inst✝⁷ : TopologicalSpace A
inst✝⁶ : Semiring A
inst✝⁵ : Algebra R A
inst✝⁴ : TopologicalSemiring A
A₂ : Type u_4
inst✝³ : TopologicalSpace A₂
inst✝² : Semiring A₂
inst✝¹ : Algebra R A₂
inst✝ : TopologicalSemiring A₂
s s' : Subalgebra R C(α, A)
r : s ≤ s'
h : (fun s => SeparatesPoints s) s
x y : α
n : x ≠ y
f : α → A
m : f ∈ (fun f => ⇑f) '' ↑s
w : f x ≠ f y
⊢ ∃ f ∈ (fun f => ⇑f) '' ↑s', f x ≠ f y

Next tactic:
rcases m with ⟨f, ⟨m, rfl⟩⟩
theorem Subalgebra.separatesPoints_monotone :
    Monotone fun s : Subalgebra R C(α, A) => s.SeparatesPoints := fun s s' r h x y n => by
  obtain ⟨f, m, w⟩ := h n
  rcases m with ⟨f, ⟨m, rfl⟩⟩
  

Proof state:
case intro.intro.intro.intro
α : Type u_1
inst✝⁹ : TopologicalSpace α
R : Type u_2
inst✝⁸ : CommSemiring R
A : Type u_3
inst✝⁷ : TopologicalSpace A
inst✝⁶ : Semiring A
inst✝⁵ : Algebra R A
inst✝⁴ : TopologicalSemiring A
A₂ : Type u_4
inst✝³ : TopologicalSpace A₂
inst✝² : Semiring A₂
inst✝¹ : Algebra R A₂
inst✝ : TopologicalSemiring A₂
s s' : Subalgebra R C(α, A)
r : s ≤ s'
h : (fun s => SeparatesPoints s) s
x y : α
n : x ≠ y
f : C(α, A)
m : f ∈ ↑s
w : (fun f => ⇑f) f x ≠ (fun f => ⇑f) f y
⊢ ∃ f ∈ (fun f => ⇑f) '' ↑s', f x ≠ f y

Next tactic:
exact ⟨_, ⟨f, ⟨r m, rfl⟩⟩, w⟩
@[simp]
theorem algebraMap_apply (k : R) (a : α) : algebraMap R C(α, A) k a = k • (1 : A) := by
  

Proof state:
α : Type u_1
inst✝⁹ : TopologicalSpace α
R : Type u_2
inst✝⁸ : CommSemiring R
A : Type u_3
inst✝⁷ : TopologicalSpace A
inst✝⁶ : Semiring A
inst✝⁵ : Algebra R A
inst✝⁴ : TopologicalSemiring A
A₂ : Type u_4
inst✝³ : TopologicalSpace A₂
inst✝² : Semiring A₂
inst✝¹ : Algebra R A₂
inst✝ : TopologicalSemiring A₂
k : R
a : α
⊢ ((algebraMap R C(α, A)) k) a = k • 1

Next tactic:
rw [Algebra.algebraMap_eq_smul_one]
@[simp]
theorem algebraMap_apply (k : R) (a : α) : algebraMap R C(α, A) k a = k • (1 : A) := by
  rw [Algebra.algebraMap_eq_smul_one]
  

Proof state:
α : Type u_1
inst✝⁹ : TopologicalSpace α
R : Type u_2
inst✝⁸ : CommSemiring R
A : Type u_3
inst✝⁷ : TopologicalSpace A
inst✝⁶ : Semiring A
inst✝⁵ : Algebra R A
inst✝⁴ : TopologicalSemiring A
A₂ : Type u_4
inst✝³ : TopologicalSpace A₂
inst✝² : Semiring A₂
inst✝¹ : Algebra R A₂
inst✝ : TopologicalSemiring A₂
k : R
a : α
⊢ (k • 1) a = k • 1

Next tactic:
rfl
/-- Working in continuous functions into a topological field,
a subalgebra of functions that separates points also separates points strongly.

By the hypothesis, we can find a function `f` so `f x ≠ f y`.
By an affine transformation in the field we can arrange so that `f x = a` and `f x = b`.
-/
theorem Subalgebra.SeparatesPoints.strongly {s : Subalgebra 𝕜 C(α, 𝕜)} (h : s.SeparatesPoints) :
    (s : Set C(α, 𝕜)).SeparatesPointsStrongly := fun v x y => by
  

Proof state:
α : Type u_1
inst✝¹² : TopologicalSpace α
R : Type u_2
inst✝¹¹ : CommSemiring R
A : Type u_3
inst✝¹⁰ : TopologicalSpace A
inst✝⁹ : Semiring A
inst✝⁸ : Algebra R A
inst✝⁷ : TopologicalSemiring A
A₂ : Type u_4
inst✝⁶ : TopologicalSpace A₂
inst✝⁵ : Semiring A₂
inst✝⁴ : Algebra R A₂
inst✝³ : TopologicalSemiring A₂
𝕜 : Type u_5
inst✝² : TopologicalSpace 𝕜
s✝ : Set C(α, 𝕜)
f : ↑s✝
x✝ : α
inst✝¹ : Field 𝕜
inst✝ : TopologicalRing 𝕜
s : Subalgebra 𝕜 C(α, 𝕜)
h : SeparatesPoints s
v : α → 𝕜
x y : α
⊢ ∃ f ∈ ↑s, f x = v x ∧ f y = v y

Next tactic:
by_cases n : x = y
/-- Working in continuous functions into a topological field,
a subalgebra of functions that separates points also separates points strongly.

By the hypothesis, we can find a function `f` so `f x ≠ f y`.
By an affine transformation in the field we can arrange so that `f x = a` and `f x = b`.
-/
theorem Subalgebra.SeparatesPoints.strongly {s : Subalgebra 𝕜 C(α, 𝕜)} (h : s.SeparatesPoints) :
    (s : Set C(α, 𝕜)).SeparatesPointsStrongly := fun v x y => by
  by_cases n : x = y
  · 

Proof state:
case pos
α : Type u_1
inst✝¹² : TopologicalSpace α
R : Type u_2
inst✝¹¹ : CommSemiring R
A : Type u_3
inst✝¹⁰ : TopologicalSpace A
inst✝⁹ : Semiring A
inst✝⁸ : Algebra R A
inst✝⁷ : TopologicalSemiring A
A₂ : Type u_4
inst✝⁶ : TopologicalSpace A₂
inst✝⁵ : Semiring A₂
inst✝⁴ : Algebra R A₂
inst✝³ : TopologicalSemiring A₂
𝕜 : Type u_5
inst✝² : TopologicalSpace 𝕜
s✝ : Set C(α, 𝕜)
f : ↑s✝
x✝ : α
inst✝¹ : Field 𝕜
inst✝ : TopologicalRing 𝕜
s : Subalgebra 𝕜 C(α, 𝕜)
h : SeparatesPoints s
v : α → 𝕜
x y : α
n : x = y
⊢ ∃ f ∈ ↑s, f x = v x ∧ f y = v y

Next tactic:
subst n
/-- Working in continuous functions into a topological field,
a subalgebra of functions that separates points also separates points strongly.

By the hypothesis, we can find a function `f` so `f x ≠ f y`.
By an affine transformation in the field we can arrange so that `f x = a` and `f x = b`.
-/
theorem Subalgebra.SeparatesPoints.strongly {s : Subalgebra 𝕜 C(α, 𝕜)} (h : s.SeparatesPoints) :
    (s : Set C(α, 𝕜)).SeparatesPointsStrongly := fun v x y => by
  by_cases n : x = y
  · subst n
    

Proof state:
case pos
α : Type u_1
inst✝¹² : TopologicalSpace α
R : Type u_2
inst✝¹¹ : CommSemiring R
A : Type u_3
inst✝¹⁰ : TopologicalSpace A
inst✝⁹ : Semiring A
inst✝⁸ : Algebra R A
inst✝⁷ : TopologicalSemiring A
A₂ : Type u_4
inst✝⁶ : TopologicalSpace A₂
inst✝⁵ : Semiring A₂
inst✝⁴ : Algebra R A₂
inst✝³ : TopologicalSemiring A₂
𝕜 : Type u_5
inst✝² : TopologicalSpace 𝕜
s✝ : Set C(α, 𝕜)
f : ↑s✝
x✝ : α
inst✝¹ : Field 𝕜
inst✝ : TopologicalRing 𝕜
s : Subalgebra 𝕜 C(α, 𝕜)
h : SeparatesPoints s
v : α → 𝕜
x : α
⊢ ∃ f ∈ ↑s, f x = v x ∧ f x = v x

Next tactic:
refine' ⟨_, (v x • (1 : s) : s).prop, mul_one _, mul_one _⟩
/-- Working in continuous functions into a topological field,
a subalgebra of functions that separates points also separates points strongly.

By the hypothesis, we can find a function `f` so `f x ≠ f y`.
By an affine transformation in the field we can arrange so that `f x = a` and `f x = b`.
-/
theorem Subalgebra.SeparatesPoints.strongly {s : Subalgebra 𝕜 C(α, 𝕜)} (h : s.SeparatesPoints) :
    (s : Set C(α, 𝕜)).SeparatesPointsStrongly := fun v x y => by
  by_cases n : x = y
  · subst n
    refine' ⟨_, (v x • (1 : s) : s).prop, mul_one _, mul_one _⟩
  

Proof state:
case neg
α : Type u_1
inst✝¹² : TopologicalSpace α
R : Type u_2
inst✝¹¹ : CommSemiring R
A : Type u_3
inst✝¹⁰ : TopologicalSpace A
inst✝⁹ : Semiring A
inst✝⁸ : Algebra R A
inst✝⁷ : TopologicalSemiring A
A₂ : Type u_4
inst✝⁶ : TopologicalSpace A₂
inst✝⁵ : Semiring A₂
inst✝⁴ : Algebra R A₂
inst✝³ : TopologicalSemiring A₂
𝕜 : Type u_5
inst✝² : TopologicalSpace 𝕜
s✝ : Set C(α, 𝕜)
f : ↑s✝
x✝ : α
inst✝¹ : Field 𝕜
inst✝ : TopologicalRing 𝕜
s : Subalgebra 𝕜 C(α, 𝕜)
h : SeparatesPoints s
v : α → 𝕜
x y : α
n : ¬x = y
⊢ ∃ f ∈ ↑s, f x = v x ∧ f y = v y

Next tactic:
obtain ⟨_, ⟨f, hf, rfl⟩, hxy⟩ := h n
/-- Working in continuous functions into a topological field,
a subalgebra of functions that separates points also separates points strongly.

By the hypothesis, we can find a function `f` so `f x ≠ f y`.
By an affine transformation in the field we can arrange so that `f x = a` and `f x = b`.
-/
theorem Subalgebra.SeparatesPoints.strongly {s : Subalgebra 𝕜 C(α, 𝕜)} (h : s.SeparatesPoints) :
    (s : Set C(α, 𝕜)).SeparatesPointsStrongly := fun v x y => by
  by_cases n : x = y
  · subst n
    refine' ⟨_, (v x • (1 : s) : s).prop, mul_one _, mul_one _⟩
  obtain ⟨_, ⟨f, hf, rfl⟩, hxy⟩ := h n
  

Proof state:
case neg.intro.intro.intro.intro
α : Type u_1
inst✝¹² : TopologicalSpace α
R : Type u_2
inst✝¹¹ : CommSemiring R
A : Type u_3
inst✝¹⁰ : TopologicalSpace A
inst✝⁹ : Semiring A
inst✝⁸ : Algebra R A
inst✝⁷ : TopologicalSemiring A
A₂ : Type u_4
inst✝⁶ : TopologicalSpace A₂
inst✝⁵ : Semiring A₂
inst✝⁴ : Algebra R A₂
inst✝³ : TopologicalSemiring A₂
𝕜 : Type u_5
inst✝² : TopologicalSpace 𝕜
s✝ : Set C(α, 𝕜)
f✝ : ↑s✝
x✝ : α
inst✝¹ : Field 𝕜
inst✝ : TopologicalRing 𝕜
s : Subalgebra 𝕜 C(α, 𝕜)
h : SeparatesPoints s
v : α → 𝕜
x y : α
n : ¬x = y
f : C(α, 𝕜)
hf : f ∈ ↑s
hxy : (fun f => ⇑f) f x ≠ (fun f => ⇑f) f y
⊢ ∃ f ∈ ↑s, f x = v x ∧ f y = v y

Next tactic:
replace hxy : f x - f y ≠ 0 := sub_ne_zero_of_ne hxy
/-- Working in continuous functions into a topological field,
a subalgebra of functions that separates points also separates points strongly.

By the hypothesis, we can find a function `f` so `f x ≠ f y`.
By an affine transformation in the field we can arrange so that `f x = a` and `f x = b`.
-/
theorem Subalgebra.SeparatesPoints.strongly {s : Subalgebra 𝕜 C(α, 𝕜)} (h : s.SeparatesPoints) :
    (s : Set C(α, 𝕜)).SeparatesPointsStrongly := fun v x y => by
  by_cases n : x = y
  · subst n
    refine' ⟨_, (v x • (1 : s) : s).prop, mul_one _, mul_one _⟩
  obtain ⟨_, ⟨f, hf, rfl⟩, hxy⟩ := h n
  replace hxy : f x - f y ≠ 0 := sub_ne_zero_of_ne hxy
  

Proof state:
case neg.intro.intro.intro.intro
α : Type u_1
inst✝¹² : TopologicalSpace α
R : Type u_2
inst✝¹¹ : CommSemiring R
A : Type u_3
inst✝¹⁰ : TopologicalSpace A
inst✝⁹ : Semiring A
inst✝⁸ : Algebra R A
inst✝⁷ : TopologicalSemiring A
A₂ : Type u_4
inst✝⁶ : TopologicalSpace A₂
inst✝⁵ : Semiring A₂
inst✝⁴ : Algebra R A₂
inst✝³ : TopologicalSemiring A₂
𝕜 : Type u_5
inst✝² : TopologicalSpace 𝕜
s✝ : Set C(α, 𝕜)
f✝ : ↑s✝
x✝ : α
inst✝¹ : Field 𝕜
inst✝ : TopologicalRing 𝕜
s : Subalgebra 𝕜 C(α, 𝕜)
h : SeparatesPoints s
v : α → 𝕜
x y : α
n : ¬x = y
f : C(α, 𝕜)
hf : f ∈ ↑s
hxy : f x - f y ≠ 0
⊢ ∃ f ∈ ↑s, f x = v x ∧ f y = v y

Next tactic:
let a := v x
/-- Working in continuous functions into a topological field,
a subalgebra of functions that separates points also separates points strongly.

By the hypothesis, we can find a function `f` so `f x ≠ f y`.
By an affine transformation in the field we can arrange so that `f x = a` and `f x = b`.
-/
theorem Subalgebra.SeparatesPoints.strongly {s : Subalgebra 𝕜 C(α, 𝕜)} (h : s.SeparatesPoints) :
    (s : Set C(α, 𝕜)).SeparatesPointsStrongly := fun v x y => by
  by_cases n : x = y
  · subst n
    refine' ⟨_, (v x • (1 : s) : s).prop, mul_one _, mul_one _⟩
  obtain ⟨_, ⟨f, hf, rfl⟩, hxy⟩ := h n
  replace hxy : f x - f y ≠ 0 := sub_ne_zero_of_ne hxy
  let a := v x
  

Proof state:
case neg.intro.intro.intro.intro
α : Type u_1
inst✝¹² : TopologicalSpace α
R : Type u_2
inst✝¹¹ : CommSemiring R
A : Type u_3
inst✝¹⁰ : TopologicalSpace A
inst✝⁹ : Semiring A
inst✝⁸ : Algebra R A
inst✝⁷ : TopologicalSemiring A
A₂ : Type u_4
inst✝⁶ : TopologicalSpace A₂
inst✝⁵ : Semiring A₂
inst✝⁴ : Algebra R A₂
inst✝³ : TopologicalSemiring A₂
𝕜 : Type u_5
inst✝² : TopologicalSpace 𝕜
s✝ : Set C(α, 𝕜)
f✝ : ↑s✝
x✝ : α
inst✝¹ : Field 𝕜
inst✝ : TopologicalRing 𝕜
s : Subalgebra 𝕜 C(α, 𝕜)
h : SeparatesPoints s
v : α → 𝕜
x y : α
n : ¬x = y
f : C(α, 𝕜)
hf : f ∈ ↑s
hxy : f x - f y ≠ 0
a : 𝕜 := v x
⊢ ∃ f ∈ ↑s, f x = v x ∧ f y = v y

Next tactic:
let b := v y
/-- Working in continuous functions into a topological field,
a subalgebra of functions that separates points also separates points strongly.

By the hypothesis, we can find a function `f` so `f x ≠ f y`.
By an affine transformation in the field we can arrange so that `f x = a` and `f x = b`.
-/
theorem Subalgebra.SeparatesPoints.strongly {s : Subalgebra 𝕜 C(α, 𝕜)} (h : s.SeparatesPoints) :
    (s : Set C(α, 𝕜)).SeparatesPointsStrongly := fun v x y => by
  by_cases n : x = y
  · subst n
    refine' ⟨_, (v x • (1 : s) : s).prop, mul_one _, mul_one _⟩
  obtain ⟨_, ⟨f, hf, rfl⟩, hxy⟩ := h n
  replace hxy : f x - f y ≠ 0 := sub_ne_zero_of_ne hxy
  let a := v x
  let b := v y
  

Proof state:
case neg.intro.intro.intro.intro
α : Type u_1
inst✝¹² : TopologicalSpace α
R : Type u_2
inst✝¹¹ : CommSemiring R
A : Type u_3
inst✝¹⁰ : TopologicalSpace A
inst✝⁹ : Semiring A
inst✝⁸ : Algebra R A
inst✝⁷ : TopologicalSemiring A
A₂ : Type u_4
inst✝⁶ : TopologicalSpace A₂
inst✝⁵ : Semiring A₂
inst✝⁴ : Algebra R A₂
inst✝³ : TopologicalSemiring A₂
𝕜 : Type u_5
inst✝² : TopologicalSpace 𝕜
s✝ : Set C(α, 𝕜)
f✝ : ↑s✝
x✝ : α
inst✝¹ : Field 𝕜
inst✝ : TopologicalRing 𝕜
s : Subalgebra 𝕜 C(α, 𝕜)
h : SeparatesPoints s
v : α → 𝕜
x y : α
n : ¬x = y
f : C(α, 𝕜)
hf : f ∈ ↑s
hxy : f x - f y ≠ 0
a : 𝕜 := v x
b : 𝕜 := v y
⊢ ∃ f ∈ ↑s, f x = v x ∧ f y = v y

Next tactic:
let f' : s :=
    ((b - a) * (f x - f y)⁻¹) • (algebraMap _ s (f x) - (⟨f, hf⟩ : s)) + algebraMap _ s a
/-- Working in continuous functions into a topological field,
a subalgebra of functions that separates points also separates points strongly.

By the hypothesis, we can find a function `f` so `f x ≠ f y`.
By an affine transformation in the field we can arrange so that `f x = a` and `f x = b`.
-/
theorem Subalgebra.SeparatesPoints.strongly {s : Subalgebra 𝕜 C(α, 𝕜)} (h : s.SeparatesPoints) :
    (s : Set C(α, 𝕜)).SeparatesPointsStrongly := fun v x y => by
  by_cases n : x = y
  · subst n
    refine' ⟨_, (v x • (1 : s) : s).prop, mul_one _, mul_one _⟩
  obtain ⟨_, ⟨f, hf, rfl⟩, hxy⟩ := h n
  replace hxy : f x - f y ≠ 0 := sub_ne_zero_of_ne hxy
  let a := v x
  let b := v y
  let f' : s :=
    ((b - a) * (f x - f y)⁻¹) • (algebraMap _ s (f x) - (⟨f, hf⟩ : s)) + algebraMap _ s a
  

Proof state:
case neg.intro.intro.intro.intro
α : Type u_1
inst✝¹² : TopologicalSpace α
R : Type u_2
inst✝¹¹ : CommSemiring R
A : Type u_3
inst✝¹⁰ : TopologicalSpace A
inst✝⁹ : Semiring A
inst✝⁸ : Algebra R A
inst✝⁷ : TopologicalSemiring A
A₂ : Type u_4
inst✝⁶ : TopologicalSpace A₂
inst✝⁵ : Semiring A₂
inst✝⁴ : Algebra R A₂
inst✝³ : TopologicalSemiring A₂
𝕜 : Type u_5
inst✝² : TopologicalSpace 𝕜
s✝ : Set C(α, 𝕜)
f✝ : ↑s✝
x✝ : α
inst✝¹ : Field 𝕜
inst✝ : TopologicalRing 𝕜
s : Subalgebra 𝕜 C(α, 𝕜)
h : SeparatesPoints s
v : α → 𝕜
x y : α
n : ¬x = y
f : C(α, 𝕜)
hf : f ∈ ↑s
hxy : f x - f y ≠ 0
a : 𝕜 := v x
b : 𝕜 := v y
f' : ↥s := ((b - a) * (f x - f y)⁻¹) • ((algebraMap 𝕜 ↥s) (f x) - { val := f, property := hf }) + (algebraMap 𝕜 ↥s) a
⊢ ∃ f ∈ ↑s, f x = v x ∧ f y = v y

Next tactic:
refine' ⟨f', f'.prop, _, _⟩
/-- Working in continuous functions into a topological field,
a subalgebra of functions that separates points also separates points strongly.

By the hypothesis, we can find a function `f` so `f x ≠ f y`.
By an affine transformation in the field we can arrange so that `f x = a` and `f x = b`.
-/
theorem Subalgebra.SeparatesPoints.strongly {s : Subalgebra 𝕜 C(α, 𝕜)} (h : s.SeparatesPoints) :
    (s : Set C(α, 𝕜)).SeparatesPointsStrongly := fun v x y => by
  by_cases n : x = y
  · subst n
    refine' ⟨_, (v x • (1 : s) : s).prop, mul_one _, mul_one _⟩
  obtain ⟨_, ⟨f, hf, rfl⟩, hxy⟩ := h n
  replace hxy : f x - f y ≠ 0 := sub_ne_zero_of_ne hxy
  let a := v x
  let b := v y
  let f' : s :=
    ((b - a) * (f x - f y)⁻¹) • (algebraMap _ s (f x) - (⟨f, hf⟩ : s)) + algebraMap _ s a
  refine' ⟨f', f'.prop, _, _⟩
  · 

Proof state:
case neg.intro.intro.intro.intro.refine'_1
α : Type u_1
inst✝¹² : TopologicalSpace α
R : Type u_2
inst✝¹¹ : CommSemiring R
A : Type u_3
inst✝¹⁰ : TopologicalSpace A
inst✝⁹ : Semiring A
inst✝⁸ : Algebra R A
inst✝⁷ : TopologicalSemiring A
A₂ : Type u_4
inst✝⁶ : TopologicalSpace A₂
inst✝⁵ : Semiring A₂
inst✝⁴ : Algebra R A₂
inst✝³ : TopologicalSemiring A₂
𝕜 : Type u_5
inst✝² : TopologicalSpace 𝕜
s✝ : Set C(α, 𝕜)
f✝ : ↑s✝
x✝ : α
inst✝¹ : Field 𝕜
inst✝ : TopologicalRing 𝕜
s : Subalgebra 𝕜 C(α, 𝕜)
h : SeparatesPoints s
v : α → 𝕜
x y : α
n : ¬x = y
f : C(α, 𝕜)
hf : f ∈ ↑s
hxy : f x - f y ≠ 0
a : 𝕜 := v x
b : 𝕜 := v y
f' : ↥s := ((b - a) * (f x - f y)⁻¹) • ((algebraMap 𝕜 ↥s) (f x) - { val := f, property := hf }) + (algebraMap 𝕜 ↥s) a
⊢ ↑f' x = v x

Next tactic:
simp
/-- Working in continuous functions into a topological field,
a subalgebra of functions that separates points also separates points strongly.

By the hypothesis, we can find a function `f` so `f x ≠ f y`.
By an affine transformation in the field we can arrange so that `f x = a` and `f x = b`.
-/
theorem Subalgebra.SeparatesPoints.strongly {s : Subalgebra 𝕜 C(α, 𝕜)} (h : s.SeparatesPoints) :
    (s : Set C(α, 𝕜)).SeparatesPointsStrongly := fun v x y => by
  by_cases n : x = y
  · subst n
    refine' ⟨_, (v x • (1 : s) : s).prop, mul_one _, mul_one _⟩
  obtain ⟨_, ⟨f, hf, rfl⟩, hxy⟩ := h n
  replace hxy : f x - f y ≠ 0 := sub_ne_zero_of_ne hxy
  let a := v x
  let b := v y
  let f' : s :=
    ((b - a) * (f x - f y)⁻¹) • (algebraMap _ s (f x) - (⟨f, hf⟩ : s)) + algebraMap _ s a
  refine' ⟨f', f'.prop, _, _⟩
  · simp
  · 

Proof state:
case neg.intro.intro.intro.intro.refine'_2
α : Type u_1
inst✝¹² : TopologicalSpace α
R : Type u_2
inst✝¹¹ : CommSemiring R
A : Type u_3
inst✝¹⁰ : TopologicalSpace A
inst✝⁹ : Semiring A
inst✝⁸ : Algebra R A
inst✝⁷ : TopologicalSemiring A
A₂ : Type u_4
inst✝⁶ : TopologicalSpace A₂
inst✝⁵ : Semiring A₂
inst✝⁴ : Algebra R A₂
inst✝³ : TopologicalSemiring A₂
𝕜 : Type u_5
inst✝² : TopologicalSpace 𝕜
s✝ : Set C(α, 𝕜)
f✝ : ↑s✝
x✝ : α
inst✝¹ : Field 𝕜
inst✝ : TopologicalRing 𝕜
s : Subalgebra 𝕜 C(α, 𝕜)
h : SeparatesPoints s
v : α → 𝕜
x y : α
n : ¬x = y
f : C(α, 𝕜)
hf : f ∈ ↑s
hxy : f x - f y ≠ 0
a : 𝕜 := v x
b : 𝕜 := v y
f' : ↥s := ((b - a) * (f x - f y)⁻¹) • ((algebraMap 𝕜 ↥s) (f x) - { val := f, property := hf }) + (algebraMap 𝕜 ↥s) a
⊢ ↑f' y = v y

Next tactic:
simp [inv_mul_cancel_right₀ hxy]
instance ContinuousMap.subsingleton_subalgebra (α : Type*) [TopologicalSpace α] (R : Type*)
    [CommSemiring R] [TopologicalSpace R] [TopologicalSemiring R] [Subsingleton α] :
    Subsingleton (Subalgebra R C(α, R)) :=
  ⟨fun s₁ s₂ => by
    

Proof state:
α : Type u_1
inst✝⁴ : TopologicalSpace α
R : Type u_2
inst✝³ : CommSemiring R
inst✝² : TopologicalSpace R
inst✝¹ : TopologicalSemiring R
inst✝ : Subsingleton α
s₁ s₂ : Subalgebra R C(α, R)
⊢ s₁ = s₂

Next tactic:
cases isEmpty_or_nonempty α
instance ContinuousMap.subsingleton_subalgebra (α : Type*) [TopologicalSpace α] (R : Type*)
    [CommSemiring R] [TopologicalSpace R] [TopologicalSemiring R] [Subsingleton α] :
    Subsingleton (Subalgebra R C(α, R)) :=
  ⟨fun s₁ s₂ => by
    cases isEmpty_or_nonempty α
    · 

Proof state:
case inl
α : Type u_1
inst✝⁴ : TopologicalSpace α
R : Type u_2
inst✝³ : CommSemiring R
inst✝² : TopologicalSpace R
inst✝¹ : TopologicalSemiring R
inst✝ : Subsingleton α
s₁ s₂ : Subalgebra R C(α, R)
h✝ : IsEmpty α
⊢ s₁ = s₂

Next tactic:
haveI : Subsingleton C(α, R) := FunLike.coe_injective.subsingleton
instance ContinuousMap.subsingleton_subalgebra (α : Type*) [TopologicalSpace α] (R : Type*)
    [CommSemiring R] [TopologicalSpace R] [TopologicalSemiring R] [Subsingleton α] :
    Subsingleton (Subalgebra R C(α, R)) :=
  ⟨fun s₁ s₂ => by
    cases isEmpty_or_nonempty α
    · haveI : Subsingleton C(α, R) := FunLike.coe_injective.subsingleton
      

Proof state:
case inl
α : Type u_1
inst✝⁴ : TopologicalSpace α
R : Type u_2
inst✝³ : CommSemiring R
inst✝² : TopologicalSpace R
inst✝¹ : TopologicalSemiring R
inst✝ : Subsingleton α
s₁ s₂ : Subalgebra R C(α, R)
h✝ : IsEmpty α
this : Subsingleton C(α, R)
⊢ s₁ = s₂

Next tactic:
exact Subsingleton.elim _ _
instance ContinuousMap.subsingleton_subalgebra (α : Type*) [TopologicalSpace α] (R : Type*)
    [CommSemiring R] [TopologicalSpace R] [TopologicalSemiring R] [Subsingleton α] :
    Subsingleton (Subalgebra R C(α, R)) :=
  ⟨fun s₁ s₂ => by
    cases isEmpty_or_nonempty α
    · haveI : Subsingleton C(α, R) := FunLike.coe_injective.subsingleton
      exact Subsingleton.elim _ _
    · 

Proof state:
case inr
α : Type u_1
inst✝⁴ : TopologicalSpace α
R : Type u_2
inst✝³ : CommSemiring R
inst✝² : TopologicalSpace R
inst✝¹ : TopologicalSemiring R
inst✝ : Subsingleton α
s₁ s₂ : Subalgebra R C(α, R)
h✝ : Nonempty α
⊢ s₁ = s₂

Next tactic:
inhabit α
instance ContinuousMap.subsingleton_subalgebra (α : Type*) [TopologicalSpace α] (R : Type*)
    [CommSemiring R] [TopologicalSpace R] [TopologicalSemiring R] [Subsingleton α] :
    Subsingleton (Subalgebra R C(α, R)) :=
  ⟨fun s₁ s₂ => by
    cases isEmpty_or_nonempty α
    · haveI : Subsingleton C(α, R) := FunLike.coe_injective.subsingleton
      exact Subsingleton.elim _ _
    · inhabit α
      

Proof state:
case inr
α : Type u_1
inst✝⁴ : TopologicalSpace α
R : Type u_2
inst✝³ : CommSemiring R
inst✝² : TopologicalSpace R
inst✝¹ : TopologicalSemiring R
inst✝ : Subsingleton α
s₁ s₂ : Subalgebra R C(α, R)
h✝ : Nonempty α
inhabited_h : Inhabited α
⊢ s₁ = s₂

Next tactic:
ext f
instance ContinuousMap.subsingleton_subalgebra (α : Type*) [TopologicalSpace α] (R : Type*)
    [CommSemiring R] [TopologicalSpace R] [TopologicalSemiring R] [Subsingleton α] :
    Subsingleton (Subalgebra R C(α, R)) :=
  ⟨fun s₁ s₂ => by
    cases isEmpty_or_nonempty α
    · haveI : Subsingleton C(α, R) := FunLike.coe_injective.subsingleton
      exact Subsingleton.elim _ _
    · inhabit α
      ext f
      

Proof state:
case inr.h
α : Type u_1
inst✝⁴ : TopologicalSpace α
R : Type u_2
inst✝³ : CommSemiring R
inst✝² : TopologicalSpace R
inst✝¹ : TopologicalSemiring R
inst✝ : Subsingleton α
s₁ s₂ : Subalgebra R C(α, R)
h✝ : Nonempty α
inhabited_h : Inhabited α
f : C(α, R)
⊢ f ∈ s₁ ↔ f ∈ s₂

Next tactic:
have h : f = algebraMap R C(α, R) (f default) := by
        ext x'
        simp only [mul_one, Algebra.id.smul_eq_mul, algebraMap_apply]
        congr
        simp [eq_iff_true_of_subsingleton]