-- Mathlib/NumberTheory/NumberField/Embeddings.lean
lemma isUnramified_mk_iff_forall_isConj [IsGalois k K] {φ : K →+* ℂ} :
    IsUnramified k (mk φ) ↔ ∀ σ : K ≃ₐ[k] K, ComplexEmbedding.IsConj φ σ → σ = 1

Proof state:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
hφ : ¬ComplexEmbedding.IsConj φ 1 ∧ ComplexEmbedding.IsReal (φ.comp (algebraMap k K))
this✝¹ : Algebra k ℂ := (φ.comp (algebraMap k K)).toAlgebra
this✝ : Algebra K ℂ := φ.toAlgebra
this : IsScalarTower k K ℂ
r : k
⊢ (↑↑__src✝).toFun ((algebraMap k K) r) = (algebraMap k ℂ) r

Tactic:
simpa using RingHom.congr_fun hφ.2 r

Result:
no goals

Proof state:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
hφ : ¬ComplexEmbedding.IsConj φ 1 ∧ ComplexEmbedding.IsReal (φ.comp (algebraMap k K))
⊢ False

Tactic:
letI := (φ.comp (algebraMap k K)).toAlgebra

Result:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
hφ : ¬ComplexEmbedding.IsConj φ 1 ∧ ComplexEmbedding.IsReal (φ.comp (algebraMap k K))
this : Algebra k ℂ := (φ.comp (algebraMap k K)).toAlgebra
⊢ False

Proof state:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
hφ : ¬ComplexEmbedding.IsConj φ 1 ∧ ComplexEmbedding.IsReal (φ.comp (algebraMap k K))
this✝ : Algebra k ℂ := (φ.comp (algebraMap k K)).toAlgebra
this : Algebra K ℂ := φ.toAlgebra
⊢ False

Tactic:
have : IsScalarTower k K ℂ := IsScalarTower.of_algebraMap_eq' rfl

Result:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
hφ : ¬ComplexEmbedding.IsConj φ 1 ∧ ComplexEmbedding.IsReal (φ.comp (algebraMap k K))
this✝¹ : Algebra k ℂ := (φ.comp (algebraMap k K)).toAlgebra
this✝ : Algebra K ℂ := φ.toAlgebra
this : IsScalarTower k K ℂ
⊢ False

Proof state:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
⊢ IsUnramified k (mk φ) ↔ ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1

Tactic:
refine ⟨fun H σ hσ ↦ hσ.isUnramified_mk_iff.mp H,
  fun H ↦ ?_⟩

Result:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
⊢ IsUnramified k (mk φ)

Proof state:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
hφ : ¬ComplexEmbedding.IsConj φ 1 ∧ ComplexEmbedding.IsReal (φ.comp (algebraMap k K))
this✝¹ : Algebra k ℂ := (φ.comp (algebraMap k K)).toAlgebra
this✝ : Algebra K ℂ := φ.toAlgebra
this : IsScalarTower k K ℂ
φ' : K →ₐ[k] ℂ :=
  let __src := star φ;
  { toRingHom := __src, commutes' := ⋯ }
⊢ False

Tactic:
have : ComplexEmbedding.IsConj φ (AlgHom.restrictNormal' φ' K) :=
  (RingHom.ext <| AlgHom.restrictNormal_commutes φ' K).symm

Result:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
hφ : ¬ComplexEmbedding.IsConj φ 1 ∧ ComplexEmbedding.IsReal (φ.comp (algebraMap k K))
this✝² : Algebra k ℂ := (φ.comp (algebraMap k K)).toAlgebra
this✝¹ : Algebra K ℂ := φ.toAlgebra
this✝ : IsScalarTower k K ℂ
φ' : K →ₐ[k] ℂ :=
  let __src := star φ;
  { toRingHom := __src, commutes' := ⋯ }
this : ComplexEmbedding.IsConj φ (φ'.restrictNormal' K)
⊢ False

Proof state:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
hφ : ¬ComplexEmbedding.IsConj φ 1 ∧ ComplexEmbedding.IsReal (φ.comp (algebraMap k K))
this✝² : Algebra k ℂ := (φ.comp (algebraMap k K)).toAlgebra
this✝¹ : Algebra K ℂ := φ.toAlgebra
this✝ : IsScalarTower k K ℂ
φ' : K →ₐ[k] ℂ :=
  let __src := star φ;
  { toRingHom := __src, commutes' := ⋯ }
this : ComplexEmbedding.IsConj φ (φ'.restrictNormal' K)
⊢ False

Tactic:
exact hφ.1 (H _ this ▸ this)

Result:
no goals

Proof state:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
hφ : ¬ComplexEmbedding.IsConj φ 1 ∧ ComplexEmbedding.IsReal (φ.comp (algebraMap k K))
this✝¹ : Algebra k ℂ := (φ.comp (algebraMap k K)).toAlgebra
this✝ : Algebra K ℂ := φ.toAlgebra
this : IsScalarTower k K ℂ
⊢ False

Tactic:
let φ' : K →ₐ[k] ℂ := { star φ with commutes' := fun r ↦ by simpa using RingHom.congr_fun hφ.2 r }

Result:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
hφ : ¬ComplexEmbedding.IsConj φ 1 ∧ ComplexEmbedding.IsReal (φ.comp (algebraMap k K))
this✝¹ : Algebra k ℂ := (φ.comp (algebraMap k K)).toAlgebra
this✝ : Algebra K ℂ := φ.toAlgebra
this : IsScalarTower k K ℂ
φ' : K →ₐ[k] ℂ :=
  let __src := star φ;
  { toRingHom := __src, commutes' := ⋯ }
⊢ False

Proof state:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
hφ : ¬IsUnramified k (mk φ)
⊢ False

Tactic:
rw [not_isUnramified_iff] at hφ

Result:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
hφ : (mk φ).IsComplex ∧ ((mk φ).comap (algebraMap k K)).IsReal
⊢ False

Proof state:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
hφ : ¬ComplexEmbedding.IsConj φ 1 ∧ ComplexEmbedding.IsReal (φ.comp (algebraMap k K))
this : Algebra k ℂ := (φ.comp (algebraMap k K)).toAlgebra
⊢ False

Tactic:
letI := φ.toAlgebra

Result:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
hφ : ¬ComplexEmbedding.IsConj φ 1 ∧ ComplexEmbedding.IsReal (φ.comp (algebraMap k K))
this✝ : Algebra k ℂ := (φ.comp (algebraMap k K)).toAlgebra
this : Algebra K ℂ := φ.toAlgebra
⊢ False

Proof state:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
hφ : (mk φ).IsComplex ∧ ((mk φ).comap (algebraMap k K)).IsReal
⊢ False

Tactic:
rw [comap_mk, isReal_mk_iff, ← not_isReal_iff_isComplex, isReal_mk_iff,
  ← ComplexEmbedding.isConj_one_iff (k := k)] at hφ

Result:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
hφ : ¬ComplexEmbedding.IsConj φ 1 ∧ ComplexEmbedding.IsReal (φ.comp (algebraMap k K))
⊢ False

Proof state:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
⊢ IsUnramified k (mk φ)

Tactic:
by_contra hφ

Result:
k : Type u_1
inst✝³ : Field k
K : Type u_2
inst✝² : Field K
inst✝¹ : Algebra k K
inst✝ : IsGalois k K
φ : K →+* ℂ
H : ∀ (σ : K ≃ₐ[k] K), ComplexEmbedding.IsConj φ σ → σ = 1
hφ : ¬IsUnramified k (mk φ)
⊢ False