Missing order instances for `Bool`

Open
#16,450 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Domain
devtools

Research direction

Start from the five failing #synth lines in the issue and find where the existing LE, LT, Ord, Min and Max instances for Bool are defined in the core Lean library's Init sources. The targets are the Std.IsLinearOrder and Std.LawfulOrder* classes. Done when all five #synth checks succeed and the new instances compile with their proofs, which requires some familiarity with Lean theorem proving.

Written by the indexing model from the issue text.

Description

bug
Prerequisites
  • Check that your issue is not already filed:
    https://github.com/leanprover/lean4/issues
  • Reduce the issue to a minimal, self-contained, reproducible test case.
    Avoid dependencies to Mathlib or Batteries.
  • Test your test case against the latest nightly release, for example on
    https://live.lean-lang.org/#project=lean-nightly
    (You can also use the settings there to switch to “Lean nightly”)
  • When reporting a perceived soundness bug: Does it affect lake check --paranoid?
    If in doubt, please reach out on [email protected] for responsible disclosure.
Description

There are some order instances for Bool, but most of the order properties are missing. This is not the case for other types such as Nat, String, List, etc.

Context

Mathlib has a LinearOrder instance for Bool which needs to be defined manually. If we had these instances, then it could be defined using LinearOrder.ofStd.

Steps to Reproduce
-- These work
#synth LE Bool
#synth LT Bool
#synth Ord Bool
#synth Min Bool
#synth Max Bool

-- These fail
#synth Std.IsLinearOrder Bool
#synth Std.LawfulOrderLT Bool
#synth Std.LawfulOrderOrd Bool
#synth Std.LawfulOrderMin Bool
#synth Std.LawfulOrderMax Bool

Expected behavior: All the instances above exist.

Actual behavior: The instances don't exist.

Versions

Lean 4.37.0-nightly-2026-11-11

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

Dominant language
Lean
Stars
10.3k
Forks
1.1k
Avg merge
19h 8m
Merged PRs (30d)
421

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from leanprover/lean4

All issues in leanprover/lean4

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.