Documentation

Counterexamples.CanonicallyOrderedCommSemiringTwoMul

A canonically ordered commutative semiring with two different elements a and b such that a ≠ b and 2 * a = 2 * b. Thus, multiplication by a fixed non-zero element of a canonically ordered semiring need not be injective. In particular, multiplying by a strictly positive element need not be strictly monotone.

Recall that a canonically ordered commutative semiring is a commutative semiring with a partial ordering that is "canonical" in the sense that the inequality a ≤ b holds if and only if there is a c such that a + c = b. There are several compatibility conditions among addition/multiplication and the order relation. The point of the counterexample is to show that monotonicity of multiplication cannot be strengthened to strict monotonicity.

Reference: https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/canonically_ordered.20pathology

theorem Counterexample.mem_zmod_2 (a : ZMod 2) :
Or (Eq a 0) (Eq a 1)

The preorder relation on ℕ × ℤ/2ℤ where we only compare the first coordinate, except that we leave incomparable each pair of elements with the same first component. For instance, ∀ α, β ∈ ℤ/2ℤ, the inequality (1,α) ≤ (2,β) holds, whereas, ∀ n ∈ ℤ, the elements (n,0) and (n,1) are incomparable.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem Counterexample.Nxzmod2.lt_def {a b : Prod Nat (ZMod 2)} :
    Iff (LT.lt a b) (LT.lt a.fst b.fst)

    A strict inequality forces the first components to be different.

    theorem Counterexample.Nxzmod2.add_le_add_left (a b : Prod Nat (ZMod 2)) :
    LE.le a b∀ (c : Prod Nat (ZMod 2)), LE.le (HAdd.hAdd c a) (HAdd.hAdd c b)
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      Initially, L was defined as the subsemiring closure of (1,0).

      Equations
      Instances For
        theorem Counterexample.ExL.add_L {a b : Prod Nat (ZMod 2)} (ha : Ne a { fst := 0, snd := 1 }) (hb : Ne b { fst := 0, snd := 1 }) :
        Ne (HAdd.hAdd a b) { fst := 0, snd := 1 }
        theorem Counterexample.ExL.mul_L {a b : Prod Nat (ZMod 2)} (ha : Ne a { fst := 0, snd := 1 }) (hb : Ne b { fst := 0, snd := 1 }) :
        Ne (HMul.hMul a b) { fst := 0, snd := 1 }

        The subsemiring corresponding to the elements of L, used to transfer instances.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem Counterexample.ExL.exists_add_of_le (a b : L) :
          LE.le a bExists fun (c : L) => Eq b (HAdd.hAdd a c)