l3lab/ntp-mathlib huggingface dataset:
/-- `F[S][T] = F[S ∪ T]` -/
theorem adjoin_adjoin_left (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars _ = adjoin F (S ∪ T) := by
  rw [SetLike.ext'_iff]
  change (↑(adjoin (adjoin F S) T) : Set E) = _
  apply Set.eq_of_subset_of_subset <;> 

Proof state:
case a
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
⊢ ↑(adjoin (↥(adjoin F S)) T) ⊆ ↑(adjoin F (S ∪ T))

Next tactic:
rw [adjoin_subset_adjoin_iff]
/-- `F[S][T] = F[S ∪ T]` -/
theorem adjoin_adjoin_left (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars _ = adjoin F (S ∪ T) := by
  rw [SetLike.ext'_iff]
  change (↑(adjoin (adjoin F S) T) : Set E) = _
  apply Set.eq_of_subset_of_subset <;> 

Proof state:
case a
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
⊢ ↑(adjoin F (S ∪ T)) ⊆ ↑(adjoin (↥(adjoin F S)) T)

Next tactic:
rw [adjoin_subset_adjoin_iff]
/-- `F[S][T] = F[S ∪ T]` -/
theorem adjoin_adjoin_left (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars _ = adjoin F (S ∪ T) := by
  rw [SetLike.ext'_iff]
  change (↑(adjoin (adjoin F S) T) : Set E) = _
  apply Set.eq_of_subset_of_subset <;> rw [adjoin_subset_adjoin_iff] <;> 

Proof state:
case a
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
⊢ Set.range ⇑(algebraMap (↥(adjoin F S)) E) ⊆ ↑(adjoin F (S ∪ T)) ∧ T ⊆ ↑(adjoin F (S ∪ T))

Next tactic:
constructor
/-- `F[S][T] = F[S ∪ T]` -/
theorem adjoin_adjoin_left (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars _ = adjoin F (S ∪ T) := by
  rw [SetLike.ext'_iff]
  change (↑(adjoin (adjoin F S) T) : Set E) = _
  apply Set.eq_of_subset_of_subset <;> rw [adjoin_subset_adjoin_iff] <;> 

Proof state:
case a
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
⊢ Set.range ⇑(algebraMap F E) ⊆ ↑(adjoin (↥(adjoin F S)) T) ∧ S ∪ T ⊆ ↑(adjoin (↥(adjoin F S)) T)

Next tactic:
constructor
/-- `F[S][T] = F[S ∪ T]` -/
theorem adjoin_adjoin_left (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars _ = adjoin F (S ∪ T) := by
  rw [SetLike.ext'_iff]
  change (↑(adjoin (adjoin F S) T) : Set E) = _
  apply Set.eq_of_subset_of_subset <;> rw [adjoin_subset_adjoin_iff] <;> constructor
  · 

Proof state:
case a.left
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
⊢ Set.range ⇑(algebraMap (↥(adjoin F S)) E) ⊆ ↑(adjoin F (S ∪ T))

Next tactic:
rintro _ ⟨⟨x, hx⟩, rfl⟩
/-- `F[S][T] = F[S ∪ T]` -/
theorem adjoin_adjoin_left (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars _ = adjoin F (S ∪ T) := by
  rw [SetLike.ext'_iff]
  change (↑(adjoin (adjoin F S) T) : Set E) = _
  apply Set.eq_of_subset_of_subset <;> rw [adjoin_subset_adjoin_iff] <;> constructor
  · rintro _ ⟨⟨x, hx⟩, rfl⟩; 

Proof state:
case a.left.intro.mk
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
x : E
hx : x ∈ adjoin F S
⊢ (algebraMap (↥(adjoin F S)) E) { val := x, property := hx } ∈ ↑(adjoin F (S ∪ T))

Next tactic:
exact adjoin.mono _ _ _ (Set.subset_union_left _ _) hx
/-- `F[S][T] = F[S ∪ T]` -/
theorem adjoin_adjoin_left (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars _ = adjoin F (S ∪ T) := by
  rw [SetLike.ext'_iff]
  change (↑(adjoin (adjoin F S) T) : Set E) = _
  apply Set.eq_of_subset_of_subset <;> rw [adjoin_subset_adjoin_iff] <;> constructor
  · rintro _ ⟨⟨x, hx⟩, rfl⟩; exact adjoin.mono _ _ _ (Set.subset_union_left _ _) hx
  · 

Proof state:
case a.right
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
⊢ T ⊆ ↑(adjoin F (S ∪ T))

Next tactic:
exact subset_adjoin_of_subset_right _ _ (Set.subset_union_right _ _)
/-- `F[S][T] = F[S ∪ T]` -/
theorem adjoin_adjoin_left (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars _ = adjoin F (S ∪ T) := by
  rw [SetLike.ext'_iff]
  change (↑(adjoin (adjoin F S) T) : Set E) = _
  apply Set.eq_of_subset_of_subset <;> rw [adjoin_subset_adjoin_iff] <;> constructor
  · rintro _ ⟨⟨x, hx⟩, rfl⟩; exact adjoin.mono _ _ _ (Set.subset_union_left _ _) hx
  · exact subset_adjoin_of_subset_right _ _ (Set.subset_union_right _ _)
-- Porting note: orginal proof times out
  · 

Proof state:
case a.left
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
⊢ Set.range ⇑(algebraMap F E) ⊆ ↑(adjoin (↥(adjoin F S)) T)

Next tactic:
rintro x ⟨f, rfl⟩
/-- `F[S][T] = F[S ∪ T]` -/
theorem adjoin_adjoin_left (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars _ = adjoin F (S ∪ T) := by
  rw [SetLike.ext'_iff]
  change (↑(adjoin (adjoin F S) T) : Set E) = _
  apply Set.eq_of_subset_of_subset <;> rw [adjoin_subset_adjoin_iff] <;> constructor
  · rintro _ ⟨⟨x, hx⟩, rfl⟩; exact adjoin.mono _ _ _ (Set.subset_union_left _ _) hx
  · exact subset_adjoin_of_subset_right _ _ (Set.subset_union_right _ _)
-- Porting note: orginal proof times out
  · rintro x ⟨f, rfl⟩
    

Proof state:
case a.left.intro
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
f : F
⊢ (algebraMap F E) f ∈ ↑(adjoin (↥(adjoin F S)) T)

Next tactic:
refine' Subfield.subset_closure _
/-- `F[S][T] = F[S ∪ T]` -/
theorem adjoin_adjoin_left (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars _ = adjoin F (S ∪ T) := by
  rw [SetLike.ext'_iff]
  change (↑(adjoin (adjoin F S) T) : Set E) = _
  apply Set.eq_of_subset_of_subset <;> rw [adjoin_subset_adjoin_iff] <;> constructor
  · rintro _ ⟨⟨x, hx⟩, rfl⟩; exact adjoin.mono _ _ _ (Set.subset_union_left _ _) hx
  · exact subset_adjoin_of_subset_right _ _ (Set.subset_union_right _ _)
-- Porting note: orginal proof times out
  · rintro x ⟨f, rfl⟩
    refine' Subfield.subset_closure _
    

Proof state:
case a.left.intro
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
f : F
⊢ (algebraMap F E) f ∈ Set.range ⇑(algebraMap (↥(adjoin F S)) E) ∪ T

Next tactic:
left
/-- `F[S][T] = F[S ∪ T]` -/
theorem adjoin_adjoin_left (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars _ = adjoin F (S ∪ T) := by
  rw [SetLike.ext'_iff]
  change (↑(adjoin (adjoin F S) T) : Set E) = _
  apply Set.eq_of_subset_of_subset <;> rw [adjoin_subset_adjoin_iff] <;> constructor
  · rintro _ ⟨⟨x, hx⟩, rfl⟩; exact adjoin.mono _ _ _ (Set.subset_union_left _ _) hx
  · exact subset_adjoin_of_subset_right _ _ (Set.subset_union_right _ _)
-- Porting note: orginal proof times out
  · rintro x ⟨f, rfl⟩
    refine' Subfield.subset_closure _
    left
    

Proof state:
case a.left.intro.h
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
f : F
⊢ (algebraMap F E) f ∈ Set.range ⇑(algebraMap (↥(adjoin F S)) E)

Next tactic:
exact ⟨f, rfl⟩
/-- `F[S][T] = F[S ∪ T]` -/
theorem adjoin_adjoin_left (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars _ = adjoin F (S ∪ T) := by
  rw [SetLike.ext'_iff]
  change (↑(adjoin (adjoin F S) T) : Set E) = _
  apply Set.eq_of_subset_of_subset <;> rw [adjoin_subset_adjoin_iff] <;> constructor
  · rintro _ ⟨⟨x, hx⟩, rfl⟩; exact adjoin.mono _ _ _ (Set.subset_union_left _ _) hx
  · exact subset_adjoin_of_subset_right _ _ (Set.subset_union_right _ _)
-- Porting note: orginal proof times out
  · rintro x ⟨f, rfl⟩
    refine' Subfield.subset_closure _
    left
    exact ⟨f, rfl⟩
-- Porting note: orginal proof times out
  · 

Proof state:
case a.right
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
⊢ S ∪ T ⊆ ↑(adjoin (↥(adjoin F S)) T)

Next tactic:
refine' Set.union_subset (fun x hx => Subfield.subset_closure _)
      (fun x hx => Subfield.subset_closure _)
/-- `F[S][T] = F[S ∪ T]` -/
theorem adjoin_adjoin_left (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars _ = adjoin F (S ∪ T) := by
  rw [SetLike.ext'_iff]
  change (↑(adjoin (adjoin F S) T) : Set E) = _
  apply Set.eq_of_subset_of_subset <;> rw [adjoin_subset_adjoin_iff] <;> constructor
  · rintro _ ⟨⟨x, hx⟩, rfl⟩; exact adjoin.mono _ _ _ (Set.subset_union_left _ _) hx
  · exact subset_adjoin_of_subset_right _ _ (Set.subset_union_right _ _)
-- Porting note: orginal proof times out
  · rintro x ⟨f, rfl⟩
    refine' Subfield.subset_closure _
    left
    exact ⟨f, rfl⟩
-- Porting note: orginal proof times out
  · refine' Set.union_subset (fun x hx => Subfield.subset_closure _)
      (fun x hx => Subfield.subset_closure _)
    · 

Proof state:
case a.right.refine'_1
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
x : E
hx : x ∈ S
⊢ x ∈ Set.range ⇑(algebraMap (↥(adjoin F S)) E) ∪ T

Next tactic:
left
/-- `F[S][T] = F[S ∪ T]` -/
theorem adjoin_adjoin_left (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars _ = adjoin F (S ∪ T) := by
  rw [SetLike.ext'_iff]
  change (↑(adjoin (adjoin F S) T) : Set E) = _
  apply Set.eq_of_subset_of_subset <;> rw [adjoin_subset_adjoin_iff] <;> constructor
  · rintro _ ⟨⟨x, hx⟩, rfl⟩; exact adjoin.mono _ _ _ (Set.subset_union_left _ _) hx
  · exact subset_adjoin_of_subset_right _ _ (Set.subset_union_right _ _)
-- Porting note: orginal proof times out
  · rintro x ⟨f, rfl⟩
    refine' Subfield.subset_closure _
    left
    exact ⟨f, rfl⟩
-- Porting note: orginal proof times out
  · refine' Set.union_subset (fun x hx => Subfield.subset_closure _)
      (fun x hx => Subfield.subset_closure _)
    · left
      

Proof state:
case a.right.refine'_1.h
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
x : E
hx : x ∈ S
⊢ x ∈ Set.range ⇑(algebraMap (↥(adjoin F S)) E)

Next tactic:
refine' ⟨⟨x, Subfield.subset_closure _⟩, rfl⟩
/-- `F[S][T] = F[S ∪ T]` -/
theorem adjoin_adjoin_left (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars _ = adjoin F (S ∪ T) := by
  rw [SetLike.ext'_iff]
  change (↑(adjoin (adjoin F S) T) : Set E) = _
  apply Set.eq_of_subset_of_subset <;> rw [adjoin_subset_adjoin_iff] <;> constructor
  · rintro _ ⟨⟨x, hx⟩, rfl⟩; exact adjoin.mono _ _ _ (Set.subset_union_left _ _) hx
  · exact subset_adjoin_of_subset_right _ _ (Set.subset_union_right _ _)
-- Porting note: orginal proof times out
  · rintro x ⟨f, rfl⟩
    refine' Subfield.subset_closure _
    left
    exact ⟨f, rfl⟩
-- Porting note: orginal proof times out
  · refine' Set.union_subset (fun x hx => Subfield.subset_closure _)
      (fun x hx => Subfield.subset_closure _)
    · left
      refine' ⟨⟨x, Subfield.subset_closure _⟩, rfl⟩
      

Proof state:
case a.right.refine'_1.h
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
x : E
hx : x ∈ S
⊢ x ∈ Set.range ⇑(algebraMap F E) ∪ S

Next tactic:
right
/-- `F[S][T] = F[S ∪ T]` -/
theorem adjoin_adjoin_left (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars _ = adjoin F (S ∪ T) := by
  rw [SetLike.ext'_iff]
  change (↑(adjoin (adjoin F S) T) : Set E) = _
  apply Set.eq_of_subset_of_subset <;> rw [adjoin_subset_adjoin_iff] <;> constructor
  · rintro _ ⟨⟨x, hx⟩, rfl⟩; exact adjoin.mono _ _ _ (Set.subset_union_left _ _) hx
  · exact subset_adjoin_of_subset_right _ _ (Set.subset_union_right _ _)
-- Porting note: orginal proof times out
  · rintro x ⟨f, rfl⟩
    refine' Subfield.subset_closure _
    left
    exact ⟨f, rfl⟩
-- Porting note: orginal proof times out
  · refine' Set.union_subset (fun x hx => Subfield.subset_closure _)
      (fun x hx => Subfield.subset_closure _)
    · left
      refine' ⟨⟨x, Subfield.subset_closure _⟩, rfl⟩
      right
      

Proof state:
case a.right.refine'_1.h.h
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
x : E
hx : x ∈ S
⊢ x ∈ S

Next tactic:
exact hx
/-- `F[S][T] = F[S ∪ T]` -/
theorem adjoin_adjoin_left (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars _ = adjoin F (S ∪ T) := by
  rw [SetLike.ext'_iff]
  change (↑(adjoin (adjoin F S) T) : Set E) = _
  apply Set.eq_of_subset_of_subset <;> rw [adjoin_subset_adjoin_iff] <;> constructor
  · rintro _ ⟨⟨x, hx⟩, rfl⟩; exact adjoin.mono _ _ _ (Set.subset_union_left _ _) hx
  · exact subset_adjoin_of_subset_right _ _ (Set.subset_union_right _ _)
-- Porting note: orginal proof times out
  · rintro x ⟨f, rfl⟩
    refine' Subfield.subset_closure _
    left
    exact ⟨f, rfl⟩
-- Porting note: orginal proof times out
  · refine' Set.union_subset (fun x hx => Subfield.subset_closure _)
      (fun x hx => Subfield.subset_closure _)
    · left
      refine' ⟨⟨x, Subfield.subset_closure _⟩, rfl⟩
      right
      exact hx
    · 

Proof state:
case a.right.refine'_2
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
x : E
hx : x ∈ T
⊢ x ∈ Set.range ⇑(algebraMap (↥(adjoin F S)) E) ∪ T

Next tactic:
right
/-- `F[S][T] = F[S ∪ T]` -/
theorem adjoin_adjoin_left (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars _ = adjoin F (S ∪ T) := by
  rw [SetLike.ext'_iff]
  change (↑(adjoin (adjoin F S) T) : Set E) = _
  apply Set.eq_of_subset_of_subset <;> rw [adjoin_subset_adjoin_iff] <;> constructor
  · rintro _ ⟨⟨x, hx⟩, rfl⟩; exact adjoin.mono _ _ _ (Set.subset_union_left _ _) hx
  · exact subset_adjoin_of_subset_right _ _ (Set.subset_union_right _ _)
-- Porting note: orginal proof times out
  · rintro x ⟨f, rfl⟩
    refine' Subfield.subset_closure _
    left
    exact ⟨f, rfl⟩
-- Porting note: orginal proof times out
  · refine' Set.union_subset (fun x hx => Subfield.subset_closure _)
      (fun x hx => Subfield.subset_closure _)
    · left
      refine' ⟨⟨x, Subfield.subset_closure _⟩, rfl⟩
      right
      exact hx
    · right
      

Proof state:
case a.right.refine'_2.h
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
x : E
hx : x ∈ T
⊢ x ∈ T

Next tactic:
exact hx
/-- `F[S][T] = F[T][S]` -/
theorem adjoin_adjoin_comm (T : Set E) :
    (adjoin (adjoin F S) T).restrictScalars F = (adjoin (adjoin F T) S).restrictScalars F := by
  

Proof state:
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S T : Set E
⊢ restrictScalars F (adjoin (↥(adjoin F S)) T) = restrictScalars F (adjoin (↥(adjoin F T)) S)

Next tactic:
rw [adjoin_adjoin_left, adjoin_adjoin_left, Set.union_comm]
theorem adjoin_map {E' : Type*} [Field E'] [Algebra F E'] (f : E →ₐ[F] E') :
    (adjoin F S).map f = adjoin F (f '' S) := by
  

Proof state:
F : Type u_1
inst✝⁴ : Field F
E : Type u_2
inst✝³ : Field E
inst✝² : Algebra F E
S : Set E
E' : Type u_3
inst✝¹ : Field E'
inst✝ : Algebra F E'
f : E →ₐ[F] E'
⊢ map f (adjoin F S) = adjoin F (⇑f '' S)

Next tactic:
ext x
theorem adjoin_map {E' : Type*} [Field E'] [Algebra F E'] (f : E →ₐ[F] E') :
    (adjoin F S).map f = adjoin F (f '' S) := by
  ext x
  

Proof state:
case h
F : Type u_1
inst✝⁴ : Field F
E : Type u_2
inst✝³ : Field E
inst✝² : Algebra F E
S : Set E
E' : Type u_3
inst✝¹ : Field E'
inst✝ : Algebra F E'
f : E →ₐ[F] E'
x : E'
⊢ x ∈ map f (adjoin F S) ↔ x ∈ adjoin F (⇑f '' S)

Next tactic:
show
    x ∈ (Subfield.closure (Set.range (algebraMap F E) ∪ S)).map (f : E →+* E') ↔
      x ∈ Subfield.closure (Set.range (algebraMap F E') ∪ f '' S)
theorem adjoin_map {E' : Type*} [Field E'] [Algebra F E'] (f : E →ₐ[F] E') :
    (adjoin F S).map f = adjoin F (f '' S) := by
  ext x
  show
    x ∈ (Subfield.closure (Set.range (algebraMap F E) ∪ S)).map (f : E →+* E') ↔
      x ∈ Subfield.closure (Set.range (algebraMap F E') ∪ f '' S)
  

Proof state:
case h
F : Type u_1
inst✝⁴ : Field F
E : Type u_2
inst✝³ : Field E
inst✝² : Algebra F E
S : Set E
E' : Type u_3
inst✝¹ : Field E'
inst✝ : Algebra F E'
f : E →ₐ[F] E'
x : E'
⊢ x ∈ Subfield.map (↑f) (Subfield.closure (Set.range ⇑(algebraMap F E) ∪ S)) ↔
    x ∈ Subfield.closure (Set.range ⇑(algebraMap F E') ∪ ⇑f '' S)

Next tactic:
rw [RingHom.map_field_closure, Set.image_union, ← Set.range_comp, ← RingHom.coe_comp,
    f.comp_algebraMap]
theorem adjoin_map {E' : Type*} [Field E'] [Algebra F E'] (f : E →ₐ[F] E') :
    (adjoin F S).map f = adjoin F (f '' S) := by
  ext x
  show
    x ∈ (Subfield.closure (Set.range (algebraMap F E) ∪ S)).map (f : E →+* E') ↔
      x ∈ Subfield.closure (Set.range (algebraMap F E') ∪ f '' S)
  rw [RingHom.map_field_closure, Set.image_union, ← Set.range_comp, ← RingHom.coe_comp,
    f.comp_algebraMap]
  

Proof state:
case h
F : Type u_1
inst✝⁴ : Field F
E : Type u_2
inst✝³ : Field E
inst✝² : Algebra F E
S : Set E
E' : Type u_3
inst✝¹ : Field E'
inst✝ : Algebra F E'
f : E →ₐ[F] E'
x : E'
⊢ x ∈ Subfield.closure (Set.range ⇑(algebraMap F E') ∪ ⇑↑f '' S) ↔
    x ∈ Subfield.closure (Set.range ⇑(algebraMap F E') ∪ ⇑f '' S)

Next tactic:
rfl
theorem lift_adjoin_simple (K : IntermediateField F E) (α : K) :
    lift (adjoin F {α}) = adjoin F {α.1} := by
  

Proof state:
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S : Set E
K : IntermediateField F E
α : ↥K
⊢ lift (adjoin F {α}) = adjoin F {↑α}

Next tactic:
simp only [lift_adjoin, Set.image_singleton]
@[simp]
theorem lift_top (K : IntermediateField F E) :
    lift (F := K) ⊤ = K := by 

Proof state:
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S : Set E
K : IntermediateField F E
⊢ lift ⊤ = K

Next tactic:
rw [lift, ← AlgHom.fieldRange_eq_map, fieldRange_val]
theorem restrictScalars_adjoin (K : IntermediateField F E) (S : Set E) :
    restrictScalars F (adjoin K S) = adjoin F (K ∪ S) := by
  

Proof state:
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S✝ : Set E
K : IntermediateField F E
S : Set E
⊢ restrictScalars F (adjoin (↥K) S) = adjoin F (↑K ∪ S)

Next tactic:
rw [← adjoin_self _ K, adjoin_adjoin_left, adjoin_self _ K]
theorem eq_adjoin_of_eq_algebra_adjoin (K : IntermediateField F E)
    (h : K.toSubalgebra = Algebra.adjoin F S) : K = adjoin F S := by
  

Proof state:
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S : Set E
K : IntermediateField F E
h : K.toSubalgebra = Algebra.adjoin F S
⊢ K = adjoin F S

Next tactic:
apply toSubalgebra_injective
theorem eq_adjoin_of_eq_algebra_adjoin (K : IntermediateField F E)
    (h : K.toSubalgebra = Algebra.adjoin F S) : K = adjoin F S := by
  apply toSubalgebra_injective
  

Proof state:
case a
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S : Set E
K : IntermediateField F E
h : K.toSubalgebra = Algebra.adjoin F S
⊢ K.toSubalgebra = (adjoin F S).toSubalgebra

Next tactic:
rw [h]
theorem eq_adjoin_of_eq_algebra_adjoin (K : IntermediateField F E)
    (h : K.toSubalgebra = Algebra.adjoin F S) : K = adjoin F S := by
  apply toSubalgebra_injective
  rw [h]
  

Proof state:
case a
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S : Set E
K : IntermediateField F E
h : K.toSubalgebra = Algebra.adjoin F S
⊢ Algebra.adjoin F S = (adjoin F S).toSubalgebra

Next tactic:
refine' (adjoin_eq_algebra_adjoin F _ _).symm
theorem eq_adjoin_of_eq_algebra_adjoin (K : IntermediateField F E)
    (h : K.toSubalgebra = Algebra.adjoin F S) : K = adjoin F S := by
  apply toSubalgebra_injective
  rw [h]
  refine' (adjoin_eq_algebra_adjoin F _ _).symm
  

Proof state:
case a
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S : Set E
K : IntermediateField F E
h : K.toSubalgebra = Algebra.adjoin F S
⊢ ∀ x ∈ Algebra.adjoin F S, x⁻¹ ∈ Algebra.adjoin F S

Next tactic:
intro x
theorem eq_adjoin_of_eq_algebra_adjoin (K : IntermediateField F E)
    (h : K.toSubalgebra = Algebra.adjoin F S) : K = adjoin F S := by
  apply toSubalgebra_injective
  rw [h]
  refine' (adjoin_eq_algebra_adjoin F _ _).symm
  intro x
  

Proof state:
case a
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S : Set E
K : IntermediateField F E
h : K.toSubalgebra = Algebra.adjoin F S
x : E
⊢ x ∈ Algebra.adjoin F S → x⁻¹ ∈ Algebra.adjoin F S

Next tactic:
convert K.inv_mem (x := x)
theorem eq_adjoin_of_eq_algebra_adjoin (K : IntermediateField F E)
    (h : K.toSubalgebra = Algebra.adjoin F S) : K = adjoin F S := by
  apply toSubalgebra_injective
  rw [h]
  refine' (adjoin_eq_algebra_adjoin F _ _).symm
  intro x
  convert K.inv_mem (x := x) <;> 

Proof state:
case h.a
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S : Set E
K : IntermediateField F E
h : K.toSubalgebra = Algebra.adjoin F S
x : E
⊢ x ∈ Algebra.adjoin F S ↔ x ∈ K

Next tactic:
rw [← h]
theorem eq_adjoin_of_eq_algebra_adjoin (K : IntermediateField F E)
    (h : K.toSubalgebra = Algebra.adjoin F S) : K = adjoin F S := by
  apply toSubalgebra_injective
  rw [h]
  refine' (adjoin_eq_algebra_adjoin F _ _).symm
  intro x
  convert K.inv_mem (x := x) <;> 

Proof state:
case h'.a
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S : Set E
K : IntermediateField F E
h : K.toSubalgebra = Algebra.adjoin F S
x : E
a✝ : x ∈ K
⊢ x⁻¹ ∈ Algebra.adjoin F S ↔ x⁻¹ ∈ K

Next tactic:
rw [← h]
theorem eq_adjoin_of_eq_algebra_adjoin (K : IntermediateField F E)
    (h : K.toSubalgebra = Algebra.adjoin F S) : K = adjoin F S := by
  apply toSubalgebra_injective
  rw [h]
  refine' (adjoin_eq_algebra_adjoin F _ _).symm
  intro x
  convert K.inv_mem (x := x) <;> rw [← h] <;> 

Proof state:
case h.a
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S : Set E
K : IntermediateField F E
h : K.toSubalgebra = Algebra.adjoin F S
x : E
⊢ x ∈ K.toSubalgebra ↔ x ∈ K

Next tactic:
rfl
theorem eq_adjoin_of_eq_algebra_adjoin (K : IntermediateField F E)
    (h : K.toSubalgebra = Algebra.adjoin F S) : K = adjoin F S := by
  apply toSubalgebra_injective
  rw [h]
  refine' (adjoin_eq_algebra_adjoin F _ _).symm
  intro x
  convert K.inv_mem (x := x) <;> rw [← h] <;> 

Proof state:
case h'.a
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S : Set E
K : IntermediateField F E
h : K.toSubalgebra = Algebra.adjoin F S
x : E
a✝ : x ∈ K
⊢ x⁻¹ ∈ K.toSubalgebra ↔ x⁻¹ ∈ K

Next tactic:
rfl
@[simp]
theorem AdjoinSimple.isIntegral_gen : IsIntegral F (AdjoinSimple.gen F α) ↔ IsIntegral F α := by
  

Proof state:
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S : Set E
α : E
⊢ IsIntegral F (gen F α) ↔ IsIntegral F α

Next tactic:
conv_rhs => rw [← AdjoinSimple.algebraMap_gen F α]
@[simp]
theorem AdjoinSimple.isIntegral_gen : IsIntegral F (AdjoinSimple.gen F α) ↔ IsIntegral F α := by
  conv_rhs => 

Proof state:
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S : Set E
α : E
| IsIntegral F α

Next tactic:
rw [← AdjoinSimple.algebraMap_gen F α]
@[simp]
theorem AdjoinSimple.isIntegral_gen : IsIntegral F (AdjoinSimple.gen F α) ↔ IsIntegral F α := by
  conv_rhs => rw [← AdjoinSimple.algebraMap_gen F α]
  

Proof state:
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S : Set E
α : E
⊢ IsIntegral F (gen F α) ↔ IsIntegral F ((algebraMap (↥F⟮α⟯) E) (gen F α))

Next tactic:
rw [isIntegral_algebraMap_iff (algebraMap F⟮α⟯ E).injective]
theorem adjoin_algebraic_toSubalgebra {S : Set E} (hS : ∀ x ∈ S, IsAlgebraic F x) :
    (IntermediateField.adjoin F S).toSubalgebra = Algebra.adjoin F S := by
  

Proof state:
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S✝ : Set E
α : E
S : Set E
hS : ∀ x ∈ S, IsAlgebraic F x
⊢ (adjoin F S).toSubalgebra = Algebra.adjoin F S

Next tactic:
simp only [isAlgebraic_iff_isIntegral] at hS
theorem adjoin_algebraic_toSubalgebra {S : Set E} (hS : ∀ x ∈ S, IsAlgebraic F x) :
    (IntermediateField.adjoin F S).toSubalgebra = Algebra.adjoin F S := by
  simp only [isAlgebraic_iff_isIntegral] at hS
  

Proof state:
F : Type u_1
inst✝² : Field F
E : Type u_2
inst✝¹ : Field E
inst✝ : Algebra F E
S✝ : Set E
α : E
S : Set E
hS : ∀ x ∈ S, IsIntegral F x
⊢ (adjoin F S).toSubalgebra = Algebra.adjoin F S

Next tactic:
have : Algebra.IsIntegral F (Algebra.adjoin F S) := by
    rwa [← le_integralClosure_iff_isIntegral, Algebra.adjoin_le_iff]