Theorem: isIdempotentElem_one_sub_one_sub_pow_pow
File: Mathlib/RingTheory/Idempotents.lean

Proof steps:
state_before: R : Type u_1
S : Type u_2
inst✝¹ : Ring R
inst✝ : Ring S
f : R →+* S
x : R
n : ℕ
hx : (x - x ^ 2) ^ n = 0
⊢ IsIdempotentElem (1 - (1 - x ^ n) ^ n)
state_after: R : Type u_1
S : Type u_2
inst✝¹ : Ring R
inst✝ : Ring S
f : R →+* S
x : R
n : ℕ
hx : (x - x ^ 2) ^ n = 0
P : Polynomial ℤ := 1 - (1 - Polynomial.X ^ n) ^ n
⊢ IsIdempotentElem (1 - (1 - x ^ n) ^ n)
tactic: let P : Polynomial ℤ := 1 - (1 - .X ^ n) ^ n
state_before: R : Type u_1
S : Type u_2
inst✝¹ : Ring R
inst✝ : Ring S
f : R →+* S
x : R
n : ℕ
hx : (x - x ^ 2) ^ n = 0
P : Polynomial ℤ := 1 - (1 - Polynomial.X ^ n) ^ n
⊢ IsIdempotentElem (1 - (1 - x ^ n) ^ n)
state_after: R : Type u_1
S : Type u_2
inst✝¹ : Ring R
inst✝ : Ring S
f : R →+* S
x : R
n : ℕ
hx : (x - x ^ 2) ^ n = 0
P : Polynomial ℤ := 1 - (1 - Polynomial.X ^ n) ^ n
this : (Polynomial.X - Polynomial.X ^ 2) ^ n ∣ P - P ^ 2
⊢ IsIdempotentElem (1 - (1 - x ^ n) ^ n)
tactic: have : (.X - .X ^ 2) ^ n ∣ P - P ^ 2 := by
    have H₁ : .X ^ n ∣ P := by
      have := sub_dvd_pow_sub_pow 1 ((1 : Polynomial ℤ) - Polynomial.X ^ n) n
      rwa [sub_sub_cancel, one_pow] at this
    have H₂ : (1 - .X) ^ n ∣ 1 - P := by
      simp only [sub_sub_cancel, P]
      simpa using pow_dvd_pow_of_dvd (sub_dvd_pow_sub_pow (α := Polynomial ℤ) 1 Polynomial.X n) n
    have := mul_dvd_mul H₁ H₂
    simpa only [← mul_pow, mul_sub, mul_one, ← pow_two] using this
state_before: R : Type u_1
S : Type u_2
inst✝¹ : Ring R
inst✝ : Ring S
f : R →+* S
x : R
n : ℕ
hx : (x - x ^ 2) ^ n = 0
P : Polynomial ℤ := 1 - (1 - Polynomial.X ^ n) ^ n
this : (Polynomial.X - Polynomial.X ^ 2) ^ n ∣ P - P ^ 2
⊢ IsIdempotentElem (1 - (1 - x ^ n) ^ n)
state_after: R : Type u_1
S : Type u_2
inst✝¹ : Ring R
inst✝ : Ring S
f : R →+* S
x : R
n : ℕ
hx : (x - x ^ 2) ^ n = 0
P : Polynomial ℤ := 1 - (1 - Polynomial.X ^ n) ^ n
this✝ : (Polynomial.X - Polynomial.X ^ 2) ^ n ∣ P - P ^ 2
this : (Polynomial.aeval x) ((Polynomial.X - Polynomial.X ^ 2) ^ n) ∣ (Polynomial.aeval x) (P - P ^ 2)
⊢ IsIdempotentElem (1 - (1 - x ^ n) ^ n)
tactic: have := map_dvd (Polynomial.aeval x) this
state_before: R : Type u_1
S : Type u_2
inst✝¹ : Ring R
inst✝ : Ring S
f : R →+* S
x : R
n : ℕ
hx : (x - x ^ 2) ^ n = 0
P : Polynomial ℤ := 1 - (1 - Polynomial.X ^ n) ^ n
this✝ : (Polynomial.X - Polynomial.X ^ 2) ^ n ∣ P - P ^ 2
this : (Polynomial.aeval x) ((Polynomial.X - Polynomial.X ^ 2) ^ n) ∣ (Polynomial.aeval x) (P - P ^ 2)
⊢ IsIdempotentElem (1 - (1 - x ^ n) ^ n)
state_after: R : Type u_1
S : Type u_2
inst✝¹ : Ring R
inst✝ : Ring S
f : R →+* S
x : R
n : ℕ
hx : (x - x ^ 2) ^ n = 0
P : Polynomial ℤ := 1 - (1 - Polynomial.X ^ n) ^ n
this✝ : (Polynomial.X - Polynomial.X ^ 2) ^ n ∣ P - P ^ 2
this : 1 - (1 - x ^ n) ^ n - (1 - (1 - x ^ n) ^ n) ^ 2 = 0
⊢ IsIdempotentElem (1 - (1 - x ^ n) ^ n)
tactic: simp only [map_pow, map_sub, Polynomial.aeval_X, hx, map_one, zero_dvd_iff, P] at this
state_before: R : Type u_1
S : Type u_2
inst✝¹ : Ring R
inst✝ : Ring S
f : R →+* S
x : R
n : ℕ
hx : (x - x ^ 2) ^ n = 0
P : Polynomial ℤ := 1 - (1 - Polynomial.X ^ n) ^ n
this✝ : (Polynomial.X - Polynomial.X ^ 2) ^ n ∣ P - P ^ 2
this : 1 - (1 - x ^ n) ^ n - (1 - (1 - x ^ n) ^ n) ^ 2 = 0
⊢ IsIdempotentElem (1 - (1 - x ^ n) ^ n)
state_after: no goals
tactic: rwa [sub_eq_zero, eq_comm, pow_two] at this