Theorem: MixedCharZero.reduce_to_maximal_ideal
File: Mathlib/Algebra/CharP/MixedCharZero.lean

tactic: constructor
state_before: R : Type u_1
inst✝ : CommRing R
p : ℕ
hp : Nat.Prime p
⊢ (∃ I, I ≠ ⊤ ∧ CharP (R ⧸ I) p) ↔ ∃ I, Ideal.IsMaximal I ∧ CharP (R ⧸ I) p

tactic: intro g
state_before: case mp
R : Type u_1
inst✝ : CommRing R
p : ℕ
hp : Nat.Prime p
⊢ (∃ I, I ≠ ⊤ ∧ CharP (R ⧸ I) p) → ∃ I, Ideal.IsMaximal I ∧ CharP (R ⧸ I) p

tactic: rcases g with ⟨I, ⟨hI_not_top, _⟩⟩
state_before: case mp
R : Type u_1
inst✝ : CommRing R
p : ℕ
hp : Nat.Prime p
g : ∃ I, I ≠ ⊤ ∧ CharP (R ⧸ I) p
⊢ ∃ I, Ideal.IsMaximal I ∧ CharP (R ⧸ I) p

tactic: rcases Ideal.exists_le_maximal I hI_not_top with ⟨M, ⟨hM_max, hM_ge⟩⟩
state_before: case mp.intro.intro
R : Type u_1
inst✝ : CommRing R
p : ℕ
hp : Nat.Prime p
I : Ideal R
hI_not_top : I ≠ ⊤
right✝ : CharP (R ⧸ I) p
⊢ ∃ I, Ideal.IsMaximal I ∧ CharP (R ⧸ I) p

tactic: use M
state_before: case mp.intro.intro.intro.intro
R : Type u_1
inst✝ : CommRing R
p : ℕ
hp : Nat.Prime p
I : Ideal R
hI_not_top : I ≠ ⊤
right✝ : CharP (R ⧸ I) p
M : Ideal R
hM_max : Ideal.IsMaximal M
hM_ge : I ≤ M
⊢ ∃ I, Ideal.IsMaximal I ∧ CharP (R ⧸ I) p

tactic: constructor
state_before: case mp.intro.intro.intro.intro
R : Type u_1
inst✝ : CommRing R
p : ℕ
hp : Nat.Prime p
I : Ideal R
hI_not_top : I ≠ ⊤
right✝ : CharP (R ⧸ I) p
M : Ideal R
hM_max : Ideal.IsMaximal M
hM_ge : I ≤ M
⊢ Ideal.IsMaximal M ∧ CharP (R ⧸ M) p

tactic: exact hM_max
state_before: case mp.intro.intro.intro.intro.left
R : Type u_1
inst✝ : CommRing R
p : ℕ
hp : Nat.Prime p
I : Ideal R
hI_not_top : I ≠ ⊤
right✝ : CharP (R ⧸ I) p
M : Ideal R
hM_max : Ideal.IsMaximal M
hM_ge : I ≤ M
⊢ Ideal.IsMaximal M

tactic: have hr := hr
state_before: case mp.intro.intro.intro.intro.right.intro
R : Type u_1
inst✝ : CommRing R
p : ℕ
hp : Nat.Prime p
I : Ideal R
hI_not_top : I ≠ ⊤
right✝ : CharP (R ⧸ I) p
M : Ideal R
hM_max : Ideal.IsMaximal M
hM_ge : I ≤ M
r : ℕ
hr : CharP (R ⧸ M) r
⊢ CharP (R ⧸ M) p

tactic: convert hr
state_before: case mp.intro.intro.intro.intro.right.intro
R : Type u_1
inst✝ : CommRing R
p : ℕ
hp : Nat.Prime p
I : Ideal R
hI_not_top : I ≠ ⊤
right✝ : CharP (R ⧸ I) p
M : Ideal R
hM_max : Ideal.IsMaximal M
hM_ge : I ≤ M
r : ℕ
hr✝ hr : CharP (R ⧸ M) r
⊢ CharP (R ⧸ M) p

tactic: have r_dvd_p : r ∣ p
state_before: case h.e'_3
R : Type u_1
inst✝ : CommRing R
p : ℕ
hp : Nat.Prime p
I : Ideal R
hI_not_top : I ≠ ⊤
right✝ : CharP (R ⧸ I) p
M : Ideal R
hM_max : Ideal.IsMaximal M
hM_ge : I ≤ M
r : ℕ
hr✝ hr : CharP (R ⧸ M) r
⊢ p = r

tactic: symm
state_before: case h.e'_3
R : Type u_1
inst✝ : CommRing R
p : ℕ
hp : Nat.Prime p
I : Ideal R
hI_not_top : I ≠ ⊤
right✝ : CharP (R ⧸ I) p
M : Ideal R
hM_max : Ideal.IsMaximal M
hM_ge : I ≤ M
r : ℕ
hr✝ hr : CharP (R ⧸ M) r
r_dvd_p : r ∣ p
⊢ p = r

tactic: apply (Nat.Prime.eq_one_or_self_of_dvd hp r r_dvd_p).resolve_left
state_before: case h.e'_3
R : Type u_1
inst✝ : CommRing R
p : ℕ
hp : Nat.Prime p
I : Ideal R
hI_not_top : I ≠ ⊤
right✝ : CharP (R ⧸ I) p
M : Ideal R
hM_max : Ideal.IsMaximal M
hM_ge : I ≤ M
r : ℕ
hr✝ hr : CharP (R ⧸ M) r
r_dvd_p : r ∣ p
⊢ r = p

tactic: exact CharP.char_ne_one (R ⧸ M) r
state_before: case h.e'_3
R : Type u_1
inst✝ : CommRing R
p : ℕ
hp : Nat.Prime p
I : Ideal R
hI_not_top : I ≠ ⊤
right✝ : CharP (R ⧸ I) p
M : Ideal R
hM_max : Ideal.IsMaximal M
hM_ge : I ≤ M
r : ℕ
hr✝ hr : CharP (R ⧸ M) r
r_dvd_p : r ∣ p
⊢ ¬r = 1

tactic: rw [← CharP.cast_eq_zero_iff (R ⧸ M) r p]
state_before: case r_dvd_p
R : Type u_1
inst✝ : CommRing R
p : ℕ
hp : Nat.Prime p
I : Ideal R
hI_not_top : I ≠ ⊤
right✝ : CharP (R ⧸ I) p
M : Ideal R
hM_max : Ideal.IsMaximal M
hM_ge : I ≤ M
r : ℕ
hr✝ hr : CharP (R ⧸ M) r
⊢ r ∣ p

tactic: convert congr_arg (Ideal.Quotient.factor I M hM_ge) (CharP.cast_eq_zero (R ⧸ I) p)
state_before: case r_dvd_p
R : Type u_1
inst✝ : CommRing R
p : ℕ
hp : Nat.Prime p
I : Ideal R
hI_not_top : I ≠ ⊤
right✝ : CharP (R ⧸ I) p
M : Ideal R
hM_max : Ideal.IsMaximal M
hM_ge : I ≤ M
r : ℕ
hr✝ hr : CharP (R ⧸ M) r
⊢ ↑p = 0

tactic: intro ⟨I, hI_max, h_charP⟩
state_before: case mpr
R : Type u_1
inst✝ : CommRing R
p : ℕ
hp : Nat.Prime p
⊢ (∃ I, Ideal.IsMaximal I ∧ CharP (R ⧸ I) p) → ∃ I, I ≠ ⊤ ∧ CharP (R ⧸ I) p

tactic: use I
state_before: case mpr
R : Type u_1
inst✝ : CommRing R
p : ℕ
hp : Nat.Prime p
I : Ideal R
hI_max : Ideal.IsMaximal I
h_charP : CharP (R ⧸ I) p
⊢ ∃ I, I ≠ ⊤ ∧ CharP (R ⧸ I) p

tactic: exact ⟨Ideal.IsMaximal.ne_top hI_max, h_charP⟩
state_before: case mpr
R : Type u_1
inst✝ : CommRing R
p : ℕ
hp : Nat.Prime p
I : Ideal R
hI_max : Ideal.IsMaximal I
h_charP : CharP (R ⧸ I) p
⊢ I ≠ ⊤ ∧ CharP (R ⧸ I) p