l3lab/ntp-mathlib huggingface dataset:
@[to_additive] -- Porting note: was `@[simp]`
theorem integral_div_left_eq_self (f : G → E) (μ : Measure G) [IsInvInvariant μ]
    [IsMulLeftInvariant μ] (x' : G) : (∫ x, f (x' / x) ∂μ) = ∫ x, f x ∂μ := by
  

Proof state:
𝕜 : Type u_1
M : Type u_2
α : Type u_3
G : Type u_4
E : Type u_5
F : Type u_6
inst✝⁹ : MeasurableSpace G
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : CompleteSpace E
inst✝⁵ : NormedAddCommGroup F
μ✝ : Measure G
f✝ : G → E
g : G
inst✝⁴ : Group G
inst✝³ : MeasurableMul G
inst✝² : MeasurableInv G
f : G → E
μ : Measure G
inst✝¹ : IsInvInvariant μ
inst✝ : IsMulLeftInvariant μ
x' : G
⊢ ∫ (x : G), f (x' / x) ∂μ = ∫ (x : G), f x ∂μ

Next tactic:
simp_rw [div_eq_mul_inv]
@[to_additive] -- Porting note: was `@[simp]`
theorem integral_div_left_eq_self (f : G → E) (μ : Measure G) [IsInvInvariant μ]
    [IsMulLeftInvariant μ] (x' : G) : (∫ x, f (x' / x) ∂μ) = ∫ x, f x ∂μ := by
  simp_rw [div_eq_mul_inv]
  -- Porting note: was `simp_rw`
  

Proof state:
𝕜 : Type u_1
M : Type u_2
α : Type u_3
G : Type u_4
E : Type u_5
F : Type u_6
inst✝⁹ : MeasurableSpace G
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : CompleteSpace E
inst✝⁵ : NormedAddCommGroup F
μ✝ : Measure G
f✝ : G → E
g : G
inst✝⁴ : Group G
inst✝³ : MeasurableMul G
inst✝² : MeasurableInv G
f : G → E
μ : Measure G
inst✝¹ : IsInvInvariant μ
inst✝ : IsMulLeftInvariant μ
x' : G
⊢ ∫ (x : G), f (x' * x⁻¹) ∂μ = ∫ (x : G), f x ∂μ

Next tactic:
rw [integral_inv_eq_self (fun x => f (x' * x)) μ, integral_mul_left_eq_self f x']
@[to_additive] -- Porting note: was `@[simp]`
theorem integral_smul_eq_self {μ : Measure α} [SMulInvariantMeasure G α μ] (f : α → E) {g : G} :
    (∫ x, f (g • x) ∂μ) = ∫ x, f x ∂μ := by
  

Proof state:
𝕜 : Type u_1
M : Type u_2
α : Type u_3
G : Type u_4
E : Type u_5
F : Type u_6
inst✝⁹ : MeasurableSpace G
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : CompleteSpace E
inst✝⁵ : NormedAddCommGroup F
μ✝ : Measure G
f✝ : G → E
g✝ : G
inst✝⁴ : Group G
inst✝³ : MeasurableSpace α
inst✝² : MulAction G α
inst✝¹ : MeasurableSMul G α
μ : Measure α
inst✝ : SMulInvariantMeasure G α μ
f : α → E
g : G
⊢ ∫ (x : α), f (g • x) ∂μ = ∫ (x : α), f x ∂μ

Next tactic:
have h : MeasurableEmbedding fun x : α => g • x := (MeasurableEquiv.smul g).measurableEmbedding
@[to_additive] -- Porting note: was `@[simp]`
theorem integral_smul_eq_self {μ : Measure α} [SMulInvariantMeasure G α μ] (f : α → E) {g : G} :
    (∫ x, f (g • x) ∂μ) = ∫ x, f x ∂μ := by
  have h : MeasurableEmbedding fun x : α => g • x := (MeasurableEquiv.smul g).measurableEmbedding
  

Proof state:
𝕜 : Type u_1
M : Type u_2
α : Type u_3
G : Type u_4
E : Type u_5
F : Type u_6
inst✝⁹ : MeasurableSpace G
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : CompleteSpace E
inst✝⁵ : NormedAddCommGroup F
μ✝ : Measure G
f✝ : G → E
g✝ : G
inst✝⁴ : Group G
inst✝³ : MeasurableSpace α
inst✝² : MulAction G α
inst✝¹ : MeasurableSMul G α
μ : Measure α
inst✝ : SMulInvariantMeasure G α μ
f : α → E
g : G
h : MeasurableEmbedding fun x => g • x
⊢ ∫ (x : α), f (g • x) ∂μ = ∫ (x : α), f x ∂μ

Next tactic:
rw [← h.integral_map, map_smul]
lemma normalClosure_le_iSup_adjoin :
    normalClosure F K L ≤ ⨆ x : K, IntermediateField.adjoin F ((minpoly F x).rootSet L) :=
  iSup_le fun f _ ⟨x, hx⟩ ↦ le_iSup (α := IntermediateField F L) _ x <|
    IntermediateField.subset_adjoin F _ <| by
      

Proof state:
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
alg : IsAlgebraic F K
f : K →ₐ[F] L
x✝¹ : L
x✝ : x✝¹ ∈ AlgHom.fieldRange f
x : K
hx : ↑f x = x✝¹
⊢ x✝¹ ∈ rootSet (minpoly F x) L

Next tactic:
rw [mem_rootSet_of_ne (minpoly.ne_zero <| isAlgebraic_iff_isIntegral.mp <| alg x), ← hx,
        AlgHom.toRingHom_eq_coe, AlgHom.coe_toRingHom, aeval_algHom_apply, minpoly.aeval, map_zero]
/-- If `K/F` is algebraic, the "generated by roots" condition in IsNormalClosure can be replaced
  by "generated by images of embeddings".-/
lemma isNormalClosure_iff : IsNormalClosure F K L ↔
    (∀ x : K, (minpoly F x).Splits (algebraMap F L)) ∧ normalClosure F K L = ⊤ := by
  

Proof state:
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
alg : IsAlgebraic F K
splits : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
⊢ IsNormalClosure F K L ↔ (∀ (x : K), Splits (algebraMap F L) (minpoly F x)) ∧ normalClosure F K L = ⊤

Next tactic:
refine ⟨fun ⟨splits, h⟩ ↦ ⟨splits, ?_⟩, fun ⟨splits, h⟩ ↦ ⟨splits, ?_⟩⟩
/-- If `K/F` is algebraic, the "generated by roots" condition in IsNormalClosure can be replaced
  by "generated by images of embeddings".-/
lemma isNormalClosure_iff : IsNormalClosure F K L ↔
    (∀ x : K, (minpoly F x).Splits (algebraMap F L)) ∧ normalClosure F K L = ⊤ := by
  refine ⟨fun ⟨splits, h⟩ ↦ ⟨splits, ?_⟩, fun ⟨splits, h⟩ ↦ ⟨splits, ?_⟩⟩ <;>
    

Proof state:
case refine_1
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
alg : IsAlgebraic F K
splits✝ : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
x✝ : IsNormalClosure F K L
splits : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
h : ⨆ x, IntermediateField.adjoin F (rootSet (minpoly F x) L) = ⊤
⊢ normalClosure F K L = ⊤

Next tactic:
simpa only [alg.normalClosure_eq_iSup_adjoin_of_splits splits] using h
/-- If `K/F` is algebraic, the "generated by roots" condition in IsNormalClosure can be replaced
  by "generated by images of embeddings".-/
lemma isNormalClosure_iff : IsNormalClosure F K L ↔
    (∀ x : K, (minpoly F x).Splits (algebraMap F L)) ∧ normalClosure F K L = ⊤ := by
  refine ⟨fun ⟨splits, h⟩ ↦ ⟨splits, ?_⟩, fun ⟨splits, h⟩ ↦ ⟨splits, ?_⟩⟩ <;>
    

Proof state:
case refine_2
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
alg : IsAlgebraic F K
splits✝ : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
x✝ : (∀ (x : K), Splits (algebraMap F L) (minpoly F x)) ∧ normalClosure F K L = ⊤
splits : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
h : normalClosure F K L = ⊤
⊢ ⨆ x, IntermediateField.adjoin F (rootSet (minpoly F x) L) = ⊤

Next tactic:
simpa only [alg.normalClosure_eq_iSup_adjoin_of_splits splits] using h
/-- `normalClosure F K L` is a valid normal closure if `K/F` is algebraic
  and all minimal polynomials of `K/F` splits in `L/F`. -/
lemma isNormalClosure_normalClosure : IsNormalClosure F K (normalClosure F K L) := by
  

Proof state:
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
alg : IsAlgebraic F K
splits : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
⊢ IsNormalClosure F K ↥(normalClosure F K L)

Next tactic:
rw [alg.isNormalClosure_iff]
/-- `normalClosure F K L` is a valid normal closure if `K/F` is algebraic
  and all minimal polynomials of `K/F` splits in `L/F`. -/
lemma isNormalClosure_normalClosure : IsNormalClosure F K (normalClosure F K L) := by
  rw [alg.isNormalClosure_iff]; 

Proof state:
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
alg : IsAlgebraic F K
splits : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
⊢ (∀ (x : K), Splits (algebraMap F ↥(normalClosure F K L)) (minpoly F x)) ∧ normalClosure F K ↥(normalClosure F K L) = ⊤

Next tactic:
constructor
/-- `normalClosure F K L` is a valid normal closure if `K/F` is algebraic
  and all minimal polynomials of `K/F` splits in `L/F`. -/
lemma isNormalClosure_normalClosure : IsNormalClosure F K (normalClosure F K L) := by
  rw [alg.isNormalClosure_iff]; constructor
  · 

Proof state:
case left
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
alg : IsAlgebraic F K
splits : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
⊢ ∀ (x : K), Splits (algebraMap F ↥(normalClosure F K L)) (minpoly F x)

Next tactic:
rw [alg.normalClosure_eq_iSup_adjoin_of_splits splits]
/-- `normalClosure F K L` is a valid normal closure if `K/F` is algebraic
  and all minimal polynomials of `K/F` splits in `L/F`. -/
lemma isNormalClosure_normalClosure : IsNormalClosure F K (normalClosure F K L) := by
  rw [alg.isNormalClosure_iff]; constructor
  · rw [alg.normalClosure_eq_iSup_adjoin_of_splits splits]
    

Proof state:
case left
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
alg : IsAlgebraic F K
splits : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
⊢ ∀ (x : K), Splits (algebraMap F ↥(⨆ x, IntermediateField.adjoin F (rootSet (minpoly F x) L))) (minpoly F x)

Next tactic:
exact fun x ↦ splits_of_splits (splits x) ((IntermediateField.subset_adjoin F _).trans <|
      SetLike.coe_subset_coe.mpr <| by apply le_iSup _ x)
/-- `normalClosure F K L` is a valid normal closure if `K/F` is algebraic
  and all minimal polynomials of `K/F` splits in `L/F`. -/
lemma isNormalClosure_normalClosure : IsNormalClosure F K (normalClosure F K L) := by
  rw [alg.isNormalClosure_iff]; constructor
  · rw [alg.normalClosure_eq_iSup_adjoin_of_splits splits]
    exact fun x ↦ splits_of_splits (splits x) ((IntermediateField.subset_adjoin F _).trans <|
      SetLike.coe_subset_coe.mpr <| by 

Proof state:
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
alg : IsAlgebraic F K
splits : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
x : K
⊢ IntermediateField.adjoin F (rootSet (minpoly F x) L) ≤ ⨆ x, IntermediateField.adjoin F (rootSet (minpoly F x) L)

Next tactic:
apply le_iSup _ x
/-- `normalClosure F K L` is a valid normal closure if `K/F` is algebraic
  and all minimal polynomials of `K/F` splits in `L/F`. -/
lemma isNormalClosure_normalClosure : IsNormalClosure F K (normalClosure F K L) := by
  rw [alg.isNormalClosure_iff]; constructor
  · rw [alg.normalClosure_eq_iSup_adjoin_of_splits splits]
    exact fun x ↦ splits_of_splits (splits x) ((IntermediateField.subset_adjoin F _).trans <|
      SetLike.coe_subset_coe.mpr <| by apply le_iSup _ x)
  

Proof state:
case right
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
alg : IsAlgebraic F K
splits : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
⊢ normalClosure F K ↥(normalClosure F K L) = ⊤

Next tactic:
simp_rw [normalClosure, ← top_le_iff]
/-- `normalClosure F K L` is a valid normal closure if `K/F` is algebraic
  and all minimal polynomials of `K/F` splits in `L/F`. -/
lemma isNormalClosure_normalClosure : IsNormalClosure F K (normalClosure F K L) := by
  rw [alg.isNormalClosure_iff]; constructor
  · rw [alg.normalClosure_eq_iSup_adjoin_of_splits splits]
    exact fun x ↦ splits_of_splits (splits x) ((IntermediateField.subset_adjoin F _).trans <|
      SetLike.coe_subset_coe.mpr <| by apply le_iSup _ x)
  simp_rw [normalClosure, ← top_le_iff]
  

Proof state:
case right
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
alg : IsAlgebraic F K
splits : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
⊢ ⊤ ≤ ⨆ f, AlgHom.fieldRange f

Next tactic:
refine fun x _ ↦ (IntermediateField.val _).injective.mem_set_image.mp ?_
/-- `normalClosure F K L` is a valid normal closure if `K/F` is algebraic
  and all minimal polynomials of `K/F` splits in `L/F`. -/
lemma isNormalClosure_normalClosure : IsNormalClosure F K (normalClosure F K L) := by
  rw [alg.isNormalClosure_iff]; constructor
  · rw [alg.normalClosure_eq_iSup_adjoin_of_splits splits]
    exact fun x ↦ splits_of_splits (splits x) ((IntermediateField.subset_adjoin F _).trans <|
      SetLike.coe_subset_coe.mpr <| by apply le_iSup _ x)
  simp_rw [normalClosure, ← top_le_iff]
  refine fun x _ ↦ (IntermediateField.val _).injective.mem_set_image.mp ?_
  

Proof state:
case right
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
alg : IsAlgebraic F K
splits : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
x : ↥(⨆ f, AlgHom.fieldRange f)
x✝ : x ∈ ⊤
⊢ ↑(val (⨆ f, AlgHom.fieldRange f)) x ∈ ⇑↑(val (⨆ f, AlgHom.fieldRange f)) '' ↑(⨆ f, AlgHom.fieldRange f)

Next tactic:
change x.val ∈ IntermediateField.map (IntermediateField.val _) _
/-- `normalClosure F K L` is a valid normal closure if `K/F` is algebraic
  and all minimal polynomials of `K/F` splits in `L/F`. -/
lemma isNormalClosure_normalClosure : IsNormalClosure F K (normalClosure F K L) := by
  rw [alg.isNormalClosure_iff]; constructor
  · rw [alg.normalClosure_eq_iSup_adjoin_of_splits splits]
    exact fun x ↦ splits_of_splits (splits x) ((IntermediateField.subset_adjoin F _).trans <|
      SetLike.coe_subset_coe.mpr <| by apply le_iSup _ x)
  simp_rw [normalClosure, ← top_le_iff]
  refine fun x _ ↦ (IntermediateField.val _).injective.mem_set_image.mp ?_
  change x.val ∈ IntermediateField.map (IntermediateField.val _) _
  

Proof state:
case right
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
alg : IsAlgebraic F K
splits : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
x : ↥(⨆ f, AlgHom.fieldRange f)
x✝ : x ∈ ⊤
⊢ ↑x ∈ IntermediateField.map (val (⨆ f, AlgHom.fieldRange f)) (⨆ f, AlgHom.fieldRange f)

Next tactic:
rw [IntermediateField.map_iSup]
/-- `normalClosure F K L` is a valid normal closure if `K/F` is algebraic
  and all minimal polynomials of `K/F` splits in `L/F`. -/
lemma isNormalClosure_normalClosure : IsNormalClosure F K (normalClosure F K L) := by
  rw [alg.isNormalClosure_iff]; constructor
  · rw [alg.normalClosure_eq_iSup_adjoin_of_splits splits]
    exact fun x ↦ splits_of_splits (splits x) ((IntermediateField.subset_adjoin F _).trans <|
      SetLike.coe_subset_coe.mpr <| by apply le_iSup _ x)
  simp_rw [normalClosure, ← top_le_iff]
  refine fun x _ ↦ (IntermediateField.val _).injective.mem_set_image.mp ?_
  change x.val ∈ IntermediateField.map (IntermediateField.val _) _
  rw [IntermediateField.map_iSup]
  

Proof state:
case right
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
alg : IsAlgebraic F K
splits : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
x : ↥(⨆ f, AlgHom.fieldRange f)
x✝ : x ∈ ⊤
⊢ ↑x ∈ ⨆ i, IntermediateField.map (val (⨆ f, AlgHom.fieldRange f)) (AlgHom.fieldRange i)

Next tactic:
refine (iSup_le fun f ↦ ?_ : normalClosure F K L ≤ _) x.2
/-- `normalClosure F K L` is a valid normal closure if `K/F` is algebraic
  and all minimal polynomials of `K/F` splits in `L/F`. -/
lemma isNormalClosure_normalClosure : IsNormalClosure F K (normalClosure F K L) := by
  rw [alg.isNormalClosure_iff]; constructor
  · rw [alg.normalClosure_eq_iSup_adjoin_of_splits splits]
    exact fun x ↦ splits_of_splits (splits x) ((IntermediateField.subset_adjoin F _).trans <|
      SetLike.coe_subset_coe.mpr <| by apply le_iSup _ x)
  simp_rw [normalClosure, ← top_le_iff]
  refine fun x _ ↦ (IntermediateField.val _).injective.mem_set_image.mp ?_
  change x.val ∈ IntermediateField.map (IntermediateField.val _) _
  rw [IntermediateField.map_iSup]
  refine (iSup_le fun f ↦ ?_ : normalClosure F K L ≤ _) x.2
  

Proof state:
case right
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
alg : IsAlgebraic F K
splits : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
x : ↥(⨆ f, AlgHom.fieldRange f)
x✝ : x ∈ ⊤
f : K →ₐ[F] L
⊢ AlgHom.fieldRange f ≤ ⨆ i, IntermediateField.map (val (⨆ f, AlgHom.fieldRange f)) (AlgHom.fieldRange i)

Next tactic:
refine le_iSup_of_le (f.codRestrict _ fun x ↦ f.fieldRange_le_normalClosure ⟨x, rfl⟩) ?_
/-- `normalClosure F K L` is a valid normal closure if `K/F` is algebraic
  and all minimal polynomials of `K/F` splits in `L/F`. -/
lemma isNormalClosure_normalClosure : IsNormalClosure F K (normalClosure F K L) := by
  rw [alg.isNormalClosure_iff]; constructor
  · rw [alg.normalClosure_eq_iSup_adjoin_of_splits splits]
    exact fun x ↦ splits_of_splits (splits x) ((IntermediateField.subset_adjoin F _).trans <|
      SetLike.coe_subset_coe.mpr <| by apply le_iSup _ x)
  simp_rw [normalClosure, ← top_le_iff]
  refine fun x _ ↦ (IntermediateField.val _).injective.mem_set_image.mp ?_
  change x.val ∈ IntermediateField.map (IntermediateField.val _) _
  rw [IntermediateField.map_iSup]
  refine (iSup_le fun f ↦ ?_ : normalClosure F K L ≤ _) x.2
  refine le_iSup_of_le (f.codRestrict _ fun x ↦ f.fieldRange_le_normalClosure ⟨x, rfl⟩) ?_
  

Proof state:
case right
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
alg : IsAlgebraic F K
splits : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
x : ↥(⨆ f, AlgHom.fieldRange f)
x✝ : x ∈ ⊤
f : K →ₐ[F] L
⊢ AlgHom.fieldRange f ≤
    IntermediateField.map (val (⨆ f, AlgHom.fieldRange f))
      (AlgHom.fieldRange
        (AlgHom.codRestrict f (⨆ f, AlgHom.fieldRange f).toSubalgebra (_ : ∀ (x : K), f x ∈ normalClosure F K L)))

Next tactic:
rw [AlgHom.map_fieldRange, val, AlgHom.val_comp_codRestrict]
/-- A normal closure of `K/F` embeds into any `L/F`
  where the minimal polynomials of `K/F` splits. -/
noncomputable def IsNormalClosure.lift [h : IsNormalClosure F K L] {L'} [Field L'] [Algebra F L']
    (splits : ∀ x : K, (minpoly F x).Splits (algebraMap F L')) : L →ₐ[F] L' := by
  

Proof state:
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁶ : Field F
inst✝⁵ : Field K
inst✝⁴ : Field L
inst✝³ : Algebra F K
inst✝² : Algebra F L
h : IsNormalClosure F K L
L' : Type ?u.157531
inst✝¹ : Field L'
inst✝ : Algebra F L'
splits : ∀ (x : K), Splits (algebraMap F L') (minpoly F x)
⊢ L →ₐ[F] L'

Next tactic:
have := h.adjoin_rootSet
/-- A normal closure of `K/F` embeds into any `L/F`
  where the minimal polynomials of `K/F` splits. -/
noncomputable def IsNormalClosure.lift [h : IsNormalClosure F K L] {L'} [Field L'] [Algebra F L']
    (splits : ∀ x : K, (minpoly F x).Splits (algebraMap F L')) : L →ₐ[F] L' := by
  have := h.adjoin_rootSet; 

Proof state:
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁶ : Field F
inst✝⁵ : Field K
inst✝⁴ : Field L
inst✝³ : Algebra F K
inst✝² : Algebra F L
h : IsNormalClosure F K L
L' : Type ?u.157531
inst✝¹ : Field L'
inst✝ : Algebra F L'
splits : ∀ (x : K), Splits (algebraMap F L') (minpoly F x)
this : ⨆ x, adjoin F (rootSet (minpoly F x) L) = ⊤
⊢ L →ₐ[F] L'

Next tactic:
rw [← gc.l_iSup] at this
/-- A normal closure of `K/F` embeds into any `L/F`
  where the minimal polynomials of `K/F` splits. -/
noncomputable def IsNormalClosure.lift [h : IsNormalClosure F K L] {L'} [Field L'] [Algebra F L']
    (splits : ∀ x : K, (minpoly F x).Splits (algebraMap F L')) : L →ₐ[F] L' := by
  have := h.adjoin_rootSet; rw [← gc.l_iSup] at this
  

Proof state:
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁶ : Field F
inst✝⁵ : Field K
inst✝⁴ : Field L
inst✝³ : Algebra F K
inst✝² : Algebra F L
h : IsNormalClosure F K L
L' : Type ?u.157531
inst✝¹ : Field L'
inst✝ : Algebra F L'
splits : ∀ (x : K), Splits (algebraMap F L') (minpoly F x)
this : adjoin F (⨆ x, rootSet (minpoly F x) L) = ⊤
⊢ L →ₐ[F] L'

Next tactic:
refine Nonempty.some <| nonempty_algHom_of_adjoin_splits
    (fun x hx ↦ ⟨isAlgebraic_iff_isIntegral.mp (Normal.isAlgebraic h.normal x), ?_⟩) this
/-- A normal closure of `K/F` embeds into any `L/F`
  where the minimal polynomials of `K/F` splits. -/
noncomputable def IsNormalClosure.lift [h : IsNormalClosure F K L] {L'} [Field L'] [Algebra F L']
    (splits : ∀ x : K, (minpoly F x).Splits (algebraMap F L')) : L →ₐ[F] L' := by
  have := h.adjoin_rootSet; rw [← gc.l_iSup] at this
  refine Nonempty.some <| nonempty_algHom_of_adjoin_splits
    (fun x hx ↦ ⟨isAlgebraic_iff_isIntegral.mp (Normal.isAlgebraic h.normal x), ?_⟩) this
  

Proof state:
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁶ : Field F
inst✝⁵ : Field K
inst✝⁴ : Field L
inst✝³ : Algebra F K
inst✝² : Algebra F L
h : IsNormalClosure F K L
L' : Type ?u.157531
inst✝¹ : Field L'
inst✝ : Algebra F L'
splits : ∀ (x : K), Splits (algebraMap F L') (minpoly F x)
this : adjoin F (⨆ x, rootSet (minpoly F x) L) = ⊤
x : L
hx : x ∈ ⨆ x, rootSet (minpoly F x) L
⊢ Splits (algebraMap F L') (minpoly F x)

Next tactic:
obtain ⟨y, hx⟩ := Set.mem_iUnion.mp hx
/-- A normal closure of `K/F` embeds into any `L/F`
  where the minimal polynomials of `K/F` splits. -/
noncomputable def IsNormalClosure.lift [h : IsNormalClosure F K L] {L'} [Field L'] [Algebra F L']
    (splits : ∀ x : K, (minpoly F x).Splits (algebraMap F L')) : L →ₐ[F] L' := by
  have := h.adjoin_rootSet; rw [← gc.l_iSup] at this
  refine Nonempty.some <| nonempty_algHom_of_adjoin_splits
    (fun x hx ↦ ⟨isAlgebraic_iff_isIntegral.mp (Normal.isAlgebraic h.normal x), ?_⟩) this
  obtain ⟨y, hx⟩ := Set.mem_iUnion.mp hx
  

Proof state:
case intro
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁶ : Field F
inst✝⁵ : Field K
inst✝⁴ : Field L
inst✝³ : Algebra F K
inst✝² : Algebra F L
h : IsNormalClosure F K L
L' : Type ?u.157531
inst✝¹ : Field L'
inst✝ : Algebra F L'
splits : ∀ (x : K), Splits (algebraMap F L') (minpoly F x)
this : adjoin F (⨆ x, rootSet (minpoly F x) L) = ⊤
x : L
hx✝ : x ∈ ⨆ x, rootSet (minpoly F x) L
y : K
hx : x ∈ rootSet (minpoly F y) L
⊢ Splits (algebraMap F L') (minpoly F x)

Next tactic:
by_cases iy : IsIntegral F y
/-- A normal closure of `K/F` embeds into any `L/F`
  where the minimal polynomials of `K/F` splits. -/
noncomputable def IsNormalClosure.lift [h : IsNormalClosure F K L] {L'} [Field L'] [Algebra F L']
    (splits : ∀ x : K, (minpoly F x).Splits (algebraMap F L')) : L →ₐ[F] L' := by
  have := h.adjoin_rootSet; rw [← gc.l_iSup] at this
  refine Nonempty.some <| nonempty_algHom_of_adjoin_splits
    (fun x hx ↦ ⟨isAlgebraic_iff_isIntegral.mp (Normal.isAlgebraic h.normal x), ?_⟩) this
  obtain ⟨y, hx⟩ := Set.mem_iUnion.mp hx
  by_cases iy : IsIntegral F y
  · 

Proof state:
case pos
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁶ : Field F
inst✝⁵ : Field K
inst✝⁴ : Field L
inst✝³ : Algebra F K
inst✝² : Algebra F L
h : IsNormalClosure F K L
L' : Type ?u.157531
inst✝¹ : Field L'
inst✝ : Algebra F L'
splits : ∀ (x : K), Splits (algebraMap F L') (minpoly F x)
this : adjoin F (⨆ x, rootSet (minpoly F x) L) = ⊤
x : L
hx✝ : x ∈ ⨆ x, rootSet (minpoly F x) L
y : K
hx : x ∈ rootSet (minpoly F y) L
iy : IsIntegral F y
⊢ Splits (algebraMap F L') (minpoly F x)

Next tactic:
exact splits_of_splits_of_dvd _ (minpoly.ne_zero iy)
      (splits y) (minpoly.dvd F x (mem_rootSet.mp hx).2)
/-- A normal closure of `K/F` embeds into any `L/F`
  where the minimal polynomials of `K/F` splits. -/
noncomputable def IsNormalClosure.lift [h : IsNormalClosure F K L] {L'} [Field L'] [Algebra F L']
    (splits : ∀ x : K, (minpoly F x).Splits (algebraMap F L')) : L →ₐ[F] L' := by
  have := h.adjoin_rootSet; rw [← gc.l_iSup] at this
  refine Nonempty.some <| nonempty_algHom_of_adjoin_splits
    (fun x hx ↦ ⟨isAlgebraic_iff_isIntegral.mp (Normal.isAlgebraic h.normal x), ?_⟩) this
  obtain ⟨y, hx⟩ := Set.mem_iUnion.mp hx
  by_cases iy : IsIntegral F y
  · exact splits_of_splits_of_dvd _ (minpoly.ne_zero iy)
      (splits y) (minpoly.dvd F x (mem_rootSet.mp hx).2)
  · 

Proof state:
case neg
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁶ : Field F
inst✝⁵ : Field K
inst✝⁴ : Field L
inst✝³ : Algebra F K
inst✝² : Algebra F L
h : IsNormalClosure F K L
L' : Type ?u.157531
inst✝¹ : Field L'
inst✝ : Algebra F L'
splits : ∀ (x : K), Splits (algebraMap F L') (minpoly F x)
this : adjoin F (⨆ x, rootSet (minpoly F x) L) = ⊤
x : L
hx✝ : x ∈ ⨆ x, rootSet (minpoly F x) L
y : K
hx : x ∈ rootSet (minpoly F y) L
iy : ¬IsIntegral F y
⊢ Splits (algebraMap F L') (minpoly F x)

Next tactic:
simp [minpoly.eq_zero iy] at hx
instance isNormalClosure_normalClosure [ne : Nonempty (K →ₐ[F] L)] [h : Normal F L] :
    IsNormalClosure F K (normalClosure F K L) := by
  

Proof state:
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F K
inst✝ : Algebra F L
ne : Nonempty (K →ₐ[F] L)
h : Normal F L
⊢ IsNormalClosure F K ↥(normalClosure F K L)

Next tactic:
have ⟨φ⟩ := ne