Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
counterexample(counterexamples/char_p_zero_ne_char_zero.lean): `char_…
…p R 0` and `char_zero R` need not coincide (#13080) Following the [Zulip discussion](https://leanprover.zulipchat.com/#narrow/stream/217875-Is-there-code-for-X.3F), this counterexample formalizes a `semiring R` for which `char_p R 0` holds, but `char_zero R` does not. See #13075 for the PR that lead to this example.
- Loading branch information
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/- | ||
Copyright (c) 2022 Damiano Testa. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Damiano Testa, Eric Wieser | ||
-/ | ||
import algebra.char_p.basic | ||
|
||
/-! # `char_p R 0` and `char_zero R` need not coincide for semirings | ||
For rings, the two notions coincide. | ||
In fact, `char_p.of_char_zero` shows that `char_zero R` implies `char_p R 0` for any `char_zero` | ||
`add_monoid R` with `1`. | ||
The reverse implication holds for any `add_left_cancel_monoid R` with `1`, by `char_p_to_char_zero`. | ||
This file shows that there are semiring `R` for which `char_p R 0` holds and `char_zero R` does not. | ||
The example is `{0, 1}` with saturating addition. | ||
--/ | ||
|
||
local attribute [semireducible] with_zero | ||
|
||
@[simp] lemma add_one_eq_one : ∀ (x : with_zero unit), x + 1 = 1 | ||
| 0 := rfl | ||
| 1 := rfl | ||
|
||
lemma with_zero_unit_char_p_zero : char_p (with_zero unit) 0 := | ||
⟨λ x, by cases x; simp⟩ | ||
|
||
lemma with_zero_unit_not_char_zero : ¬ char_zero (with_zero unit) := | ||
λ ⟨h⟩, h.ne (by simp : 1 + 1 ≠ 0 + 1) (by simp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters