Theorem: Algebra.IsAlgebraic.cardinal_mk_le_sigma_polynomial
File: Mathlib/FieldTheory/IsAlgClosed/Classification.lean

tactic: dsimp
state_before: 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)}

tactic: 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
state_before: 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)))

tactic: erw [Polynomial.mem_roots h, Polynomial.IsRoot, Polynomial.eval_map, ← Polynomial.aeval_def,
  p.2.2]
state_before: 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)))

tactic: rw [Ne.def, ← Polynomial.degree_eq_bot,
  Polynomial.degree_map_eq_of_injective (NoZeroSMulDivisors.algebraMap_injective R L),
  Polynomial.degree_eq_bot]
state_before: 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

tactic: exact p.2.1
state_before: 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

tactic: intro h
state_before: 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

tactic: simp at h
state_before: 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

tactic: refine' (Subtype.heq_iff_coe_eq _).1 h.2
state_before: 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

tactic: simp only [h.1, iff_self_iff, forall_true_iff]
state_before: 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)))}