l3lab/ntp-mathlib huggingface dataset:
theorem exists_algHom_adjoin_of_splits_of_aeval : ∃ φ : adjoin F S →ₐ[F] K, φ ⟨x, hx⟩ = y := by
  have ix := isAlgebraic_adjoin (fun s hs ↦ (hK s hs).1) ⟨x, hx⟩
  rw [isAlgebraic_iff_isIntegral, isIntegral_iff] at ix
  obtain ⟨φ, hφ⟩ := exists_algHom_adjoin_of_splits hK ((algHomAdjoinIntegralEquiv F ix).symm
    ⟨y, mem_aroots.mpr ⟨minpoly.ne_zero ix, hy⟩⟩) (adjoin_simple_le_iff.mpr hx)
  

Proof state:
case intro
F : Type u_1
E : Type u_2
K : Type u_3
inst✝⁴ : Field F
inst✝³ : Field E
inst✝² : Field K
inst✝¹ : Algebra F E
inst✝ : Algebra F K
S : Set E
hK : ∀ s ∈ S, IsIntegral F s ∧ Splits (algebraMap F K) (minpoly F s)
hK' : ∀ (s : E), IsIntegral F s ∧ Splits (algebraMap F K) (minpoly F s)
L : IntermediateField F E
f : ↥L →ₐ[F] K
hL : L ≤ adjoin F S
hS : adjoin F S = ⊤
x : E
hx : x ∈ adjoin F S
y : K
hy : (aeval y) (minpoly F x) = 0
ix : IsIntegral F ↑{ val := x, property := hx }
φ : ↥(adjoin F S) →ₐ[F] K
hφ :
  AlgHom.comp φ (inclusion (_ : F⟮↑{ val := x, property := hx }⟯ ≤ adjoin F S)) =
    (algHomAdjoinIntegralEquiv F ix).symm
      { val := y, property := (_ : y ∈ aroots (minpoly F ↑{ val := x, property := hx }) K) }
⊢ ∃ φ, φ { val := x, property := hx } = y

Next tactic:
exact ⟨φ, (FunLike.congr_fun hφ <| AdjoinSimple.gen F x).trans <|
    algHomAdjoinIntegralEquiv_symm_apply_gen F ix _⟩
/-- Let `K/F` be an algebraic extension of fields and `L` a field in which all the minimal
polynomial over `F` of elements of `K` splits. Then, for `x ∈ K`, the images of `x` by the
`F`-algebra morphisms from `K` to `L` are exactly the roots in `L` of the minimal polynomial
of `x` over `F`. -/
theorem Algebra.IsAlgebraic.range_eval_eq_rootSet_minpoly_of_splits {F K : Type*} (L : Type*)
    [Field F] [Field K] [Field L] [Algebra F L] [Algebra F K]
    (hA : ∀ x : K, (minpoly F x).Splits (algebraMap F L))
    (hK : Algebra.IsAlgebraic F K) (x : K) :
    (Set.range fun (ψ : K →ₐ[F] L) => ψ x) = (minpoly F x).rootSet 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 L
inst✝ : Algebra F K
hA : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
hK : IsAlgebraic F K
x : K
⊢ (Set.range fun ψ => ψ x) = rootSet (minpoly F x) L

Next tactic:
ext a
/-- Let `K/F` be an algebraic extension of fields and `L` a field in which all the minimal
polynomial over `F` of elements of `K` splits. Then, for `x ∈ K`, the images of `x` by the
`F`-algebra morphisms from `K` to `L` are exactly the roots in `L` of the minimal polynomial
of `x` over `F`. -/
theorem Algebra.IsAlgebraic.range_eval_eq_rootSet_minpoly_of_splits {F K : Type*} (L : Type*)
    [Field F] [Field K] [Field L] [Algebra F L] [Algebra F K]
    (hA : ∀ x : K, (minpoly F x).Splits (algebraMap F L))
    (hK : Algebra.IsAlgebraic F K) (x : K) :
    (Set.range fun (ψ : K →ₐ[F] L) => ψ x) = (minpoly F x).rootSet L := by
  ext a
  

Proof state:
case h
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F L
inst✝ : Algebra F K
hA : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
hK : IsAlgebraic F K
x : K
a : L
⊢ (a ∈ Set.range fun ψ => ψ x) ↔ a ∈ rootSet (minpoly F x) L

Next tactic:
rw [mem_rootSet_of_ne (minpoly.ne_zero (hK.isIntegral x))]
/-- Let `K/F` be an algebraic extension of fields and `L` a field in which all the minimal
polynomial over `F` of elements of `K` splits. Then, for `x ∈ K`, the images of `x` by the
`F`-algebra morphisms from `K` to `L` are exactly the roots in `L` of the minimal polynomial
of `x` over `F`. -/
theorem Algebra.IsAlgebraic.range_eval_eq_rootSet_minpoly_of_splits {F K : Type*} (L : Type*)
    [Field F] [Field K] [Field L] [Algebra F L] [Algebra F K]
    (hA : ∀ x : K, (minpoly F x).Splits (algebraMap F L))
    (hK : Algebra.IsAlgebraic F K) (x : K) :
    (Set.range fun (ψ : K →ₐ[F] L) => ψ x) = (minpoly F x).rootSet L := by
  ext a
  rw [mem_rootSet_of_ne (minpoly.ne_zero (hK.isIntegral x))]
  

Proof state:
case h
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F L
inst✝ : Algebra F K
hA : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
hK : IsAlgebraic F K
x : K
a : L
⊢ (a ∈ Set.range fun ψ => ψ x) ↔ (aeval a) (minpoly F x) = 0

Next tactic:
refine ⟨fun ⟨ψ, hψ⟩ ↦ ?_, fun ha ↦ IntermediateField.exists_algHom_of_splits_of_aeval
    (fun x ↦ ⟨hK.isIntegral x, hA x⟩) ha⟩
/-- Let `K/F` be an algebraic extension of fields and `L` a field in which all the minimal
polynomial over `F` of elements of `K` splits. Then, for `x ∈ K`, the images of `x` by the
`F`-algebra morphisms from `K` to `L` are exactly the roots in `L` of the minimal polynomial
of `x` over `F`. -/
theorem Algebra.IsAlgebraic.range_eval_eq_rootSet_minpoly_of_splits {F K : Type*} (L : Type*)
    [Field F] [Field K] [Field L] [Algebra F L] [Algebra F K]
    (hA : ∀ x : K, (minpoly F x).Splits (algebraMap F L))
    (hK : Algebra.IsAlgebraic F K) (x : K) :
    (Set.range fun (ψ : K →ₐ[F] L) => ψ x) = (minpoly F x).rootSet L := by
  ext a
  rw [mem_rootSet_of_ne (minpoly.ne_zero (hK.isIntegral x))]
  refine ⟨fun ⟨ψ, hψ⟩ ↦ ?_, fun ha ↦ IntermediateField.exists_algHom_of_splits_of_aeval
    (fun x ↦ ⟨hK.isIntegral x, hA x⟩) ha⟩
  

Proof state:
case h
F : Type u_1
K : Type u_2
L : Type u_3
inst✝⁴ : Field F
inst✝³ : Field K
inst✝² : Field L
inst✝¹ : Algebra F L
inst✝ : Algebra F K
hA : ∀ (x : K), Splits (algebraMap F L) (minpoly F x)
hK : IsAlgebraic F K
x : K
a : L
x✝ : a ∈ Set.range fun ψ => ψ x
ψ : K →ₐ[F] L
hψ : (fun ψ => ψ x) ψ = a
⊢ (aeval a) (minpoly F x) = 0

Next tactic:
rw [← hψ, Polynomial.aeval_algHom_apply ψ x, minpoly.aeval, map_zero]
/-- `pb.equivAdjoinSimple` is the equivalence between `K⟮pb.gen⟯` and `L` itself. -/
noncomputable def equivAdjoinSimple (pb : PowerBasis K L) : K⟮pb.gen⟯ ≃ₐ[K] L :=
  (adjoin.powerBasis pb.isIntegral_gen).equivOfMinpoly pb <| by
    

Proof state:
K : Type u_1
L : Type u_2
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Algebra K L
pb : PowerBasis K L
⊢ minpoly K (adjoin.powerBasis (_ : IsIntegral K pb.gen)).gen = minpoly K pb.gen

Next tactic:
rw [adjoin.powerBasis_gen, minpoly_gen]
@[simp]
theorem equivAdjoinSimple_symm_aeval (pb : PowerBasis K L) (f : K[X]) :
    pb.equivAdjoinSimple.symm (aeval pb.gen f) = aeval (AdjoinSimple.gen K pb.gen) f := by
  

Proof state:
K : Type u_1
L : Type u_2
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Algebra K L
pb : PowerBasis K L
f : K[X]
⊢ (AlgEquiv.symm (equivAdjoinSimple pb)) ((aeval pb.gen) f) = (aeval (AdjoinSimple.gen K pb.gen)) f

Next tactic:
rw [equivAdjoinSimple, equivOfMinpoly_symm, equivOfMinpoly_aeval, adjoin.powerBasis_gen]
@[simp]
theorem equivAdjoinSimple_symm_gen (pb : PowerBasis K L) :
    pb.equivAdjoinSimple.symm pb.gen = AdjoinSimple.gen K pb.gen := by
  

Proof state:
K : Type u_1
L : Type u_2
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Algebra K L
pb : PowerBasis K L
⊢ (AlgEquiv.symm (equivAdjoinSimple pb)) pb.gen = AdjoinSimple.gen K pb.gen

Next tactic:
rw [equivAdjoinSimple, equivOfMinpoly_symm, equivOfMinpoly_gen, adjoin.powerBasis_gen]
/-- Any conditionally complete linearly ordered field is archimedean. -/
instance (priority := 100) ConditionallyCompleteLinearOrderedField.to_archimedean
    [ConditionallyCompleteLinearOrderedField α] : Archimedean α :=
  archimedean_iff_nat_lt.2
    (by
      

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝ : ConditionallyCompleteLinearOrderedField α
⊢ ∀ (x : α), ∃ n, x < ↑n

Next tactic:
by_contra! h
/-- Any conditionally complete linearly ordered field is archimedean. -/
instance (priority := 100) ConditionallyCompleteLinearOrderedField.to_archimedean
    [ConditionallyCompleteLinearOrderedField α] : Archimedean α :=
  archimedean_iff_nat_lt.2
    (by
      by_contra! h
      

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝ : ConditionallyCompleteLinearOrderedField α
h : ∃ x, ∀ (n : ℕ), ↑n ≤ x
⊢ False

Next tactic:
obtain ⟨x, h⟩ := h
/-- Any conditionally complete linearly ordered field is archimedean. -/
instance (priority := 100) ConditionallyCompleteLinearOrderedField.to_archimedean
    [ConditionallyCompleteLinearOrderedField α] : Archimedean α :=
  archimedean_iff_nat_lt.2
    (by
      by_contra! h
      obtain ⟨x, h⟩ := h
      

Proof state:
case intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝ : ConditionallyCompleteLinearOrderedField α
x : α
h : ∀ (n : ℕ), ↑n ≤ x
⊢ False

Next tactic:
have := csSup_le _ _ (range_nonempty Nat.cast)
        (forall_range_iff.2 fun m =>
          le_sub_iff_add_le.2 <| le_csSup _ _ ⟨x, forall_range_iff.2 h⟩ ⟨m+1, Nat.cast_succ m⟩)
/-- Any conditionally complete linearly ordered field is archimedean. -/
instance (priority := 100) ConditionallyCompleteLinearOrderedField.to_archimedean
    [ConditionallyCompleteLinearOrderedField α] : Archimedean α :=
  archimedean_iff_nat_lt.2
    (by
      by_contra! h
      obtain ⟨x, h⟩ := h
      have := csSup_le _ _ (range_nonempty Nat.cast)
        (forall_range_iff.2 fun m =>
          le_sub_iff_add_le.2 <| le_csSup _ _ ⟨x, forall_range_iff.2 h⟩ ⟨m+1, Nat.cast_succ m⟩)
      

Proof state:
case intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝ : ConditionallyCompleteLinearOrderedField α
x : α
h : ∀ (n : ℕ), ↑n ≤ x
this : sSup (range Nat.cast) ≤ sSup (range fun i => ↑i) - 1
⊢ False

Next tactic:
linarith
theorem cutMap_self (a : α) : cutMap α a = Iio a ∩ range (Rat.cast : ℚ → α) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : LinearOrderedField α
inst✝ : DivisionRing β
a✝ a₁ a₂ : α
b : β
q : ℚ
a : α
⊢ cutMap α a = Iio a ∩ range Rat.cast

Next tactic:
ext
theorem cutMap_self (a : α) : cutMap α a = Iio a ∩ range (Rat.cast : ℚ → α) := by
  ext
  

Proof state:
case h
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : LinearOrderedField α
inst✝ : DivisionRing β
a✝ a₁ a₂ : α
b : β
q : ℚ
a x✝ : α
⊢ x✝ ∈ cutMap α a ↔ x✝ ∈ Iio a ∩ range Rat.cast

Next tactic:
constructor
theorem cutMap_self (a : α) : cutMap α a = Iio a ∩ range (Rat.cast : ℚ → α) := by
  ext
  constructor
  · 

Proof state:
case h.mp
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : LinearOrderedField α
inst✝ : DivisionRing β
a✝ a₁ a₂ : α
b : β
q : ℚ
a x✝ : α
⊢ x✝ ∈ cutMap α a → x✝ ∈ Iio a ∩ range Rat.cast

Next tactic:
rintro ⟨q, h, rfl⟩
theorem cutMap_self (a : α) : cutMap α a = Iio a ∩ range (Rat.cast : ℚ → α) := by
  ext
  constructor
  · rintro ⟨q, h, rfl⟩
    

Proof state:
case h.mp.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : LinearOrderedField α
inst✝ : DivisionRing β
a✝ a₁ a₂ : α
b : β
q✝ : ℚ
a : α
q : ℚ
h : q ∈ {t | ↑t < a}
⊢ ↑q ∈ Iio a ∩ range Rat.cast

Next tactic:
exact ⟨h, q, rfl⟩
theorem cutMap_self (a : α) : cutMap α a = Iio a ∩ range (Rat.cast : ℚ → α) := by
  ext
  constructor
  · rintro ⟨q, h, rfl⟩
    exact ⟨h, q, rfl⟩
  · 

Proof state:
case h.mpr
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : LinearOrderedField α
inst✝ : DivisionRing β
a✝ a₁ a₂ : α
b : β
q : ℚ
a x✝ : α
⊢ x✝ ∈ Iio a ∩ range Rat.cast → x✝ ∈ cutMap α a

Next tactic:
rintro ⟨h, q, rfl⟩
theorem cutMap_self (a : α) : cutMap α a = Iio a ∩ range (Rat.cast : ℚ → α) := by
  ext
  constructor
  · rintro ⟨q, h, rfl⟩
    exact ⟨h, q, rfl⟩
  · rintro ⟨h, q, rfl⟩
    

Proof state:
case h.mpr.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : LinearOrderedField α
inst✝ : DivisionRing β
a✝ a₁ a₂ : α
b : β
q✝ : ℚ
a : α
q : ℚ
h : ↑q ∈ Iio a
⊢ ↑q ∈ cutMap α a

Next tactic:
exact ⟨q, h, rfl⟩
theorem cutMap_coe (q : ℚ) : cutMap β (q : α) = Rat.cast '' {r : ℚ | (r : β) < q} := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝¹ : LinearOrderedField α
inst✝ : LinearOrderedField β
a a₁ a₂ : α
b : β
q✝ q : ℚ
⊢ cutMap β ↑q = Rat.cast '' {r | ↑r < ↑q}

Next tactic:
simp_rw [cutMap, Rat.cast_lt]
theorem cutMap_bddAbove (a : α) : BddAbove (cutMap β a) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : LinearOrderedField α
inst✝¹ : LinearOrderedField β
a✝ a₁ a₂ : α
b : β
q : ℚ
inst✝ : Archimedean α
a : α
⊢ BddAbove (cutMap β a)

Next tactic:
obtain ⟨q, hq⟩ := exists_rat_gt a
theorem cutMap_bddAbove (a : α) : BddAbove (cutMap β a) := by
  obtain ⟨q, hq⟩ := exists_rat_gt a
  

Proof state:
case intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : LinearOrderedField α
inst✝¹ : LinearOrderedField β
a✝ a₁ a₂ : α
b : β
q✝ : ℚ
inst✝ : Archimedean α
a : α
q : ℚ
hq : a < ↑q
⊢ BddAbove (cutMap β a)

Next tactic:
exact ⟨q, ball_image_iff.2 fun r hr => mod_cast (hq.trans' hr).le⟩
theorem cutMap_add (a b : α) : cutMap β (a + b) = cutMap β a + cutMap β b := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : LinearOrderedField α
inst✝¹ : LinearOrderedField β
a✝ a₁ a₂ : α
b✝ : β
q : ℚ
inst✝ : Archimedean α
a b : α
⊢ cutMap β (a + b) = cutMap β a + cutMap β b

Next tactic:
refine (image_subset_iff.2 fun q hq => ?_).antisymm ?_
theorem cutMap_add (a b : α) : cutMap β (a + b) = cutMap β a + cutMap β b := by
  refine (image_subset_iff.2 fun q hq => ?_).antisymm ?_
  · 

Proof state:
case refine_1
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : LinearOrderedField α
inst✝¹ : LinearOrderedField β
a✝ a₁ a₂ : α
b✝ : β
q✝ : ℚ
inst✝ : Archimedean α
a b : α
q : ℚ
hq : q ∈ {t | ↑t < a + b}
⊢ q ∈ Rat.cast ⁻¹' (cutMap β a + cutMap β b)

Next tactic:
rw [mem_setOf_eq, ← sub_lt_iff_lt_add] at hq
theorem cutMap_add (a b : α) : cutMap β (a + b) = cutMap β a + cutMap β b := by
  refine (image_subset_iff.2 fun q hq => ?_).antisymm ?_
  · rw [mem_setOf_eq, ← sub_lt_iff_lt_add] at hq
    

Proof state:
case refine_1
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : LinearOrderedField α
inst✝¹ : LinearOrderedField β
a✝ a₁ a₂ : α
b✝ : β
q✝ : ℚ
inst✝ : Archimedean α
a b : α
q : ℚ
hq : ↑q - b < a
⊢ q ∈ Rat.cast ⁻¹' (cutMap β a + cutMap β b)

Next tactic:
obtain ⟨q₁, hq₁q, hq₁ab⟩ := exists_rat_btwn hq
theorem cutMap_add (a b : α) : cutMap β (a + b) = cutMap β a + cutMap β b := by
  refine (image_subset_iff.2 fun q hq => ?_).antisymm ?_
  · rw [mem_setOf_eq, ← sub_lt_iff_lt_add] at hq
    obtain ⟨q₁, hq₁q, hq₁ab⟩ := exists_rat_btwn hq
    

Proof state:
case refine_1.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : LinearOrderedField α
inst✝¹ : LinearOrderedField β
a✝ a₁ a₂ : α
b✝ : β
q✝ : ℚ
inst✝ : Archimedean α
a b : α
q : ℚ
hq : ↑q - b < a
q₁ : ℚ
hq₁q : ↑q - b < ↑q₁
hq₁ab : ↑q₁ < a
⊢ q ∈ Rat.cast ⁻¹' (cutMap β a + cutMap β b)

Next tactic:
refine ⟨q₁, q - q₁, by rwa [coe_mem_cutMap_iff], ?_, add_sub_cancel'_right _ _⟩
theorem cutMap_add (a b : α) : cutMap β (a + b) = cutMap β a + cutMap β b := by
  refine (image_subset_iff.2 fun q hq => ?_).antisymm ?_
  · rw [mem_setOf_eq, ← sub_lt_iff_lt_add] at hq
    obtain ⟨q₁, hq₁q, hq₁ab⟩ := exists_rat_btwn hq
    refine ⟨q₁, q - q₁, by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : LinearOrderedField α
inst✝¹ : LinearOrderedField β
a✝ a₁ a₂ : α
b✝ : β
q✝ : ℚ
inst✝ : Archimedean α
a b : α
q : ℚ
hq : ↑q - b < a
q₁ : ℚ
hq₁q : ↑q - b < ↑q₁
hq₁ab : ↑q₁ < a
⊢ ↑q₁ ∈ cutMap β a

Next tactic:
rwa [coe_mem_cutMap_iff]
theorem cutMap_add (a b : α) : cutMap β (a + b) = cutMap β a + cutMap β b := by
  refine (image_subset_iff.2 fun q hq => ?_).antisymm ?_
  · rw [mem_setOf_eq, ← sub_lt_iff_lt_add] at hq
    obtain ⟨q₁, hq₁q, hq₁ab⟩ := exists_rat_btwn hq
    refine ⟨q₁, q - q₁, by rwa [coe_mem_cutMap_iff], ?_, add_sub_cancel'_right _ _⟩
    · 

Proof state:
case refine_1.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : LinearOrderedField α
inst✝¹ : LinearOrderedField β
a✝ a₁ a₂ : α
b✝ : β
q✝ : ℚ
inst✝ : Archimedean α
a b : α
q : ℚ
hq : ↑q - b < a
q₁ : ℚ
hq₁q : ↑q - b < ↑q₁
hq₁ab : ↑q₁ < a
⊢ ↑q - ↑q₁ ∈ cutMap β b

Next tactic:
norm_cast
theorem cutMap_add (a b : α) : cutMap β (a + b) = cutMap β a + cutMap β b := by
  refine (image_subset_iff.2 fun q hq => ?_).antisymm ?_
  · rw [mem_setOf_eq, ← sub_lt_iff_lt_add] at hq
    obtain ⟨q₁, hq₁q, hq₁ab⟩ := exists_rat_btwn hq
    refine ⟨q₁, q - q₁, by rwa [coe_mem_cutMap_iff], ?_, add_sub_cancel'_right _ _⟩
    · norm_cast
      

Proof state:
case refine_1.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : LinearOrderedField α
inst✝¹ : LinearOrderedField β
a✝ a₁ a₂ : α
b✝ : β
q✝ : ℚ
inst✝ : Archimedean α
a b : α
q : ℚ
hq : ↑q - b < a
q₁ : ℚ
hq₁q : ↑q - b < ↑q₁
hq₁ab : ↑q₁ < a
⊢ ↑(q - q₁) ∈ cutMap β b

Next tactic:
rw [coe_mem_cutMap_iff]
theorem cutMap_add (a b : α) : cutMap β (a + b) = cutMap β a + cutMap β b := by
  refine (image_subset_iff.2 fun q hq => ?_).antisymm ?_
  · rw [mem_setOf_eq, ← sub_lt_iff_lt_add] at hq
    obtain ⟨q₁, hq₁q, hq₁ab⟩ := exists_rat_btwn hq
    refine ⟨q₁, q - q₁, by rwa [coe_mem_cutMap_iff], ?_, add_sub_cancel'_right _ _⟩
    · norm_cast
      rw [coe_mem_cutMap_iff]
      

Proof state:
case refine_1.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : LinearOrderedField α
inst✝¹ : LinearOrderedField β
a✝ a₁ a₂ : α
b✝ : β
q✝ : ℚ
inst✝ : Archimedean α
a b : α
q : ℚ
hq : ↑q - b < a
q₁ : ℚ
hq₁q : ↑q - b < ↑q₁
hq₁ab : ↑q₁ < a
⊢ ↑(q - q₁) < b

Next tactic:
exact mod_cast sub_lt_comm.mp hq₁q
theorem cutMap_add (a b : α) : cutMap β (a + b) = cutMap β a + cutMap β b := by
  refine (image_subset_iff.2 fun q hq => ?_).antisymm ?_
  · rw [mem_setOf_eq, ← sub_lt_iff_lt_add] at hq
    obtain ⟨q₁, hq₁q, hq₁ab⟩ := exists_rat_btwn hq
    refine ⟨q₁, q - q₁, by rwa [coe_mem_cutMap_iff], ?_, add_sub_cancel'_right _ _⟩
    · norm_cast
      rw [coe_mem_cutMap_iff]
      exact mod_cast sub_lt_comm.mp hq₁q
  · 

Proof state:
case refine_2
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : LinearOrderedField α
inst✝¹ : LinearOrderedField β
a✝ a₁ a₂ : α
b✝ : β
q : ℚ
inst✝ : Archimedean α
a b : α
⊢ cutMap β a + cutMap β b ⊆ Rat.cast '' {t | ↑t < a + b}

Next tactic:
rintro _ ⟨_, _, ⟨qa, ha, rfl⟩, ⟨qb, hb, rfl⟩, rfl⟩
theorem cutMap_add (a b : α) : cutMap β (a + b) = cutMap β a + cutMap β b := by
  refine (image_subset_iff.2 fun q hq => ?_).antisymm ?_
  · rw [mem_setOf_eq, ← sub_lt_iff_lt_add] at hq
    obtain ⟨q₁, hq₁q, hq₁ab⟩ := exists_rat_btwn hq
    refine ⟨q₁, q - q₁, by rwa [coe_mem_cutMap_iff], ?_, add_sub_cancel'_right _ _⟩
    · norm_cast
      rw [coe_mem_cutMap_iff]
      exact mod_cast sub_lt_comm.mp hq₁q
  · rintro _ ⟨_, _, ⟨qa, ha, rfl⟩, ⟨qb, hb, rfl⟩, rfl⟩
    -- After leanprover/lean4#2734, `norm_cast` needs help with beta reduction.
    

Proof state:
case refine_2.intro.intro.intro.intro.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : LinearOrderedField α
inst✝¹ : LinearOrderedField β
a✝ a₁ a₂ : α
b✝ : β
q : ℚ
inst✝ : Archimedean α
a b : α
qa : ℚ
ha : qa ∈ {t | ↑t < a}
qb : ℚ
hb : qb ∈ {t | ↑t < b}
⊢ (fun x x_1 => x + x_1) ↑qa ↑qb ∈ Rat.cast '' {t | ↑t < a + b}

Next tactic:
refine' ⟨qa + qb, _, by beta_reduce; norm_cast⟩
theorem cutMap_add (a b : α) : cutMap β (a + b) = cutMap β a + cutMap β b := by
  refine (image_subset_iff.2 fun q hq => ?_).antisymm ?_
  · rw [mem_setOf_eq, ← sub_lt_iff_lt_add] at hq
    obtain ⟨q₁, hq₁q, hq₁ab⟩ := exists_rat_btwn hq
    refine ⟨q₁, q - q₁, by rwa [coe_mem_cutMap_iff], ?_, add_sub_cancel'_right _ _⟩
    · norm_cast
      rw [coe_mem_cutMap_iff]
      exact mod_cast sub_lt_comm.mp hq₁q
  · rintro _ ⟨_, _, ⟨qa, ha, rfl⟩, ⟨qb, hb, rfl⟩, rfl⟩
    -- After leanprover/lean4#2734, `norm_cast` needs help with beta reduction.
    refine' ⟨qa + qb, _, by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : LinearOrderedField α
inst✝¹ : LinearOrderedField β
a✝ a₁ a₂ : α
b✝ : β
q : ℚ
inst✝ : Archimedean α
a b : α
qa : ℚ
ha : qa ∈ {t | ↑t < a}
qb : ℚ
hb : qb ∈ {t | ↑t < b}
⊢ ↑(qa + qb) = (fun x x_1 => x + x_1) ↑qa ↑qb

Next tactic:
beta_reduce
theorem cutMap_add (a b : α) : cutMap β (a + b) = cutMap β a + cutMap β b := by
  refine (image_subset_iff.2 fun q hq => ?_).antisymm ?_
  · rw [mem_setOf_eq, ← sub_lt_iff_lt_add] at hq
    obtain ⟨q₁, hq₁q, hq₁ab⟩ := exists_rat_btwn hq
    refine ⟨q₁, q - q₁, by rwa [coe_mem_cutMap_iff], ?_, add_sub_cancel'_right _ _⟩
    · norm_cast
      rw [coe_mem_cutMap_iff]
      exact mod_cast sub_lt_comm.mp hq₁q
  · rintro _ ⟨_, _, ⟨qa, ha, rfl⟩, ⟨qb, hb, rfl⟩, rfl⟩
    -- After leanprover/lean4#2734, `norm_cast` needs help with beta reduction.
    refine' ⟨qa + qb, _, by beta_reduce; 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : LinearOrderedField α
inst✝¹ : LinearOrderedField β
a✝ a₁ a₂ : α
b✝ : β
q : ℚ
inst✝ : Archimedean α
a b : α
qa : ℚ
ha : qa ∈ {t | ↑t < a}
qb : ℚ
hb : qb ∈ {t | ↑t < b}
⊢ ↑(qa + qb) = ↑qa + ↑qb

Next tactic:
norm_cast
theorem cutMap_add (a b : α) : cutMap β (a + b) = cutMap β a + cutMap β b := by
  refine (image_subset_iff.2 fun q hq => ?_).antisymm ?_
  · rw [mem_setOf_eq, ← sub_lt_iff_lt_add] at hq
    obtain ⟨q₁, hq₁q, hq₁ab⟩ := exists_rat_btwn hq
    refine ⟨q₁, q - q₁, by rwa [coe_mem_cutMap_iff], ?_, add_sub_cancel'_right _ _⟩
    · norm_cast
      rw [coe_mem_cutMap_iff]
      exact mod_cast sub_lt_comm.mp hq₁q
  · rintro _ ⟨_, _, ⟨qa, ha, rfl⟩, ⟨qb, hb, rfl⟩, rfl⟩
    -- After leanprover/lean4#2734, `norm_cast` needs help with beta reduction.
    refine' ⟨qa + qb, _, by beta_reduce; norm_cast⟩
    

Proof state:
case refine_2.intro.intro.intro.intro.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : LinearOrderedField α
inst✝¹ : LinearOrderedField β
a✝ a₁ a₂ : α
b✝ : β
q : ℚ
inst✝ : Archimedean α
a b : α
qa : ℚ
ha : qa ∈ {t | ↑t < a}
qb : ℚ
hb : qb ∈ {t | ↑t < b}
⊢ qa + qb ∈ {t | ↑t < a + b}

Next tactic:
rw [mem_setOf_eq, cast_add]
theorem cutMap_add (a b : α) : cutMap β (a + b) = cutMap β a + cutMap β b := by
  refine (image_subset_iff.2 fun q hq => ?_).antisymm ?_
  · rw [mem_setOf_eq, ← sub_lt_iff_lt_add] at hq
    obtain ⟨q₁, hq₁q, hq₁ab⟩ := exists_rat_btwn hq
    refine ⟨q₁, q - q₁, by rwa [coe_mem_cutMap_iff], ?_, add_sub_cancel'_right _ _⟩
    · norm_cast
      rw [coe_mem_cutMap_iff]
      exact mod_cast sub_lt_comm.mp hq₁q
  · rintro _ ⟨_, _, ⟨qa, ha, rfl⟩, ⟨qb, hb, rfl⟩, rfl⟩
    -- After leanprover/lean4#2734, `norm_cast` needs help with beta reduction.
    refine' ⟨qa + qb, _, by beta_reduce; norm_cast⟩
    rw [mem_setOf_eq, cast_add]
    

Proof state:
case refine_2.intro.intro.intro.intro.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : LinearOrderedField α
inst✝¹ : LinearOrderedField β
a✝ a₁ a₂ : α
b✝ : β
q : ℚ
inst✝ : Archimedean α
a b : α
qa : ℚ
ha : qa ∈ {t | ↑t < a}
qb : ℚ
hb : qb ∈ {t | ↑t < b}
⊢ ↑qa + ↑qb < a + b

Next tactic:
exact add_lt_add ha hb
theorem inducedMap_rat (q : ℚ) : inducedMap α β (q : α) = q := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝³ : LinearOrderedField α
inst✝² : ConditionallyCompleteLinearOrderedField β
inst✝¹ : ConditionallyCompleteLinearOrderedField γ
inst✝ : Archimedean α
q : ℚ
⊢ inducedMap α β ↑q = ↑q

Next tactic:
refine csSup_eq_of_forall_le_of_forall_lt_exists_gt
    (cutMap_nonempty β (q : α)) (fun x h => ?_) fun w h => ?_
theorem inducedMap_rat (q : ℚ) : inducedMap α β (q : α) = q := by
  refine csSup_eq_of_forall_le_of_forall_lt_exists_gt
    (cutMap_nonempty β (q : α)) (fun x h => ?_) fun w h => ?_
  · 

Proof state:
case refine_1
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝³ : LinearOrderedField α
inst✝² : ConditionallyCompleteLinearOrderedField β
inst✝¹ : ConditionallyCompleteLinearOrderedField γ
inst✝ : Archimedean α
q : ℚ
x : β
h : x ∈ cutMap β ↑q
⊢ x ≤ ↑q

Next tactic:
rw [cutMap_coe] at h
theorem inducedMap_rat (q : ℚ) : inducedMap α β (q : α) = q := by
  refine csSup_eq_of_forall_le_of_forall_lt_exists_gt
    (cutMap_nonempty β (q : α)) (fun x h => ?_) fun w h => ?_
  · rw [cutMap_coe] at h
    

Proof state:
case refine_1
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝³ : LinearOrderedField α
inst✝² : ConditionallyCompleteLinearOrderedField β
inst✝¹ : ConditionallyCompleteLinearOrderedField γ
inst✝ : Archimedean α
q : ℚ
x : β
h : x ∈ Rat.cast '' {r | ↑r < ↑q}
⊢ x ≤ ↑q

Next tactic:
obtain ⟨r, h, rfl⟩ := h