l3lab/ntp-mathlib huggingface dataset:
/-- The **fundamental identity** of ramification index `e` and inertia degree `f`:
for `P` ranging over the primes lying over `p`, `∑ P, e P * f P = [Frac(S) : Frac(R)]`;
here `S` is a finite `R`-module (and thus `Frac(S) : Frac(R)` is a finite extension) and `p`
is maximal.
-/
theorem sum_ramification_inertia (K L : Type*) [Field K] [Field L] [IsDomain R]
    [IsDedekindDomain R] [Algebra R K] [IsFractionRing R K] [Algebra S L] [IsFractionRing S L]
    [Algebra K L] [Algebra R L] [IsScalarTower R S L] [IsScalarTower R K L] [IsNoetherian R S]
    [IsIntegralClosure S R L] [p.IsMaximal] (hp0 : p ≠ ⊥) :
    (∑ P in (factors (map (algebraMap R S) p)).toFinset,
        ramificationIdx (algebraMap R S) p P * inertiaDeg (algebraMap R S) p P) =
      finrank K L := by
  set e := ramificationIdx (algebraMap R S) p
  set f := inertiaDeg (algebraMap R S) p
  have inj_RL : Function.Injective (algebraMap R L) := by
    rw [IsScalarTower.algebraMap_eq R K L, RingHom.coe_comp]
    exact (RingHom.injective _).comp (IsFractionRing.injective R K)
  have inj_RS : Function.Injective (algebraMap R S) := by
    refine Function.Injective.of_comp (show Function.Injective (algebraMap S L ∘ _) from ?_)
    rw [← RingHom.coe_comp, ← IsScalarTower.algebraMap_eq]
    exact inj_RL
  calc
    (∑ P in (factors (map (algebraMap R S) p)).toFinset, e P * f P) =
        ∑ P in (factors (map (algebraMap R S) p)).toFinset.attach,
          finrank (R ⧸ p) (S ⧸ (P : Ideal S) ^ e P) := ?_
    _ = finrank (R ⧸ p)
          (∀ P : (factors (map (algebraMap R S) p)).toFinset, S ⧸ (P : Ideal S) ^ e P) :=
      (finrank_pi_fintype (R ⧸ p)).symm
    _ = finrank (R ⧸ p) (S ⧸ map (algebraMap R S) p) := ?_
    _ = finrank K L := ?_
  · rw [← Finset.sum_attach]
    refine Finset.sum_congr rfl fun P _ => ?_
    rw [Factors.finrank_pow_ramificationIdx]
  · refine LinearEquiv.finrank_eq (Factors.piQuotientLinearEquiv S p ?_).symm
    

Proof state:
case calc_2
R : Type u
inst✝¹⁹ : CommRing R
S : Type v
inst✝¹⁸ : CommRing S
f✝ : R →+* S
p : Ideal R
P : Ideal S
inst✝¹⁷ : IsDomain S
inst✝¹⁶ : IsDedekindDomain S
inst✝¹⁵ : Algebra R S
K : Type u_1
L : Type u_2
inst✝¹⁴ : Field K
inst✝¹³ : Field L
inst✝¹² : IsDomain R
inst✝¹¹ : IsDedekindDomain R
inst✝¹⁰ : Algebra R K
inst✝⁹ : IsFractionRing R K
inst✝⁸ : Algebra S L
inst✝⁷ : IsFractionRing S L
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra R L
inst✝⁴ : IsScalarTower R S L
inst✝³ : IsScalarTower R K L
inst✝² : IsNoetherian R S
inst✝¹ : IsIntegralClosure S R L
inst✝ : IsMaximal p
hp0 : p ≠ ⊥
e : Ideal S → ℕ := ramificationIdx (algebraMap R S) p
f : Ideal S → [inst : IsMaximal p] → ℕ := inertiaDeg (algebraMap R S) p
inj_RL : Function.Injective ⇑(algebraMap R L)
inj_RS : Function.Injective ⇑(algebraMap R S)
⊢ map (algebraMap R S) p ≠ ⊥

Next tactic:
rwa [Ne.def, Ideal.map_eq_bot_iff_le_ker, (RingHom.injective_iff_ker_eq_bot _).mp inj_RS,
      le_bot_iff]
/-- The **fundamental identity** of ramification index `e` and inertia degree `f`:
for `P` ranging over the primes lying over `p`, `∑ P, e P * f P = [Frac(S) : Frac(R)]`;
here `S` is a finite `R`-module (and thus `Frac(S) : Frac(R)` is a finite extension) and `p`
is maximal.
-/
theorem sum_ramification_inertia (K L : Type*) [Field K] [Field L] [IsDomain R]
    [IsDedekindDomain R] [Algebra R K] [IsFractionRing R K] [Algebra S L] [IsFractionRing S L]
    [Algebra K L] [Algebra R L] [IsScalarTower R S L] [IsScalarTower R K L] [IsNoetherian R S]
    [IsIntegralClosure S R L] [p.IsMaximal] (hp0 : p ≠ ⊥) :
    (∑ P in (factors (map (algebraMap R S) p)).toFinset,
        ramificationIdx (algebraMap R S) p P * inertiaDeg (algebraMap R S) p P) =
      finrank K L := by
  set e := ramificationIdx (algebraMap R S) p
  set f := inertiaDeg (algebraMap R S) p
  have inj_RL : Function.Injective (algebraMap R L) := by
    rw [IsScalarTower.algebraMap_eq R K L, RingHom.coe_comp]
    exact (RingHom.injective _).comp (IsFractionRing.injective R K)
  have inj_RS : Function.Injective (algebraMap R S) := by
    refine Function.Injective.of_comp (show Function.Injective (algebraMap S L ∘ _) from ?_)
    rw [← RingHom.coe_comp, ← IsScalarTower.algebraMap_eq]
    exact inj_RL
  calc
    (∑ P in (factors (map (algebraMap R S) p)).toFinset, e P * f P) =
        ∑ P in (factors (map (algebraMap R S) p)).toFinset.attach,
          finrank (R ⧸ p) (S ⧸ (P : Ideal S) ^ e P) := ?_
    _ = finrank (R ⧸ p)
          (∀ P : (factors (map (algebraMap R S) p)).toFinset, S ⧸ (P : Ideal S) ^ e P) :=
      (finrank_pi_fintype (R ⧸ p)).symm
    _ = finrank (R ⧸ p) (S ⧸ map (algebraMap R S) p) := ?_
    _ = finrank K L := ?_
  · rw [← Finset.sum_attach]
    refine Finset.sum_congr rfl fun P _ => ?_
    rw [Factors.finrank_pow_ramificationIdx]
  · refine LinearEquiv.finrank_eq (Factors.piQuotientLinearEquiv S p ?_).symm
    rwa [Ne.def, Ideal.map_eq_bot_iff_le_ker, (RingHom.injective_iff_ker_eq_bot _).mp inj_RS,
      le_bot_iff]
  · 

Proof state:
case calc_3
R : Type u
inst✝¹⁹ : CommRing R
S : Type v
inst✝¹⁸ : CommRing S
f✝ : R →+* S
p : Ideal R
P : Ideal S
inst✝¹⁷ : IsDomain S
inst✝¹⁶ : IsDedekindDomain S
inst✝¹⁵ : Algebra R S
K : Type u_1
L : Type u_2
inst✝¹⁴ : Field K
inst✝¹³ : Field L
inst✝¹² : IsDomain R
inst✝¹¹ : IsDedekindDomain R
inst✝¹⁰ : Algebra R K
inst✝⁹ : IsFractionRing R K
inst✝⁸ : Algebra S L
inst✝⁷ : IsFractionRing S L
inst✝⁶ : Algebra K L
inst✝⁵ : Algebra R L
inst✝⁴ : IsScalarTower R S L
inst✝³ : IsScalarTower R K L
inst✝² : IsNoetherian R S
inst✝¹ : IsIntegralClosure S R L
inst✝ : IsMaximal p
hp0 : p ≠ ⊥
e : Ideal S → ℕ := ramificationIdx (algebraMap R S) p
f : Ideal S → [inst : IsMaximal p] → ℕ := inertiaDeg (algebraMap R S) p
inj_RL : Function.Injective ⇑(algebraMap R L)
inj_RS : Function.Injective ⇑(algebraMap R S)
⊢ finrank (R ⧸ p) (S ⧸ map (algebraMap R S) p) = finrank K L

Next tactic:
exact finrank_quotient_map p K L
/--
Every polynomial with coefficients in a topological semiring gives a (bundled) continuous function.
-/
@[simps]
def toContinuousMap (p : R[X]) : C(R, R) :=
  ⟨fun x : R => p.eval x, by 

Proof state:
R : Type u_1
inst✝² : Semiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
p : R[X]
⊢ Continuous fun x => eval x p

Next tactic:
continuity
/-- A polynomial as a continuous function,
with domain restricted to some subset of the semiring of coefficients.

(This is particularly useful when restricting to compact sets, e.g. `[0,1]`.)
-/
@[simps]
def toContinuousMapOn (p : R[X]) (X : Set R) : C(X, R) :=
  -- Porting note: Old proof was `⟨fun x : X => p.toContinuousMap x, by continuity⟩`
  ⟨fun x : X => p.toContinuousMap x, Continuous.comp (by 

Proof state:
R : Type u_1
inst✝² : Semiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
p : R[X]
X : Set R
⊢ Continuous ⇑(toContinuousMap p)

Next tactic:
continuity
/-- A polynomial as a continuous function,
with domain restricted to some subset of the semiring of coefficients.

(This is particularly useful when restricting to compact sets, e.g. `[0,1]`.)
-/
@[simps]
def toContinuousMapOn (p : R[X]) (X : Set R) : C(X, R) :=
  -- Porting note: Old proof was `⟨fun x : X => p.toContinuousMap x, by continuity⟩`
  ⟨fun x : X => p.toContinuousMap x, Continuous.comp (by continuity) (by 

Proof state:
R : Type u_1
inst✝² : Semiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
p : R[X]
X : Set R
⊢ Continuous fun x => ↑x

Next tactic:
continuity
@[simp]
theorem aeval_continuousMap_apply (g : R[X]) (f : C(α, R)) (x : α) :
    ((Polynomial.aeval f) g) x = g.eval (f x) := by
  

Proof state:
R : Type u_1
α : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
g : R[X]
f : C(α, R)
x : α
⊢ ((aeval f) g) x = eval (f x) g

Next tactic:
refine' Polynomial.induction_on' g _ _
@[simp]
theorem aeval_continuousMap_apply (g : R[X]) (f : C(α, R)) (x : α) :
    ((Polynomial.aeval f) g) x = g.eval (f x) := by
  refine' Polynomial.induction_on' g _ _
  · 

Proof state:
case refine'_1
R : Type u_1
α : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
g : R[X]
f : C(α, R)
x : α
⊢ ∀ (p q : R[X]),
    ((aeval f) p) x = eval (f x) p → ((aeval f) q) x = eval (f x) q → ((aeval f) (p + q)) x = eval (f x) (p + q)

Next tactic:
intro p q hp hq
@[simp]
theorem aeval_continuousMap_apply (g : R[X]) (f : C(α, R)) (x : α) :
    ((Polynomial.aeval f) g) x = g.eval (f x) := by
  refine' Polynomial.induction_on' g _ _
  · intro p q hp hq
    

Proof state:
case refine'_1
R : Type u_1
α : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
g : R[X]
f : C(α, R)
x : α
p q : R[X]
hp : ((aeval f) p) x = eval (f x) p
hq : ((aeval f) q) x = eval (f x) q
⊢ ((aeval f) (p + q)) x = eval (f x) (p + q)

Next tactic:
simp [hp, hq]
@[simp]
theorem aeval_continuousMap_apply (g : R[X]) (f : C(α, R)) (x : α) :
    ((Polynomial.aeval f) g) x = g.eval (f x) := by
  refine' Polynomial.induction_on' g _ _
  · intro p q hp hq
    simp [hp, hq]
  · 

Proof state:
case refine'_2
R : Type u_1
α : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
g : R[X]
f : C(α, R)
x : α
⊢ ∀ (n : ℕ) (a : R), ((aeval f) ((monomial n) a)) x = eval (f x) ((monomial n) a)

Next tactic:
intro n a
@[simp]
theorem aeval_continuousMap_apply (g : R[X]) (f : C(α, R)) (x : α) :
    ((Polynomial.aeval f) g) x = g.eval (f x) := by
  refine' Polynomial.induction_on' g _ _
  · intro p q hp hq
    simp [hp, hq]
  · intro n a
    

Proof state:
case refine'_2
R : Type u_1
α : Type u_2
inst✝³ : TopologicalSpace α
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
g : R[X]
f : C(α, R)
x : α
n : ℕ
a : R
⊢ ((aeval f) ((monomial n) a)) x = eval (f x) ((monomial n) a)

Next tactic:
simp [Pi.pow_apply]
/-- The algebra map from `R[X]` to continuous functions `C(R, R)`.
-/
@[simps]
def toContinuousMapAlgHom : R[X] →ₐ[R] C(R, R) where
  toFun p := p.toContinuousMap
  map_zero' := by
    ext
    simp
  map_add' _ _ := by
    ext
    simp
  map_one' := by
    

Proof state:
R : Type u_1
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
⊢ (fun p => toContinuousMap p) 1 = 1

Next tactic:
ext
/-- The algebra map from `R[X]` to continuous functions `C(R, R)`.
-/
@[simps]
def toContinuousMapAlgHom : R[X] →ₐ[R] C(R, R) where
  toFun p := p.toContinuousMap
  map_zero' := by
    ext
    simp
  map_add' _ _ := by
    ext
    simp
  map_one' := by
    ext
    

Proof state:
case h
R : Type u_1
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
a✝ : R
⊢ ((fun p => toContinuousMap p) 1) a✝ = 1 a✝

Next tactic:
simp
/-- The algebra map from `R[X]` to continuous functions `C(R, R)`.
-/
@[simps]
def toContinuousMapAlgHom : R[X] →ₐ[R] C(R, R) where
  toFun p := p.toContinuousMap
  map_zero' := by
    ext
    simp
  map_add' _ _ := by
    ext
    simp
  map_one' := by
    ext
    simp
  map_mul' _ _ := by
    

Proof state:
R : Type u_1
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
x✝¹ x✝ : R[X]
⊢ OneHom.toFun { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
      (x✝¹ * x✝) =
    OneHom.toFun { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) } x✝¹ *
      OneHom.toFun { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) } x✝

Next tactic:
ext
/-- The algebra map from `R[X]` to continuous functions `C(R, R)`.
-/
@[simps]
def toContinuousMapAlgHom : R[X] →ₐ[R] C(R, R) where
  toFun p := p.toContinuousMap
  map_zero' := by
    ext
    simp
  map_add' _ _ := by
    ext
    simp
  map_one' := by
    ext
    simp
  map_mul' _ _ := by
    ext
    

Proof state:
case h
R : Type u_1
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
x✝¹ x✝ : R[X]
a✝ : R
⊢ (OneHom.toFun { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
        (x✝¹ * x✝))
      a✝ =
    (OneHom.toFun { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) } x✝¹ *
        OneHom.toFun { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) } x✝)
      a✝

Next tactic:
simp
/-- The algebra map from `R[X]` to continuous functions `C(R, R)`.
-/
@[simps]
def toContinuousMapAlgHom : R[X] →ₐ[R] C(R, R) where
  toFun p := p.toContinuousMap
  map_zero' := by
    

Proof state:
R : Type u_1
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (x x_1 : R[X]),
                OneHom.toFun
                    { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                    (x * x_1) =
                  OneHom.toFun
                      { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) } x *
                    OneHom.toFun
                      { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                      x_1) })
      0 =
    0

Next tactic:
ext
/-- The algebra map from `R[X]` to continuous functions `C(R, R)`.
-/
@[simps]
def toContinuousMapAlgHom : R[X] →ₐ[R] C(R, R) where
  toFun p := p.toContinuousMap
  map_zero' := by
    ext
    

Proof state:
case h
R : Type u_1
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
a✝ : R
⊢ (OneHom.toFun
        (↑{ toOneHom := { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (x x_1 : R[X]),
                  OneHom.toFun
                      { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                      (x * x_1) =
                    OneHom.toFun
                        { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                        x *
                      OneHom.toFun
                        { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                        x_1) })
        0)
      a✝ =
    0 a✝

Next tactic:
simp
/-- The algebra map from `R[X]` to continuous functions `C(R, R)`.
-/
@[simps]
def toContinuousMapAlgHom : R[X] →ₐ[R] C(R, R) where
  toFun p := p.toContinuousMap
  map_zero' := by
    ext
    simp
  map_add' _ _ := by
    

Proof state:
R : Type u_1
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
x✝¹ x✝ : R[X]
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (x x_1 : R[X]),
                OneHom.toFun
                    { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                    (x * x_1) =
                  OneHom.toFun
                      { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) } x *
                    OneHom.toFun
                      { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                      x_1) })
      (x✝¹ + x✝) =
    OneHom.toFun
        (↑{ toOneHom := { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (x x_1 : R[X]),
                  OneHom.toFun
                      { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                      (x * x_1) =
                    OneHom.toFun
                        { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                        x *
                      OneHom.toFun
                        { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                        x_1) })
        x✝¹ +
      OneHom.toFun
        (↑{ toOneHom := { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (x x_1 : R[X]),
                  OneHom.toFun
                      { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                      (x * x_1) =
                    OneHom.toFun
                        { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                        x *
                      OneHom.toFun
                        { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                        x_1) })
        x✝

Next tactic:
ext
/-- The algebra map from `R[X]` to continuous functions `C(R, R)`.
-/
@[simps]
def toContinuousMapAlgHom : R[X] →ₐ[R] C(R, R) where
  toFun p := p.toContinuousMap
  map_zero' := by
    ext
    simp
  map_add' _ _ := by
    ext
    

Proof state:
case h
R : Type u_1
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
x✝¹ x✝ : R[X]
a✝ : R
⊢ (OneHom.toFun
        (↑{ toOneHom := { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (x x_1 : R[X]),
                  OneHom.toFun
                      { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                      (x * x_1) =
                    OneHom.toFun
                        { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                        x *
                      OneHom.toFun
                        { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                        x_1) })
        (x✝¹ + x✝))
      a✝ =
    (OneHom.toFun
          (↑{ toOneHom := { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) },
              map_mul' :=
                (_ :
                  ∀ (x x_1 : R[X]),
                    OneHom.toFun
                        { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                        (x * x_1) =
                      OneHom.toFun
                          { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                          x *
                        OneHom.toFun
                          { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                          x_1) })
          x✝¹ +
        OneHom.toFun
          (↑{ toOneHom := { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) },
              map_mul' :=
                (_ :
                  ∀ (x x_1 : R[X]),
                    OneHom.toFun
                        { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                        (x * x_1) =
                      OneHom.toFun
                          { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                          x *
                        OneHom.toFun
                          { toFun := fun p => toContinuousMap p, map_one' := (_ : (fun p => toContinuousMap p) 1 = 1) }
                          x_1) })
          x✝)
      a✝

Next tactic:
simp
/-- The algebra map from `R[X]` to continuous functions `C(X, R)`, for any subset `X` of `R`.
-/
@[simps]
def toContinuousMapOnAlgHom (X : Set R) : R[X] →ₐ[R] C(X, R) where
  toFun p := p.toContinuousMapOn X
  map_zero' := by
    ext
    simp
  map_add' _ _ := by
    ext
    simp
  map_one' := by
    

Proof state:
R : Type u_1
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
X : Set R
⊢ (fun p => toContinuousMapOn p X) 1 = 1

Next tactic:
ext
/-- The algebra map from `R[X]` to continuous functions `C(X, R)`, for any subset `X` of `R`.
-/
@[simps]
def toContinuousMapOnAlgHom (X : Set R) : R[X] →ₐ[R] C(X, R) where
  toFun p := p.toContinuousMapOn X
  map_zero' := by
    ext
    simp
  map_add' _ _ := by
    ext
    simp
  map_one' := by
    ext
    

Proof state:
case h
R : Type u_1
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
X : Set R
a✝ : ↑X
⊢ ((fun p => toContinuousMapOn p X) 1) a✝ = 1 a✝

Next tactic:
simp
/-- The algebra map from `R[X]` to continuous functions `C(X, R)`, for any subset `X` of `R`.
-/
@[simps]
def toContinuousMapOnAlgHom (X : Set R) : R[X] →ₐ[R] C(X, R) where
  toFun p := p.toContinuousMapOn X
  map_zero' := by
    ext
    simp
  map_add' _ _ := by
    ext
    simp
  map_one' := by
    ext
    simp
  map_mul' _ _ := by
    

Proof state:
R : Type u_1
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
X : Set R
x✝¹ x✝ : R[X]
⊢ OneHom.toFun { toFun := fun p => toContinuousMapOn p X, map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
      (x✝¹ * x✝) =
    OneHom.toFun { toFun := fun p => toContinuousMapOn p X, map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
        x✝¹ *
      OneHom.toFun { toFun := fun p => toContinuousMapOn p X, map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
        x✝

Next tactic:
ext
/-- The algebra map from `R[X]` to continuous functions `C(X, R)`, for any subset `X` of `R`.
-/
@[simps]
def toContinuousMapOnAlgHom (X : Set R) : R[X] →ₐ[R] C(X, R) where
  toFun p := p.toContinuousMapOn X
  map_zero' := by
    ext
    simp
  map_add' _ _ := by
    ext
    simp
  map_one' := by
    ext
    simp
  map_mul' _ _ := by
    ext
    

Proof state:
case h
R : Type u_1
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
X : Set R
x✝¹ x✝ : R[X]
a✝ : ↑X
⊢ (OneHom.toFun { toFun := fun p => toContinuousMapOn p X, map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
        (x✝¹ * x✝))
      a✝ =
    (OneHom.toFun { toFun := fun p => toContinuousMapOn p X, map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
          x✝¹ *
        OneHom.toFun
          { toFun := fun p => toContinuousMapOn p X, map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) } x✝)
      a✝

Next tactic:
simp
/-- The algebra map from `R[X]` to continuous functions `C(X, R)`, for any subset `X` of `R`.
-/
@[simps]
def toContinuousMapOnAlgHom (X : Set R) : R[X] →ₐ[R] C(X, R) where
  toFun p := p.toContinuousMapOn X
  map_zero' := by
    

Proof state:
R : Type u_1
inst✝² : CommSemiring R
inst✝¹ : TopologicalSpace R
inst✝ : TopologicalSemiring R
X : Set R
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := fun p => toContinuousMapOn p X, map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (x x_1 : R[X]),
                OneHom.toFun
                    { toFun := fun p => toContinuousMapOn p X,
                      map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
                    (x * x_1) =
                  OneHom.toFun
                      { toFun := fun p => toContinuousMapOn p X,
                        map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
                      x *
                    OneHom.toFun
                      { toFun := fun p => toContinuousMapOn p X,
                        map_one' := (_ : (fun p => toContinuousMapOn p X) 1 = 1) }
                      x_1) })
      0 =
    0

Next tactic:
ext