Theorem: MvPolynomial.prime_C_iff_of_fintype
File: Mathlib/RingTheory/Polynomial/Basic.lean

tactic: let f (d : ℕ) := (finSuccEquiv R d).symm.toMulEquiv
state_before: R✝ : Type u
S : Type ?u.283331
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
⊢ Prime (↑C r) ↔ Prime r

tactic: let _coe' (d : ℕ) : CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R)
  (fun _ => (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R) := inferInstance
state_before: R✝ : Type u
S : Type ?u.283331
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
⊢ Prime (↑C r) ↔ Prime r

tactic: have that (d : ℕ) : @C R (Fin (d+1)) _ r = (f d) (Polynomial.C (@C R (Fin d) _ r)) := by
  rw [← finSuccEquiv_comp_C_eq_C]; rfl
state_before: R✝ : Type u
S : Type ?u.283331
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
⊢ Prime (↑C r) ↔ Prime r

tactic: rw [(renameEquiv R (Fintype.equivFin σ)).toMulEquiv.prime_iff]
state_before: R✝ : Type u
S : Type ?u.283331
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
⊢ Prime (↑C r) ↔ Prime r

tactic: convert_to Prime (C r) ↔ _
state_before: R✝ : Type u
S : Type ?u.283331
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
⊢ Prime (↑(AlgEquiv.toMulEquiv (renameEquiv R (Fintype.equivFin σ))) (↑C r)) ↔ Prime r

tactic: rw [← finSuccEquiv_comp_C_eq_C]
state_before: R✝ : Type u
S : Type ?u.283331
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
d : ℕ
⊢ ↑C r = ↑(f d) (↑Polynomial.C (↑C r))

tactic: rfl
state_before: R✝ : Type u
S : Type ?u.283331
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
d : ℕ
⊢ ↑(RingHom.comp (↑(AlgEquiv.symm (finSuccEquiv R d))) (RingHom.comp Polynomial.C C)) r = ↑(f d) (↑Polynomial.C (↑C r))

tactic: congr!
state_before: case h.e'_1.a
R✝ : Type u
S : Type ?u.283331
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
⊢ Prime (↑(AlgEquiv.toMulEquiv (renameEquiv R (Fintype.equivFin σ))) (↑C r)) ↔ Prime (↑C r)

tactic: apply rename_C
state_before: case h.e'_1.a.a.h.e'_3
R✝ : Type u
S : Type ?u.283331
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
⊢ ↑(AlgEquiv.toMulEquiv (renameEquiv R (Fintype.equivFin σ))) (↑C r) = ↑C r

tactic: symm
state_before: R✝ : Type u
S : Type ?u.283331
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
⊢ Prime (↑C r) ↔ Prime r

tactic: induction' Fintype.card σ with d hd
state_before: R✝ : Type u
S : Type ?u.283331
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
⊢ Prime r ↔ Prime (↑C r)

tactic: exact (isEmptyAlgEquiv R (Fin 0)).toMulEquiv.symm.prime_iff
state_before: case zero
R✝ : Type u
S : Type ?u.283331
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
⊢ Prime r ↔ Prime (↑C r)

tactic: rw [hd, ← Polynomial.prime_C_iff]
state_before: case succ
R✝ : Type u
S : Type ?u.283331
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
d : ℕ
hd : Prime r ↔ Prime (↑C r)
⊢ Prime r ↔ Prime (↑C r)

tactic: rw [that d]
state_before: case succ
R✝ : Type u
S : Type ?u.283331
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
d : ℕ
hd : Prime r ↔ Prime (↑C r)
⊢ Prime (↑Polynomial.C (↑C r)) ↔ Prime (↑C r)

tactic: refine @MulEquiv.prime_iff (MvPolynomial (Fin d) R)[X] (MvPolynomial (Fin (d + 1)) R)
  ?_ ?_ (Polynomial.C (C r)) ?_
state_before: case succ
R✝ : Type u
S : Type ?u.283331
σ✝ : Type v
M : Type w
inst✝⁵ : CommRing R✝
inst✝⁴ : CommRing S
inst✝³ : AddCommGroup M
inst✝² : Module R✝ M
r✝ : R✝
R : Type u
σ : Type v
r : R
inst✝¹ : CommRing R
inst✝ : Fintype σ
f : (d : ℕ) → (MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R :=
  fun d => AlgEquiv.toMulEquiv (AlgEquiv.symm (finSuccEquiv R d))
_coe' : (d : ℕ) →
  CoeFun ((MvPolynomial (Fin d) R)[X] ≃* MvPolynomial (Fin (d + 1)) R) fun x =>
    (MvPolynomial (Fin d) R)[X] → MvPolynomial (Fin (d + 1)) R :=
  fun d => inferInstance
that : ∀ (d : ℕ), ↑C r = ↑(f d) (↑Polynomial.C (↑C r))
d : ℕ
hd : Prime r ↔ Prime (↑C r)
⊢ Prime (↑Polynomial.C (↑C r)) ↔ Prime (↑(f d) (↑Polynomial.C (↑C r)))