English
For any nonassoc semiring R, there exists a unique p with CharP R p.
Русский
Для любого неабстрактного полупринодного кольца R существует уникальное p, такое что CharP R p.
LaTeX
$$$\exists! p, \mathrm{CharP}(R, p).$$$
Lean4
theorem «exists» : ∃ p, CharP R p :=
letI := Classical.decEq R
by_cases
(fun H : ∀ p : ℕ, (p : R) = 0 → p = 0 => ⟨0, ⟨fun x => by rw [zero_dvd_iff]; exact ⟨H x, by rintro rfl; simp⟩⟩⟩)
fun H =>
⟨Nat.find (not_forall.1 H),
⟨fun x =>
⟨fun H1 =>
Nat.dvd_of_mod_eq_zero
(by_contradiction fun H2 =>
Nat.find_min (not_forall.1 H)
(Nat.mod_lt x <| Nat.pos_of_ne_zero <| not_of_not_imp <| Nat.find_spec (not_forall.1 H))
(not_imp_of_and_not
⟨by
rwa [← Nat.mod_add_div x (Nat.find (not_forall.1 H)), Nat.cast_add, Nat.cast_mul,
of_not_not (not_not_of_not_imp <| Nat.find_spec (not_forall.1 H)), zero_mul, add_zero] at H1,
H2⟩)),
fun H1 => by
rw [← Nat.mul_div_cancel' H1, Nat.cast_mul, of_not_not (not_not_of_not_imp <| Nat.find_spec (not_forall.1 H)),
zero_mul]⟩⟩⟩