lean4-htt/tests/lean/run/optionDecEq.lean
Aaron Liu 5c8ebd8868
feat: make Option.decidableEqNone coherent with Option.instDecidableEq (#9302)
This PR modifies `Option.instDecidableEq` and `Option.decidableEqNone`
so that the latter can be made into a global instance without causing
diamonds. It also adds `Option.decidabeNoneEq`.

See
[Zulip](https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/Option.2EdecidableEqNone/near/527226250).

---------

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Rob Simmons <rob@lean-fro.org>
2025-11-20 01:48:42 +00:00

11 lines
329 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

variable {α : Type u} [DecidableEq α]
-- test for instance diamonds
example (x : Option α) :
Option.instDecidableEq x none = Option.decidableEqNone x := by
with_reducible_and_instances rfl
example (x : Option α) :
Option.instDecidableEq none x = Option.decidableNoneEq x := by
with_reducible_and_instances rfl