l3lab/ntp-mathlib huggingface dataset:
/-- The only closed subfields of `ℂ` are `ℝ` and `ℂ`. -/
theorem Complex.subfield_eq_of_closed {K : Subfield ℂ} (hc : IsClosed (K : Set ℂ)) :
    K = ofReal.fieldRange ∨ K = ⊤ := by
  suffices range (ofReal' : ℝ → ℂ) ⊆ K by
    rw [range_subset_iff, ← coe_algebraMap] at this
    have :=
      (Subalgebra.isSimpleOrder_of_finrank finrank_real_complex).eq_bot_or_eq_top
        (Subfield.toIntermediateField K this).toSubalgebra
    simp_rw [← SetLike.coe_set_eq, IntermediateField.coe_toSubalgebra] at this ⊢
    exact this
  suffices range (ofReal' : ℝ → ℂ) ⊆ closure (Set.range ((ofReal' : ℝ → ℂ) ∘ ((↑) : ℚ → ℝ))) by
    

Proof state:
K : Subfield ℂ
hc : IsClosed ↑K
this : range ofReal' ⊆ closure (range (ofReal' ∘ Rat.cast))
⊢ range ofReal' ⊆ ↑K

Next tactic:
refine' subset_trans this _
/-- The only closed subfields of `ℂ` are `ℝ` and `ℂ`. -/
theorem Complex.subfield_eq_of_closed {K : Subfield ℂ} (hc : IsClosed (K : Set ℂ)) :
    K = ofReal.fieldRange ∨ K = ⊤ := by
  suffices range (ofReal' : ℝ → ℂ) ⊆ K by
    rw [range_subset_iff, ← coe_algebraMap] at this
    have :=
      (Subalgebra.isSimpleOrder_of_finrank finrank_real_complex).eq_bot_or_eq_top
        (Subfield.toIntermediateField K this).toSubalgebra
    simp_rw [← SetLike.coe_set_eq, IntermediateField.coe_toSubalgebra] at this ⊢
    exact this
  suffices range (ofReal' : ℝ → ℂ) ⊆ closure (Set.range ((ofReal' : ℝ → ℂ) ∘ ((↑) : ℚ → ℝ))) by
    refine' subset_trans this _
    

Proof state:
K : Subfield ℂ
hc : IsClosed ↑K
this : range ofReal' ⊆ closure (range (ofReal' ∘ Rat.cast))
⊢ closure (range (ofReal' ∘ Rat.cast)) ⊆ ↑K

Next tactic:
rw [← IsClosed.closure_eq hc]
/-- The only closed subfields of `ℂ` are `ℝ` and `ℂ`. -/
theorem Complex.subfield_eq_of_closed {K : Subfield ℂ} (hc : IsClosed (K : Set ℂ)) :
    K = ofReal.fieldRange ∨ K = ⊤ := by
  suffices range (ofReal' : ℝ → ℂ) ⊆ K by
    rw [range_subset_iff, ← coe_algebraMap] at this
    have :=
      (Subalgebra.isSimpleOrder_of_finrank finrank_real_complex).eq_bot_or_eq_top
        (Subfield.toIntermediateField K this).toSubalgebra
    simp_rw [← SetLike.coe_set_eq, IntermediateField.coe_toSubalgebra] at this ⊢
    exact this
  suffices range (ofReal' : ℝ → ℂ) ⊆ closure (Set.range ((ofReal' : ℝ → ℂ) ∘ ((↑) : ℚ → ℝ))) by
    refine' subset_trans this _
    rw [← IsClosed.closure_eq hc]
    

Proof state:
K : Subfield ℂ
hc : IsClosed ↑K
this : range ofReal' ⊆ closure (range (ofReal' ∘ Rat.cast))
⊢ closure (range (ofReal' ∘ Rat.cast)) ⊆ closure ↑K

Next tactic:
apply closure_mono
/-- The only closed subfields of `ℂ` are `ℝ` and `ℂ`. -/
theorem Complex.subfield_eq_of_closed {K : Subfield ℂ} (hc : IsClosed (K : Set ℂ)) :
    K = ofReal.fieldRange ∨ K = ⊤ := by
  suffices range (ofReal' : ℝ → ℂ) ⊆ K by
    rw [range_subset_iff, ← coe_algebraMap] at this
    have :=
      (Subalgebra.isSimpleOrder_of_finrank finrank_real_complex).eq_bot_or_eq_top
        (Subfield.toIntermediateField K this).toSubalgebra
    simp_rw [← SetLike.coe_set_eq, IntermediateField.coe_toSubalgebra] at this ⊢
    exact this
  suffices range (ofReal' : ℝ → ℂ) ⊆ closure (Set.range ((ofReal' : ℝ → ℂ) ∘ ((↑) : ℚ → ℝ))) by
    refine' subset_trans this _
    rw [← IsClosed.closure_eq hc]
    apply closure_mono
    

Proof state:
case h
K : Subfield ℂ
hc : IsClosed ↑K
this : range ofReal' ⊆ closure (range (ofReal' ∘ Rat.cast))
⊢ range (ofReal' ∘ Rat.cast) ⊆ ↑K

Next tactic:
rintro _ ⟨_, rfl⟩
/-- The only closed subfields of `ℂ` are `ℝ` and `ℂ`. -/
theorem Complex.subfield_eq_of_closed {K : Subfield ℂ} (hc : IsClosed (K : Set ℂ)) :
    K = ofReal.fieldRange ∨ K = ⊤ := by
  suffices range (ofReal' : ℝ → ℂ) ⊆ K by
    rw [range_subset_iff, ← coe_algebraMap] at this
    have :=
      (Subalgebra.isSimpleOrder_of_finrank finrank_real_complex).eq_bot_or_eq_top
        (Subfield.toIntermediateField K this).toSubalgebra
    simp_rw [← SetLike.coe_set_eq, IntermediateField.coe_toSubalgebra] at this ⊢
    exact this
  suffices range (ofReal' : ℝ → ℂ) ⊆ closure (Set.range ((ofReal' : ℝ → ℂ) ∘ ((↑) : ℚ → ℝ))) by
    refine' subset_trans this _
    rw [← IsClosed.closure_eq hc]
    apply closure_mono
    rintro _ ⟨_, rfl⟩
    

Proof state:
case h.intro
K : Subfield ℂ
hc : IsClosed ↑K
this : range ofReal' ⊆ closure (range (ofReal' ∘ Rat.cast))
w✝ : ℚ
⊢ (ofReal' ∘ Rat.cast) w✝ ∈ ↑K

Next tactic:
simp only [Function.comp_apply, ofReal_rat_cast, SetLike.mem_coe, SubfieldClass.coe_rat_mem]
/-- The only closed subfields of `ℂ` are `ℝ` and `ℂ`. -/
theorem Complex.subfield_eq_of_closed {K : Subfield ℂ} (hc : IsClosed (K : Set ℂ)) :
    K = ofReal.fieldRange ∨ K = ⊤ := by
  suffices range (ofReal' : ℝ → ℂ) ⊆ K by
    rw [range_subset_iff, ← coe_algebraMap] at this
    have :=
      (Subalgebra.isSimpleOrder_of_finrank finrank_real_complex).eq_bot_or_eq_top
        (Subfield.toIntermediateField K this).toSubalgebra
    simp_rw [← SetLike.coe_set_eq, IntermediateField.coe_toSubalgebra] at this ⊢
    exact this
  suffices range (ofReal' : ℝ → ℂ) ⊆ closure (Set.range ((ofReal' : ℝ → ℂ) ∘ ((↑) : ℚ → ℝ))) by
    refine' subset_trans this _
    rw [← IsClosed.closure_eq hc]
    apply closure_mono
    rintro _ ⟨_, rfl⟩
    simp only [Function.comp_apply, ofReal_rat_cast, SetLike.mem_coe, SubfieldClass.coe_rat_mem]
  

Proof state:
K : Subfield ℂ
hc : IsClosed ↑K
⊢ range ofReal' ⊆ closure (range (ofReal' ∘ Rat.cast))

Next tactic:
nth_rw 1 [range_comp]
/-- The only closed subfields of `ℂ` are `ℝ` and `ℂ`. -/
theorem Complex.subfield_eq_of_closed {K : Subfield ℂ} (hc : IsClosed (K : Set ℂ)) :
    K = ofReal.fieldRange ∨ K = ⊤ := by
  suffices range (ofReal' : ℝ → ℂ) ⊆ K by
    rw [range_subset_iff, ← coe_algebraMap] at this
    have :=
      (Subalgebra.isSimpleOrder_of_finrank finrank_real_complex).eq_bot_or_eq_top
        (Subfield.toIntermediateField K this).toSubalgebra
    simp_rw [← SetLike.coe_set_eq, IntermediateField.coe_toSubalgebra] at this ⊢
    exact this
  suffices range (ofReal' : ℝ → ℂ) ⊆ closure (Set.range ((ofReal' : ℝ → ℂ) ∘ ((↑) : ℚ → ℝ))) by
    refine' subset_trans this _
    rw [← IsClosed.closure_eq hc]
    apply closure_mono
    rintro _ ⟨_, rfl⟩
    simp only [Function.comp_apply, ofReal_rat_cast, SetLike.mem_coe, SubfieldClass.coe_rat_mem]
  nth_rw 1 [range_comp]
  

Proof state:
K : Subfield ℂ
hc : IsClosed ↑K
⊢ range ofReal' ⊆ closure (ofReal' '' range Rat.cast)

Next tactic:
refine' subset_trans _ (image_closure_subset_closure_image continuous_ofReal)
/-- The only closed subfields of `ℂ` are `ℝ` and `ℂ`. -/
theorem Complex.subfield_eq_of_closed {K : Subfield ℂ} (hc : IsClosed (K : Set ℂ)) :
    K = ofReal.fieldRange ∨ K = ⊤ := by
  suffices range (ofReal' : ℝ → ℂ) ⊆ K by
    rw [range_subset_iff, ← coe_algebraMap] at this
    have :=
      (Subalgebra.isSimpleOrder_of_finrank finrank_real_complex).eq_bot_or_eq_top
        (Subfield.toIntermediateField K this).toSubalgebra
    simp_rw [← SetLike.coe_set_eq, IntermediateField.coe_toSubalgebra] at this ⊢
    exact this
  suffices range (ofReal' : ℝ → ℂ) ⊆ closure (Set.range ((ofReal' : ℝ → ℂ) ∘ ((↑) : ℚ → ℝ))) by
    refine' subset_trans this _
    rw [← IsClosed.closure_eq hc]
    apply closure_mono
    rintro _ ⟨_, rfl⟩
    simp only [Function.comp_apply, ofReal_rat_cast, SetLike.mem_coe, SubfieldClass.coe_rat_mem]
  nth_rw 1 [range_comp]
  refine' subset_trans _ (image_closure_subset_closure_image continuous_ofReal)
  

Proof state:
K : Subfield ℂ
hc : IsClosed ↑K
⊢ range ofReal' ⊆ ofReal' '' closure (range Rat.cast)

Next tactic:
rw [DenseRange.closure_range Rat.denseEmbedding_coe_real.dense]
/-- The only closed subfields of `ℂ` are `ℝ` and `ℂ`. -/
theorem Complex.subfield_eq_of_closed {K : Subfield ℂ} (hc : IsClosed (K : Set ℂ)) :
    K = ofReal.fieldRange ∨ K = ⊤ := by
  suffices range (ofReal' : ℝ → ℂ) ⊆ K by
    rw [range_subset_iff, ← coe_algebraMap] at this
    have :=
      (Subalgebra.isSimpleOrder_of_finrank finrank_real_complex).eq_bot_or_eq_top
        (Subfield.toIntermediateField K this).toSubalgebra
    simp_rw [← SetLike.coe_set_eq, IntermediateField.coe_toSubalgebra] at this ⊢
    exact this
  suffices range (ofReal' : ℝ → ℂ) ⊆ closure (Set.range ((ofReal' : ℝ → ℂ) ∘ ((↑) : ℚ → ℝ))) by
    refine' subset_trans this _
    rw [← IsClosed.closure_eq hc]
    apply closure_mono
    rintro _ ⟨_, rfl⟩
    simp only [Function.comp_apply, ofReal_rat_cast, SetLike.mem_coe, SubfieldClass.coe_rat_mem]
  nth_rw 1 [range_comp]
  refine' subset_trans _ (image_closure_subset_closure_image continuous_ofReal)
  rw [DenseRange.closure_range Rat.denseEmbedding_coe_real.dense]
  

Proof state:
K : Subfield ℂ
hc : IsClosed ↑K
⊢ range ofReal' ⊆ ofReal' '' univ

Next tactic:
simp only [image_univ]
/-- The only closed subfields of `ℂ` are `ℝ` and `ℂ`. -/
theorem Complex.subfield_eq_of_closed {K : Subfield ℂ} (hc : IsClosed (K : Set ℂ)) :
    K = ofReal.fieldRange ∨ K = ⊤ := by
  suffices range (ofReal' : ℝ → ℂ) ⊆ K by
    rw [range_subset_iff, ← coe_algebraMap] at this
    have :=
      (Subalgebra.isSimpleOrder_of_finrank finrank_real_complex).eq_bot_or_eq_top
        (Subfield.toIntermediateField K this).toSubalgebra
    simp_rw [← SetLike.coe_set_eq, IntermediateField.coe_toSubalgebra] at this ⊢
    exact this
  suffices range (ofReal' : ℝ → ℂ) ⊆ closure (Set.range ((ofReal' : ℝ → ℂ) ∘ ((↑) : ℚ → ℝ))) by
    refine' subset_trans this _
    rw [← IsClosed.closure_eq hc]
    apply closure_mono
    rintro _ ⟨_, rfl⟩
    simp only [Function.comp_apply, ofReal_rat_cast, SetLike.mem_coe, SubfieldClass.coe_rat_mem]
  nth_rw 1 [range_comp]
  refine' subset_trans _ (image_closure_subset_closure_image continuous_ofReal)
  rw [DenseRange.closure_range Rat.denseEmbedding_coe_real.dense]
  simp only [image_univ]
  

Proof state:
K : Subfield ℂ
hc : IsClosed ↑K
⊢ range ofReal' ⊆ range ofReal'

Next tactic:
rfl
/-- 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
  

Proof state:
K : Subfield ℂ
ψ : ↥K →+* ℂ
hc : UniformContinuous ⇑ψ
⊢ ψ.toFun = ⇑(Subfield.subtype K) ∨ ψ.toFun = ⇑(starRingEnd ℂ) ∘ ⇑(Subfield.subtype K)

Next tactic:
letI : TopologicalDivisionRing ℂ := TopologicalDivisionRing.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
  

Proof state:
K : Subfield ℂ
ψ : ↥K →+* ℂ
hc : UniformContinuous ⇑ψ
this : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
⊢ ψ.toFun = ⇑(Subfield.subtype K) ∨ ψ.toFun = ⇑(starRingEnd ℂ) ∘ ⇑(Subfield.subtype K)

Next tactic:
letI : TopologicalRing K.topologicalClosure :=
    Subring.instTopologicalRing K.topologicalClosure.toSubring
/-- 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
  

Proof state:
K : Subfield ℂ
ψ : ↥K →+* ℂ
hc : UniformContinuous ⇑ψ
this✝ : TopologicalDivisionRing ℂ := TopologicalDivisionRing.mk
this : TopologicalRing ↥(Subfield.topologicalClosure K) :=
  Subring.instTopologicalRing (Subfield.topologicalClosure K).toSubring
⊢ ψ.toFun = ⇑(Subfield.subtype K) ∨ ψ.toFun = ⇑(starRingEnd ℂ) ∘ ⇑(Subfield.subtype K)

Next tactic:
set ι : K → K.topologicalClosure := ⇑(Subfield.inclusion K.le_topologicalClosure)
/-- 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)
  

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))
⊢ ψ.toFun = ⇑(Subfield.subtype K) ∨ ψ.toFun = ⇑(starRingEnd ℂ) ∘ ⇑(Subfield.subtype K)

Next tactic:
have ui : UniformInducing ι :=
    ⟨by
      erw [uniformity_subtype, uniformity_subtype, Filter.comap_comap]
      congr ⟩
/-- 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
      

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))
⊢ Filter.comap (fun x => (ι x.1, ι x.2)) (uniformity ↥(Subfield.topologicalClosure K)) = uniformity ↥K

Next tactic:
erw [uniformity_subtype, uniformity_subtype, Filter.comap_comap]
/-- 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]
      

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))
⊢ Filter.comap ((fun q => (↑q.1, ↑q.2)) ∘ fun x => (ι x.1, ι x.2)) (uniformity ℂ) =
    Filter.comap (fun q => (↑q.1, ↑q.2)) (uniformity ℂ)

Next tactic:
congr
/-- 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 ⟩
  

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 ι
⊢ ψ.toFun = ⇑(Subfield.subtype K) ∨ ψ.toFun = ⇑(starRingEnd ℂ) ∘ ⇑(Subfield.subtype K)

Next tactic:
let di := ui.denseInducing (?_ : DenseRange ι)
/-- 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 →+* ℂ
    

Proof state:
case refine_2
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
⊢ ψ.toFun = ⇑(Subfield.subtype K) ∨ ψ.toFun = ⇑(starRingEnd ℂ) ∘ ⇑(Subfield.subtype K)

Next tactic:
let extψ := DenseInducing.extendRingHom ui di.dense hc
/-- 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
    

Proof state:
case refine_2
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
⊢ ψ.toFun = ⇑(Subfield.subtype K) ∨ ψ.toFun = ⇑(starRingEnd ℂ) ∘ ⇑(Subfield.subtype K)

Next tactic:
haveI hψ := (uniformContinuous_uniformly_extend ui di.dense hc).continuous
/-- 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
    

Proof state:
case refine_2
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 ι) ⇑ψ)
⊢ ψ.toFun = ⇑(Subfield.subtype K) ∨ ψ.toFun = ⇑(starRingEnd ℂ) ∘ ⇑(Subfield.subtype K)

Next tactic:
cases' Complex.subfield_eq_of_closed (Subfield.isClosed_topologicalClosure K) with h 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
    · 

Proof state:
case refine_2.inl
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) ∨ ψ.toFun = ⇑(starRingEnd ℂ) ∘ ⇑(Subfield.subtype K)

Next tactic:
left