R L : Type u
inst✝⁴ : CommRing R
inst✝³ : CommRing L
inst✝² : IsDomain L
inst✝¹ : Algebra R L
inst✝ : NoZeroSMulDivisors R L
halg : IsAlgebraic R L
x : L
p : { x_1 // x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0 } :=
  Classical.indefiniteDescription (fun x_1 => x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0) (_ : _root_.IsAlgebraic R x)
⊢ x ∈
    Polynomial.roots
      (Polynomial.map (algebraMap R L)
        ↑(Classical.indefiniteDescription (fun x_1 => ¬x_1 = 0 ∧ ↑(Polynomial.aeval x) x_1 = 0)
            (_ : _root_.IsAlgebraic R x)))
R L : Type u
inst✝⁴ : CommRing R
inst✝³ : CommRing L
inst✝² : IsDomain L
inst✝¹ : Algebra R L
inst✝ : NoZeroSMulDivisors R L
halg : IsAlgebraic R L
x : L
p : { x_1 // x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0 } :=
  Classical.indefiniteDescription (fun x_1 => x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0) (_ : _root_.IsAlgebraic R x)
⊢ x ∈ {x_1 | x_1 ∈ Polynomial.roots (Polynomial.map (algebraMap R L) ↑p)}
dsimp
R L : Type u
inst✝⁴ : CommRing R
inst✝³ : CommRing L
inst✝² : IsDomain L
inst✝¹ : Algebra R L
inst✝ : NoZeroSMulDivisors R L
halg : IsAlgebraic R L
x : L
p : { x_1 // x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0 } :=
  Classical.indefiniteDescription (fun x_1 => x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0) (_ : _root_.IsAlgebraic R x)
h : Polynomial.map (algebraMap R L) ↑p ≠ 0
⊢ x ∈
    Polynomial.roots
      (Polynomial.map (algebraMap R L)
        ↑(Classical.indefiniteDescription (fun x_1 => ¬x_1 = 0 ∧ ↑(Polynomial.aeval x) x_1 = 0)
            (_ : _root_.IsAlgebraic R x)))
R L : Type u
inst✝⁴ : CommRing R
inst✝³ : CommRing L
inst✝² : IsDomain L
inst✝¹ : Algebra R L
inst✝ : NoZeroSMulDivisors R L
halg : IsAlgebraic R L
x : L
p : { x_1 // x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0 } :=
  Classical.indefiniteDescription (fun x_1 => x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0) (_ : _root_.IsAlgebraic R x)
⊢ x ∈
    Polynomial.roots
      (Polynomial.map (algebraMap R L)
        ↑(Classical.indefiniteDescription (fun x_1 => ¬x_1 = 0 ∧ ↑(Polynomial.aeval x) x_1 = 0)
            (_ : _root_.IsAlgebraic R x)))
have h : p.1.map (algebraMap R L) ≠ 0 := by
  rw [Ne.def, ← Polynomial.degree_eq_bot,
    Polynomial.degree_map_eq_of_injective (NoZeroSMulDivisors.algebraMap_injective R L),
    Polynomial.degree_eq_bot]
  exact p.2.1
no goals
R L : Type u
inst✝⁴ : CommRing R
inst✝³ : CommRing L
inst✝² : IsDomain L
inst✝¹ : Algebra R L
inst✝ : NoZeroSMulDivisors R L
halg : IsAlgebraic R L
x : L
p : { x_1 // x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0 } :=
  Classical.indefiniteDescription (fun x_1 => x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0) (_ : _root_.IsAlgebraic R x)
h : Polynomial.map (algebraMap R L) ↑p ≠ 0
⊢ x ∈
    Polynomial.roots
      (Polynomial.map (algebraMap R L)
        ↑(Classical.indefiniteDescription (fun x_1 => ¬x_1 = 0 ∧ ↑(Polynomial.aeval x) x_1 = 0)
            (_ : _root_.IsAlgebraic R x)))
erw [Polynomial.mem_roots h, Polynomial.IsRoot, Polynomial.eval_map, ← Polynomial.aeval_def,
  p.2.2]
R L : Type u
inst✝⁴ : CommRing R
inst✝³ : CommRing L
inst✝² : IsDomain L
inst✝¹ : Algebra R L
inst✝ : NoZeroSMulDivisors R L
halg : IsAlgebraic R L
x : L
p : { x_1 // x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0 } :=
  Classical.indefiniteDescription (fun x_1 => x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0) (_ : _root_.IsAlgebraic R x)
⊢ ¬↑p = 0
R L : Type u
inst✝⁴ : CommRing R
inst✝³ : CommRing L
inst✝² : IsDomain L
inst✝¹ : Algebra R L
inst✝ : NoZeroSMulDivisors R L
halg : IsAlgebraic R L
x : L
p : { x_1 // x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0 } :=
  Classical.indefiniteDescription (fun x_1 => x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0) (_ : _root_.IsAlgebraic R x)
⊢ Polynomial.map (algebraMap R L) ↑p ≠ 0
rw [Ne.def, ← Polynomial.degree_eq_bot,
  Polynomial.degree_map_eq_of_injective (NoZeroSMulDivisors.algebraMap_injective R L),
  Polynomial.degree_eq_bot]
no goals
R L : Type u
inst✝⁴ : CommRing R
inst✝³ : CommRing L
inst✝² : IsDomain L
inst✝¹ : Algebra R L
inst✝ : NoZeroSMulDivisors R L
halg : IsAlgebraic R L
x : L
p : { x_1 // x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0 } :=
  Classical.indefiniteDescription (fun x_1 => x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0) (_ : _root_.IsAlgebraic R x)
⊢ ¬↑p = 0
exact p.2.1
R L : Type u
inst✝⁴ : CommRing R
inst✝³ : CommRing L
inst✝² : IsDomain L
inst✝¹ : Algebra R L
inst✝ : NoZeroSMulDivisors R L
halg : IsAlgebraic R L
x y : L
h :
  (fun x =>
        let p :=
          Classical.indefiniteDescription (fun x_1 => x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0)
            (_ : _root_.IsAlgebraic R x);
        { fst := ↑p,
          snd :=
            { val := x, property := (_ : x ∈ {x_1 | x_1 ∈ Polynomial.roots (Polynomial.map (algebraMap R L) ↑p)}) } })
      x =
    (fun x =>
        let p :=
          Classical.indefiniteDescription (fun x_1 => x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0)
            (_ : _root_.IsAlgebraic R x);
        { fst := ↑p,
          snd :=
            { val := x, property := (_ : x ∈ {x_1 | x_1 ∈ Polynomial.roots (Polynomial.map (algebraMap R L) ↑p)}) } })
      y
⊢ x = y
R L : Type u
inst✝⁴ : CommRing R
inst✝³ : CommRing L
inst✝² : IsDomain L
inst✝¹ : Algebra R L
inst✝ : NoZeroSMulDivisors R L
halg : IsAlgebraic R L
x y : L
⊢ (fun x =>
          let p :=
            Classical.indefiniteDescription (fun x_1 => x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0)
              (_ : _root_.IsAlgebraic R x);
          { fst := ↑p,
            snd :=
              { val := x, property := (_ : x ∈ {x_1 | x_1 ∈ Polynomial.roots (Polynomial.map (algebraMap R L) ↑p)}) } })
        x =
      (fun x =>
          let p :=
            Classical.indefiniteDescription (fun x_1 => x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0)
              (_ : _root_.IsAlgebraic R x);
          { fst := ↑p,
            snd :=
              { val := x, property := (_ : x ∈ {x_1 | x_1 ∈ Polynomial.roots (Polynomial.map (algebraMap R L) ↑p)}) } })
        y →
    x = y
intro h
R L : Type u
inst✝⁴ : CommRing R
inst✝³ : CommRing L
inst✝² : IsDomain L
inst✝¹ : Algebra R L
inst✝ : NoZeroSMulDivisors R L
halg : IsAlgebraic R L
x y : L
h :
  ↑(Classical.indefiniteDescription (fun x_1 => ¬x_1 = 0 ∧ ↑(Polynomial.aeval x) x_1 = 0)
          (_ : _root_.IsAlgebraic R x)) =
      ↑(Classical.indefiniteDescription (fun x => ¬x = 0 ∧ ↑(Polynomial.aeval y) x = 0) (_ : _root_.IsAlgebraic R y)) ∧
    HEq
      { val := x,
        property :=
          (_ :
            x ∈
              {x_1 |
                x_1 ∈
                  Polynomial.roots
                    (Polynomial.map (algebraMap R L)
                      ↑(Classical.indefiniteDescription (fun x_2 => x_2 ≠ 0 ∧ ↑(Polynomial.aeval x) x_2 = 0)
                          (_ : _root_.IsAlgebraic R x)))}) }
      { val := y,
        property :=
          (_ :
            y ∈
              {x |
                x ∈
                  Polynomial.roots
                    (Polynomial.map (algebraMap R L)
                      ↑(Classical.indefiniteDescription (fun x => x ≠ 0 ∧ ↑(Polynomial.aeval y) x = 0)
                          (_ : _root_.IsAlgebraic R y)))}) }
⊢ x = y
R L : Type u
inst✝⁴ : CommRing R
inst✝³ : CommRing L
inst✝² : IsDomain L
inst✝¹ : Algebra R L
inst✝ : NoZeroSMulDivisors R L
halg : IsAlgebraic R L
x y : L
h :
  (fun x =>
        let p :=
          Classical.indefiniteDescription (fun x_1 => x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0)
            (_ : _root_.IsAlgebraic R x);
        { fst := ↑p,
          snd :=
            { val := x, property := (_ : x ∈ {x_1 | x_1 ∈ Polynomial.roots (Polynomial.map (algebraMap R L) ↑p)}) } })
      x =
    (fun x =>
        let p :=
          Classical.indefiniteDescription (fun x_1 => x_1 ≠ 0 ∧ ↑(Polynomial.aeval x) x_1 = 0)
            (_ : _root_.IsAlgebraic R x);
        { fst := ↑p,
          snd :=
            { val := x, property := (_ : x ∈ {x_1 | x_1 ∈ Polynomial.roots (Polynomial.map (algebraMap R L) ↑p)}) } })
      y
⊢ x = y
simp at h
R L : Type u
inst✝⁴ : CommRing R
inst✝³ : CommRing L
inst✝² : IsDomain L
inst✝¹ : Algebra R L
inst✝ : NoZeroSMulDivisors R L
halg : IsAlgebraic R L
x y : L
h :
  ↑(Classical.indefiniteDescription (fun x_1 => ¬x_1 = 0 ∧ ↑(Polynomial.aeval x) x_1 = 0)
          (_ : _root_.IsAlgebraic R x)) =
      ↑(Classical.indefiniteDescription (fun x => ¬x = 0 ∧ ↑(Polynomial.aeval y) x = 0) (_ : _root_.IsAlgebraic R y)) ∧
    HEq
      { val := x,
        property :=
          (_ :
            x ∈
              {x_1 |
                x_1 ∈
                  Polynomial.roots
                    (Polynomial.map (algebraMap R L)
                      ↑(Classical.indefiniteDescription (fun x_2 => x_2 ≠ 0 ∧ ↑(Polynomial.aeval x) x_2 = 0)
                          (_ : _root_.IsAlgebraic R x)))}) }
      { val := y,
        property :=
          (_ :
            y ∈
              {x |
                x ∈
                  Polynomial.roots
                    (Polynomial.map (algebraMap R L)
                      ↑(Classical.indefiniteDescription (fun x => x ≠ 0 ∧ ↑(Polynomial.aeval y) x = 0)
                          (_ : _root_.IsAlgebraic R y)))}) }
⊢ ∀ (x_1 : L),
    x_1 ∈
        {x_2 |
          x_2 ∈
            Polynomial.roots
              (Polynomial.map (algebraMap R L)
                ↑(Classical.indefiniteDescription (fun x_3 => x_3 ≠ 0 ∧ ↑(Polynomial.aeval x) x_3 = 0)
                    (_ : _root_.IsAlgebraic R x)))} ↔
      x_1 ∈
        {x |
          x ∈
            Polynomial.roots
              (Polynomial.map (algebraMap R L)
                ↑(Classical.indefiniteDescription (fun x => x ≠ 0 ∧ ↑(Polynomial.aeval y) x = 0)
                    (_ : _root_.IsAlgebraic R y)))}
R L : Type u
inst✝⁴ : CommRing R
inst✝³ : CommRing L
inst✝² : IsDomain L
inst✝¹ : Algebra R L
inst✝ : NoZeroSMulDivisors R L
halg : IsAlgebraic R L
x y : L
h :
  ↑(Classical.indefiniteDescription (fun x_1 => ¬x_1 = 0 ∧ ↑(Polynomial.aeval x) x_1 = 0)
          (_ : _root_.IsAlgebraic R x)) =
      ↑(Classical.indefiniteDescription (fun x => ¬x = 0 ∧ ↑(Polynomial.aeval y) x = 0) (_ : _root_.IsAlgebraic R y)) ∧
    HEq
      { val := x,
        property :=
          (_ :
            x ∈
              {x_1 |
                x_1 ∈
                  Polynomial.roots
                    (Polynomial.map (algebraMap R L)
                      ↑(Classical.indefiniteDescription (fun x_2 => x_2 ≠ 0 ∧ ↑(Polynomial.aeval x) x_2 = 0)
                          (_ : _root_.IsAlgebraic R x)))}) }
      { val := y,
        property :=
          (_ :
            y ∈
              {x |
                x ∈
                  Polynomial.roots
                    (Polynomial.map (algebraMap R L)
                      ↑(Classical.indefiniteDescription (fun x => x ≠ 0 ∧ ↑(Polynomial.aeval y) x = 0)
                          (_ : _root_.IsAlgebraic R y)))}) }
⊢ x = y
refine' (Subtype.heq_iff_coe_eq _).1 h.2
no goals
R L : Type u
inst✝⁴ : CommRing R
inst✝³ : CommRing L
inst✝² : IsDomain L
inst✝¹ : Algebra R L
inst✝ : NoZeroSMulDivisors R L
halg : IsAlgebraic R L
x y : L
h :
  ↑(Classical.indefiniteDescription (fun x_1 => ¬x_1 = 0 ∧ ↑(Polynomial.aeval x) x_1 = 0)
          (_ : _root_.IsAlgebraic R x)) =
      ↑(Classical.indefiniteDescription (fun x => ¬x = 0 ∧ ↑(Polynomial.aeval y) x = 0) (_ : _root_.IsAlgebraic R y)) ∧
    HEq
      { val := x,
        property :=
          (_ :
            x ∈
              {x_1 |
                x_1 ∈
                  Polynomial.roots
                    (Polynomial.map (algebraMap R L)
                      ↑(Classical.indefiniteDescription (fun x_2 => x_2 ≠ 0 ∧ ↑(Polynomial.aeval x) x_2 = 0)
                          (_ : _root_.IsAlgebraic R x)))}) }
      { val := y,
        property :=
          (_ :
            y ∈
              {x |
                x ∈
                  Polynomial.roots
                    (Polynomial.map (algebraMap R L)
                      ↑(Classical.indefiniteDescription (fun x => x ≠ 0 ∧ ↑(Polynomial.aeval y) x = 0)
                          (_ : _root_.IsAlgebraic R y)))}) }
⊢ ∀ (x_1 : L),
    x_1 ∈
        {x_2 |
          x_2 ∈
            Polynomial.roots
              (Polynomial.map (algebraMap R L)
                ↑(Classical.indefiniteDescription (fun x_3 => x_3 ≠ 0 ∧ ↑(Polynomial.aeval x) x_3 = 0)
                    (_ : _root_.IsAlgebraic R x)))} ↔
      x_1 ∈
        {x |
          x ∈
            Polynomial.roots
              (Polynomial.map (algebraMap R L)
                ↑(Classical.indefiniteDescription (fun x => x ≠ 0 ∧ ↑(Polynomial.aeval y) x = 0)
                    (_ : _root_.IsAlgebraic R y)))}
simp only [h.1, iff_self_iff, forall_true_iff]