l3lab/ntp-mathlib huggingface dataset:
/-- Let `K` a subfield of `ℂ` and let `ψ : K →+* ℂ` a ring homomorphism. Assume that `ψ` is uniform
continuous, then `ψ` is either the inclusion map or the composition of the inclusion map with the
complex conjugation. -/
theorem Complex.uniformContinuous_ringHom_eq_id_or_conj (K : Subfield ℂ) {ψ : K →+* ℂ}
    (hc : UniformContinuous ψ) : ψ.toFun = K.subtype ∨ ψ.toFun = conj ∘ K.subtype := by
  letI : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
  letI : TopologicalRing K.topologicalClosure :=
    Subring.instTopologicalRing K.topologicalClosure.toSubring
  set ι : K → K.topologicalClosure := ⇑(Subfield.inclusion K.le_topologicalClosure)
  have ui : UniformInducing ι :=
    ⟨by
      erw [uniformity_subtype, uniformity_subtype, Filter.comap_comap]
      congr ⟩
  let di := ui.denseInducing (?_ : DenseRange ι)
  · -- extψ : closure(K) →+* ℂ is the extension of ψ : K →+* ℂ
    let extψ := DenseInducing.extendRingHom ui di.dense hc
    haveI hψ := (uniformContinuous_uniformly_extend ui di.dense hc).continuous
    cases' Complex.subfield_eq_of_closed (Subfield.isClosed_topologicalClosure K) with h h
    · left
      

Proof state:
case refine_2.inl.h
K : Subfield ℂ
ψ : ↥K →+* ℂ
hc : UniformContinuous ⇑ψ
this✝ : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
this : TopologicalRing ↥(Subfield.topologicalClosure K) :=
  Subring.instTopologicalRing (Subfield.topologicalClosure K).toSubring
ι : ↥K → ↥(Subfield.topologicalClosure K) := ⇑(Subfield.inclusion (_ : K ≤ Subfield.topologicalClosure K))
ui : UniformInducing ι
di : DenseInducing ι := UniformInducing.denseInducing ui ?refine_1
extψ : ↥(Subfield.topologicalClosure K) →+* ℂ := DenseInducing.extendRingHom ui (_ : DenseRange ι) hc
hψ : Continuous (DenseInducing.extend (_ : DenseInducing ι) ⇑ψ)
h : Subfield.topologicalClosure K = RingHom.fieldRange ofReal
⊢ ψ.toFun = ⇑(Subfield.subtype K)

Next tactic:
let j := RingEquiv.subfieldCongr h
/-- Let `K` a subfield of `ℂ` and let `ψ : K →+* ℂ` a ring homomorphism. Assume that `ψ` is uniform
continuous, then `ψ` is either the inclusion map or the composition of the inclusion map with the
complex conjugation. -/
theorem Complex.uniformContinuous_ringHom_eq_id_or_conj (K : Subfield ℂ) {ψ : K →+* ℂ}
    (hc : UniformContinuous ψ) : ψ.toFun = K.subtype ∨ ψ.toFun = conj ∘ K.subtype := by
  letI : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
  letI : TopologicalRing K.topologicalClosure :=
    Subring.instTopologicalRing K.topologicalClosure.toSubring
  set ι : K → K.topologicalClosure := ⇑(Subfield.inclusion K.le_topologicalClosure)
  have ui : UniformInducing ι :=
    ⟨by
      erw [uniformity_subtype, uniformity_subtype, Filter.comap_comap]
      congr ⟩
  let di := ui.denseInducing (?_ : DenseRange ι)
  · -- extψ : closure(K) →+* ℂ is the extension of ψ : K →+* ℂ
    let extψ := DenseInducing.extendRingHom ui di.dense hc
    haveI hψ := (uniformContinuous_uniformly_extend ui di.dense hc).continuous
    cases' Complex.subfield_eq_of_closed (Subfield.isClosed_topologicalClosure K) with h h
    · left
      let j := RingEquiv.subfieldCongr h
      -- ψ₁ is the continuous ring hom `ℝ →+* ℂ` constructed from `j : closure (K) ≃+* ℝ`
      -- and `extψ : closure (K) →+* ℂ`
      

Proof state:
case refine_2.inl.h
K : Subfield ℂ
ψ : ↥K →+* ℂ
hc : UniformContinuous ⇑ψ
this✝ : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
this : TopologicalRing ↥(Subfield.topologicalClosure K) :=
  Subring.instTopologicalRing (Subfield.topologicalClosure K).toSubring
ι : ↥K → ↥(Subfield.topologicalClosure K) := ⇑(Subfield.inclusion (_ : K ≤ Subfield.topologicalClosure K))
ui : UniformInducing ι
di : DenseInducing ι := UniformInducing.denseInducing ui ?refine_1
extψ : ↥(Subfield.topologicalClosure K) →+* ℂ := DenseInducing.extendRingHom ui (_ : DenseRange ι) hc
hψ : Continuous (DenseInducing.extend (_ : DenseInducing ι) ⇑ψ)
h : Subfield.topologicalClosure K = RingHom.fieldRange ofReal
j : ↥(Subfield.topologicalClosure K) ≃+* ↥(RingHom.fieldRange ofReal) := RingEquiv.subfieldCongr h
⊢ ψ.toFun = ⇑(Subfield.subtype K)

Next tactic:
let ψ₁ := RingHom.comp extψ (RingHom.comp j.symm.toRingHom ofReal.rangeRestrict)
/-- Let `K` a subfield of `ℂ` and let `ψ : K →+* ℂ` a ring homomorphism. Assume that `ψ` is uniform
continuous, then `ψ` is either the inclusion map or the composition of the inclusion map with the
complex conjugation. -/
theorem Complex.uniformContinuous_ringHom_eq_id_or_conj (K : Subfield ℂ) {ψ : K →+* ℂ}
    (hc : UniformContinuous ψ) : ψ.toFun = K.subtype ∨ ψ.toFun = conj ∘ K.subtype := by
  letI : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
  letI : TopologicalRing K.topologicalClosure :=
    Subring.instTopologicalRing K.topologicalClosure.toSubring
  set ι : K → K.topologicalClosure := ⇑(Subfield.inclusion K.le_topologicalClosure)
  have ui : UniformInducing ι :=
    ⟨by
      erw [uniformity_subtype, uniformity_subtype, Filter.comap_comap]
      congr ⟩
  let di := ui.denseInducing (?_ : DenseRange ι)
  · -- extψ : closure(K) →+* ℂ is the extension of ψ : K →+* ℂ
    let extψ := DenseInducing.extendRingHom ui di.dense hc
    haveI hψ := (uniformContinuous_uniformly_extend ui di.dense hc).continuous
    cases' Complex.subfield_eq_of_closed (Subfield.isClosed_topologicalClosure K) with h h
    · left
      let j := RingEquiv.subfieldCongr h
      -- ψ₁ is the continuous ring hom `ℝ →+* ℂ` constructed from `j : closure (K) ≃+* ℝ`
      -- and `extψ : closure (K) →+* ℂ`
      let ψ₁ := RingHom.comp extψ (RingHom.comp j.symm.toRingHom ofReal.rangeRestrict)
      -- porting note: was `by continuity!` and was used inline
      

Proof state:
case refine_2.inl.h
K : Subfield ℂ
ψ : ↥K →+* ℂ
hc : UniformContinuous ⇑ψ
this✝ : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
this : TopologicalRing ↥(Subfield.topologicalClosure K) :=
  Subring.instTopologicalRing (Subfield.topologicalClosure K).toSubring
ι : ↥K → ↥(Subfield.topologicalClosure K) := ⇑(Subfield.inclusion (_ : K ≤ Subfield.topologicalClosure K))
ui : UniformInducing ι
di : DenseInducing ι := UniformInducing.denseInducing ui ?refine_1
extψ : ↥(Subfield.topologicalClosure K) →+* ℂ := DenseInducing.extendRingHom ui (_ : DenseRange ι) hc
hψ : Continuous (DenseInducing.extend (_ : DenseInducing ι) ⇑ψ)
h : Subfield.topologicalClosure K = RingHom.fieldRange ofReal
j : ↥(Subfield.topologicalClosure K) ≃+* ↥(RingHom.fieldRange ofReal) := RingEquiv.subfieldCongr h
ψ₁ : ℝ →+* ℂ := RingHom.comp extψ (RingHom.comp (RingEquiv.toRingHom (RingEquiv.symm j)) (RingHom.rangeRestrict ofReal))
⊢ ψ.toFun = ⇑(Subfield.subtype K)

Next tactic:
have hψ₁ : Continuous ψ₁ := by
        simpa only [RingHom.coe_comp] using hψ.comp ((continuous_algebraMap ℝ ℂ).subtype_mk _)
/-- Let `K` a subfield of `ℂ` and let `ψ : K →+* ℂ` a ring homomorphism. Assume that `ψ` is uniform
continuous, then `ψ` is either the inclusion map or the composition of the inclusion map with the
complex conjugation. -/
theorem Complex.uniformContinuous_ringHom_eq_id_or_conj (K : Subfield ℂ) {ψ : K →+* ℂ}
    (hc : UniformContinuous ψ) : ψ.toFun = K.subtype ∨ ψ.toFun = conj ∘ K.subtype := by
  letI : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
  letI : TopologicalRing K.topologicalClosure :=
    Subring.instTopologicalRing K.topologicalClosure.toSubring
  set ι : K → K.topologicalClosure := ⇑(Subfield.inclusion K.le_topologicalClosure)
  have ui : UniformInducing ι :=
    ⟨by
      erw [uniformity_subtype, uniformity_subtype, Filter.comap_comap]
      congr ⟩
  let di := ui.denseInducing (?_ : DenseRange ι)
  · -- extψ : closure(K) →+* ℂ is the extension of ψ : K →+* ℂ
    let extψ := DenseInducing.extendRingHom ui di.dense hc
    haveI hψ := (uniformContinuous_uniformly_extend ui di.dense hc).continuous
    cases' Complex.subfield_eq_of_closed (Subfield.isClosed_topologicalClosure K) with h h
    · left
      let j := RingEquiv.subfieldCongr h
      -- ψ₁ is the continuous ring hom `ℝ →+* ℂ` constructed from `j : closure (K) ≃+* ℝ`
      -- and `extψ : closure (K) →+* ℂ`
      let ψ₁ := RingHom.comp extψ (RingHom.comp j.symm.toRingHom ofReal.rangeRestrict)
      -- porting note: was `by continuity!` and was used inline
      have hψ₁ : Continuous ψ₁ := by
        

Proof state:
K : Subfield ℂ
ψ : ↥K →+* ℂ
hc : UniformContinuous ⇑ψ
this✝ : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
this : TopologicalRing ↥(Subfield.topologicalClosure K) :=
  Subring.instTopologicalRing (Subfield.topologicalClosure K).toSubring
ι : ↥K → ↥(Subfield.topologicalClosure K) := ⇑(Subfield.inclusion (_ : K ≤ Subfield.topologicalClosure K))
ui : UniformInducing ι
di : DenseInducing ι := UniformInducing.denseInducing ui ?refine_1
extψ : ↥(Subfield.topologicalClosure K) →+* ℂ := DenseInducing.extendRingHom ui (_ : DenseRange ι) hc
hψ : Continuous (DenseInducing.extend (_ : DenseInducing ι) ⇑ψ)
h : Subfield.topologicalClosure K = RingHom.fieldRange ofReal
j : ↥(Subfield.topologicalClosure K) ≃+* ↥(RingHom.fieldRange ofReal) := RingEquiv.subfieldCongr h
ψ₁ : ℝ →+* ℂ := RingHom.comp extψ (RingHom.comp (RingEquiv.toRingHom (RingEquiv.symm j)) (RingHom.rangeRestrict ofReal))
⊢ Continuous ⇑ψ₁

Next tactic:
simpa only [RingHom.coe_comp] using hψ.comp ((continuous_algebraMap ℝ ℂ).subtype_mk _)
/-- Let `K` a subfield of `ℂ` and let `ψ : K →+* ℂ` a ring homomorphism. Assume that `ψ` is uniform
continuous, then `ψ` is either the inclusion map or the composition of the inclusion map with the
complex conjugation. -/
theorem Complex.uniformContinuous_ringHom_eq_id_or_conj (K : Subfield ℂ) {ψ : K →+* ℂ}
    (hc : UniformContinuous ψ) : ψ.toFun = K.subtype ∨ ψ.toFun = conj ∘ K.subtype := by
  letI : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
  letI : TopologicalRing K.topologicalClosure :=
    Subring.instTopologicalRing K.topologicalClosure.toSubring
  set ι : K → K.topologicalClosure := ⇑(Subfield.inclusion K.le_topologicalClosure)
  have ui : UniformInducing ι :=
    ⟨by
      erw [uniformity_subtype, uniformity_subtype, Filter.comap_comap]
      congr ⟩
  let di := ui.denseInducing (?_ : DenseRange ι)
  · -- extψ : closure(K) →+* ℂ is the extension of ψ : K →+* ℂ
    let extψ := DenseInducing.extendRingHom ui di.dense hc
    haveI hψ := (uniformContinuous_uniformly_extend ui di.dense hc).continuous
    cases' Complex.subfield_eq_of_closed (Subfield.isClosed_topologicalClosure K) with h h
    · left
      let j := RingEquiv.subfieldCongr h
      -- ψ₁ is the continuous ring hom `ℝ →+* ℂ` constructed from `j : closure (K) ≃+* ℝ`
      -- and `extψ : closure (K) →+* ℂ`
      let ψ₁ := RingHom.comp extψ (RingHom.comp j.symm.toRingHom ofReal.rangeRestrict)
      -- porting note: was `by continuity!` and was used inline
      have hψ₁ : Continuous ψ₁ := by
        simpa only [RingHom.coe_comp] using hψ.comp ((continuous_algebraMap ℝ ℂ).subtype_mk _)
      

Proof state:
case refine_2.inl.h
K : Subfield ℂ
ψ : ↥K →+* ℂ
hc : UniformContinuous ⇑ψ
this✝ : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
this : TopologicalRing ↥(Subfield.topologicalClosure K) :=
  Subring.instTopologicalRing (Subfield.topologicalClosure K).toSubring
ι : ↥K → ↥(Subfield.topologicalClosure K) := ⇑(Subfield.inclusion (_ : K ≤ Subfield.topologicalClosure K))
ui : UniformInducing ι
di : DenseInducing ι := UniformInducing.denseInducing ui ?refine_1
extψ : ↥(Subfield.topologicalClosure K) →+* ℂ := DenseInducing.extendRingHom ui (_ : DenseRange ι) hc
hψ : Continuous (DenseInducing.extend (_ : DenseInducing ι) ⇑ψ)
h : Subfield.topologicalClosure K = RingHom.fieldRange ofReal
j : ↥(Subfield.topologicalClosure K) ≃+* ↥(RingHom.fieldRange ofReal) := RingEquiv.subfieldCongr h
ψ₁ : ℝ →+* ℂ := RingHom.comp extψ (RingHom.comp (RingEquiv.toRingHom (RingEquiv.symm j)) (RingHom.rangeRestrict ofReal))
hψ₁ : Continuous ⇑ψ₁
⊢ ψ.toFun = ⇑(Subfield.subtype K)

Next tactic:
ext1 x
/-- Let `K` a subfield of `ℂ` and let `ψ : K →+* ℂ` a ring homomorphism. Assume that `ψ` is uniform
continuous, then `ψ` is either the inclusion map or the composition of the inclusion map with the
complex conjugation. -/
theorem Complex.uniformContinuous_ringHom_eq_id_or_conj (K : Subfield ℂ) {ψ : K →+* ℂ}
    (hc : UniformContinuous ψ) : ψ.toFun = K.subtype ∨ ψ.toFun = conj ∘ K.subtype := by
  letI : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
  letI : TopologicalRing K.topologicalClosure :=
    Subring.instTopologicalRing K.topologicalClosure.toSubring
  set ι : K → K.topologicalClosure := ⇑(Subfield.inclusion K.le_topologicalClosure)
  have ui : UniformInducing ι :=
    ⟨by
      erw [uniformity_subtype, uniformity_subtype, Filter.comap_comap]
      congr ⟩
  let di := ui.denseInducing (?_ : DenseRange ι)
  · -- extψ : closure(K) →+* ℂ is the extension of ψ : K →+* ℂ
    let extψ := DenseInducing.extendRingHom ui di.dense hc
    haveI hψ := (uniformContinuous_uniformly_extend ui di.dense hc).continuous
    cases' Complex.subfield_eq_of_closed (Subfield.isClosed_topologicalClosure K) with h h
    · left
      let j := RingEquiv.subfieldCongr h
      -- ψ₁ is the continuous ring hom `ℝ →+* ℂ` constructed from `j : closure (K) ≃+* ℝ`
      -- and `extψ : closure (K) →+* ℂ`
      let ψ₁ := RingHom.comp extψ (RingHom.comp j.symm.toRingHom ofReal.rangeRestrict)
      -- porting note: was `by continuity!` and was used inline
      have hψ₁ : Continuous ψ₁ := by
        simpa only [RingHom.coe_comp] using hψ.comp ((continuous_algebraMap ℝ ℂ).subtype_mk _)
      ext1 x
      

Proof state:
case refine_2.inl.h.h
K : Subfield ℂ
ψ : ↥K →+* ℂ
hc : UniformContinuous ⇑ψ
this✝ : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
this : TopologicalRing ↥(Subfield.topologicalClosure K) :=
  Subring.instTopologicalRing (Subfield.topologicalClosure K).toSubring
ι : ↥K → ↥(Subfield.topologicalClosure K) := ⇑(Subfield.inclusion (_ : K ≤ Subfield.topologicalClosure K))
ui : UniformInducing ι
di : DenseInducing ι := UniformInducing.denseInducing ui ?refine_1
extψ : ↥(Subfield.topologicalClosure K) →+* ℂ := DenseInducing.extendRingHom ui (_ : DenseRange ι) hc
hψ : Continuous (DenseInducing.extend (_ : DenseInducing ι) ⇑ψ)
h : Subfield.topologicalClosure K = RingHom.fieldRange ofReal
j : ↥(Subfield.topologicalClosure K) ≃+* ↥(RingHom.fieldRange ofReal) := RingEquiv.subfieldCongr h
ψ₁ : ℝ →+* ℂ := RingHom.comp extψ (RingHom.comp (RingEquiv.toRingHom (RingEquiv.symm j)) (RingHom.rangeRestrict ofReal))
hψ₁ : Continuous ⇑ψ₁
x : ↥K
⊢ OneHom.toFun (↑↑ψ) x = (Subfield.subtype K) x

Next tactic:
rsuffices ⟨r, hr⟩ : ∃ r : ℝ, ofReal.rangeRestrict r = j (ι x)
/-- Let `K` a subfield of `ℂ` and let `ψ : K →+* ℂ` a ring homomorphism. Assume that `ψ` is uniform
continuous, then `ψ` is either the inclusion map or the composition of the inclusion map with the
complex conjugation. -/
theorem Complex.uniformContinuous_ringHom_eq_id_or_conj (K : Subfield ℂ) {ψ : K →+* ℂ}
    (hc : UniformContinuous ψ) : ψ.toFun = K.subtype ∨ ψ.toFun = conj ∘ K.subtype := by
  letI : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
  letI : TopologicalRing K.topologicalClosure :=
    Subring.instTopologicalRing K.topologicalClosure.toSubring
  set ι : K → K.topologicalClosure := ⇑(Subfield.inclusion K.le_topologicalClosure)
  have ui : UniformInducing ι :=
    ⟨by
      erw [uniformity_subtype, uniformity_subtype, Filter.comap_comap]
      congr ⟩
  let di := ui.denseInducing (?_ : DenseRange ι)
  · -- extψ : closure(K) →+* ℂ is the extension of ψ : K →+* ℂ
    let extψ := DenseInducing.extendRingHom ui di.dense hc
    haveI hψ := (uniformContinuous_uniformly_extend ui di.dense hc).continuous
    cases' Complex.subfield_eq_of_closed (Subfield.isClosed_topologicalClosure K) with h h
    · left
      let j := RingEquiv.subfieldCongr h
      -- ψ₁ is the continuous ring hom `ℝ →+* ℂ` constructed from `j : closure (K) ≃+* ℝ`
      -- and `extψ : closure (K) →+* ℂ`
      let ψ₁ := RingHom.comp extψ (RingHom.comp j.symm.toRingHom ofReal.rangeRestrict)
      -- porting note: was `by continuity!` and was used inline
      have hψ₁ : Continuous ψ₁ := by
        simpa only [RingHom.coe_comp] using hψ.comp ((continuous_algebraMap ℝ ℂ).subtype_mk _)
      ext1 x
      rsuffices ⟨r, hr⟩ : ∃ r : ℝ, ofReal.rangeRestrict r = j (ι x)
      · 

Proof state:
case refine_2.inl.h.h.intro
K : Subfield ℂ
ψ : ↥K →+* ℂ
hc : UniformContinuous ⇑ψ
this✝ : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
this : TopologicalRing ↥(Subfield.topologicalClosure K) :=
  Subring.instTopologicalRing (Subfield.topologicalClosure K).toSubring
ι : ↥K → ↥(Subfield.topologicalClosure K) := ⇑(Subfield.inclusion (_ : K ≤ Subfield.topologicalClosure K))
ui : UniformInducing ι
di : DenseInducing ι := UniformInducing.denseInducing ui ?refine_1
extψ : ↥(Subfield.topologicalClosure K) →+* ℂ := DenseInducing.extendRingHom ui (_ : DenseRange ι) hc
hψ : Continuous (DenseInducing.extend (_ : DenseInducing ι) ⇑ψ)
h : Subfield.topologicalClosure K = RingHom.fieldRange ofReal
j : ↥(Subfield.topologicalClosure K) ≃+* ↥(RingHom.fieldRange ofReal) := RingEquiv.subfieldCongr h
ψ₁ : ℝ →+* ℂ := RingHom.comp extψ (RingHom.comp (RingEquiv.toRingHom (RingEquiv.symm j)) (RingHom.rangeRestrict ofReal))
hψ₁ : Continuous ⇑ψ₁
x : ↥K
r : ℝ
hr : (RingHom.rangeRestrict ofReal) r = j (ι x)
⊢ OneHom.toFun (↑↑ψ) x = (Subfield.subtype K) x

Next tactic:
have :=
          RingHom.congr_fun (ringHom_eq_ofReal_of_continuous hψ₁) r
/-- Let `K` a subfield of `ℂ` and let `ψ : K →+* ℂ` a ring homomorphism. Assume that `ψ` is uniform
continuous, then `ψ` is either the inclusion map or the composition of the inclusion map with the
complex conjugation. -/
theorem Complex.uniformContinuous_ringHom_eq_id_or_conj (K : Subfield ℂ) {ψ : K →+* ℂ}
    (hc : UniformContinuous ψ) : ψ.toFun = K.subtype ∨ ψ.toFun = conj ∘ K.subtype := by
  letI : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
  letI : TopologicalRing K.topologicalClosure :=
    Subring.instTopologicalRing K.topologicalClosure.toSubring
  set ι : K → K.topologicalClosure := ⇑(Subfield.inclusion K.le_topologicalClosure)
  have ui : UniformInducing ι :=
    ⟨by
      erw [uniformity_subtype, uniformity_subtype, Filter.comap_comap]
      congr ⟩
  let di := ui.denseInducing (?_ : DenseRange ι)
  · -- extψ : closure(K) →+* ℂ is the extension of ψ : K →+* ℂ
    let extψ := DenseInducing.extendRingHom ui di.dense hc
    haveI hψ := (uniformContinuous_uniformly_extend ui di.dense hc).continuous
    cases' Complex.subfield_eq_of_closed (Subfield.isClosed_topologicalClosure K) with h h
    · left
      let j := RingEquiv.subfieldCongr h
      -- ψ₁ is the continuous ring hom `ℝ →+* ℂ` constructed from `j : closure (K) ≃+* ℝ`
      -- and `extψ : closure (K) →+* ℂ`
      let ψ₁ := RingHom.comp extψ (RingHom.comp j.symm.toRingHom ofReal.rangeRestrict)
      -- porting note: was `by continuity!` and was used inline
      have hψ₁ : Continuous ψ₁ := by
        simpa only [RingHom.coe_comp] using hψ.comp ((continuous_algebraMap ℝ ℂ).subtype_mk _)
      ext1 x
      rsuffices ⟨r, hr⟩ : ∃ r : ℝ, ofReal.rangeRestrict r = j (ι x)
      · have :=
          RingHom.congr_fun (ringHom_eq_ofReal_of_continuous hψ₁) r
        -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
        

Proof state:
case refine_2.inl.h.h.intro
K : Subfield ℂ
ψ : ↥K →+* ℂ
hc : UniformContinuous ⇑ψ
this✝¹ : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
this✝ : TopologicalRing ↥(Subfield.topologicalClosure K) :=
  Subring.instTopologicalRing (Subfield.topologicalClosure K).toSubring
ι : ↥K → ↥(Subfield.topologicalClosure K) := ⇑(Subfield.inclusion (_ : K ≤ Subfield.topologicalClosure K))
ui : UniformInducing ι
di : DenseInducing ι := UniformInducing.denseInducing ui ?refine_1
extψ : ↥(Subfield.topologicalClosure K) →+* ℂ := DenseInducing.extendRingHom ui (_ : DenseRange ι) hc
hψ : Continuous (DenseInducing.extend (_ : DenseInducing ι) ⇑ψ)
h : Subfield.topologicalClosure K = RingHom.fieldRange ofReal
j : ↥(Subfield.topologicalClosure K) ≃+* ↥(RingHom.fieldRange ofReal) := RingEquiv.subfieldCongr h
ψ₁ : ℝ →+* ℂ := RingHom.comp extψ (RingHom.comp (RingEquiv.toRingHom (RingEquiv.symm j)) (RingHom.rangeRestrict ofReal))
hψ₁ : Continuous ⇑ψ₁
x : ↥K
r : ℝ
hr : (RingHom.rangeRestrict ofReal) r = j (ι x)
this : ψ₁ r = ofReal r
⊢ OneHom.toFun (↑↑ψ) x = (Subfield.subtype K) x

Next tactic:
erw [RingHom.comp_apply, RingHom.comp_apply, hr, RingEquiv.toRingHom_eq_coe] at this
/-- Let `K` a subfield of `ℂ` and let `ψ : K →+* ℂ` a ring homomorphism. Assume that `ψ` is uniform
continuous, then `ψ` is either the inclusion map or the composition of the inclusion map with the
complex conjugation. -/
theorem Complex.uniformContinuous_ringHom_eq_id_or_conj (K : Subfield ℂ) {ψ : K →+* ℂ}
    (hc : UniformContinuous ψ) : ψ.toFun = K.subtype ∨ ψ.toFun = conj ∘ K.subtype := by
  letI : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
  letI : TopologicalRing K.topologicalClosure :=
    Subring.instTopologicalRing K.topologicalClosure.toSubring
  set ι : K → K.topologicalClosure := ⇑(Subfield.inclusion K.le_topologicalClosure)
  have ui : UniformInducing ι :=
    ⟨by
      erw [uniformity_subtype, uniformity_subtype, Filter.comap_comap]
      congr ⟩
  let di := ui.denseInducing (?_ : DenseRange ι)
  · -- extψ : closure(K) →+* ℂ is the extension of ψ : K →+* ℂ
    let extψ := DenseInducing.extendRingHom ui di.dense hc
    haveI hψ := (uniformContinuous_uniformly_extend ui di.dense hc).continuous
    cases' Complex.subfield_eq_of_closed (Subfield.isClosed_topologicalClosure K) with h h
    · left
      let j := RingEquiv.subfieldCongr h
      -- ψ₁ is the continuous ring hom `ℝ →+* ℂ` constructed from `j : closure (K) ≃+* ℝ`
      -- and `extψ : closure (K) →+* ℂ`
      let ψ₁ := RingHom.comp extψ (RingHom.comp j.symm.toRingHom ofReal.rangeRestrict)
      -- porting note: was `by continuity!` and was used inline
      have hψ₁ : Continuous ψ₁ := by
        simpa only [RingHom.coe_comp] using hψ.comp ((continuous_algebraMap ℝ ℂ).subtype_mk _)
      ext1 x
      rsuffices ⟨r, hr⟩ : ∃ r : ℝ, ofReal.rangeRestrict r = j (ι x)
      · have :=
          RingHom.congr_fun (ringHom_eq_ofReal_of_continuous hψ₁) r
        -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
        erw [RingHom.comp_apply, RingHom.comp_apply, hr, RingEquiv.toRingHom_eq_coe] at this
        

Proof state:
case refine_2.inl.h.h.intro
K : Subfield ℂ
ψ : ↥K →+* ℂ
hc : UniformContinuous ⇑ψ
this✝¹ : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
this✝ : TopologicalRing ↥(Subfield.topologicalClosure K) :=
  Subring.instTopologicalRing (Subfield.topologicalClosure K).toSubring
ι : ↥K → ↥(Subfield.topologicalClosure K) := ⇑(Subfield.inclusion (_ : K ≤ Subfield.topologicalClosure K))
ui : UniformInducing ι
di : DenseInducing ι := UniformInducing.denseInducing ui ?refine_1
extψ : ↥(Subfield.topologicalClosure K) →+* ℂ := DenseInducing.extendRingHom ui (_ : DenseRange ι) hc
hψ : Continuous (DenseInducing.extend (_ : DenseInducing ι) ⇑ψ)
h : Subfield.topologicalClosure K = RingHom.fieldRange ofReal
j : ↥(Subfield.topologicalClosure K) ≃+* ↥(RingHom.fieldRange ofReal) := RingEquiv.subfieldCongr h
ψ₁ : ℝ →+* ℂ := RingHom.comp extψ (RingHom.comp (RingEquiv.toRingHom (RingEquiv.symm j)) (RingHom.rangeRestrict ofReal))
hψ₁ : Continuous ⇑ψ₁
x : ↥K
r : ℝ
hr : (RingHom.rangeRestrict ofReal) r = j (ι x)
this : extψ (↑(RingEquiv.symm j) (j (ι x))) = ofReal r
⊢ OneHom.toFun (↑↑ψ) x = (Subfield.subtype K) x

Next tactic:
convert this using 1