Grip.Modality: the three-valued modality #
never < possibly < always, the truth values of the grip parser grade algebra.
Batteries-only: no mathlib. Join and meet are the core Max/Min classes
(max/min); grip deliberately does not declare Sup/Inf, so grip-props can import
mathlib (which declares those) without a duplicate-declaration clash.
@[instance_reducible]
Equations
- instReprModality.repr never prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Modality.never")).group prec✝
- instReprModality.repr possibly prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Modality.possibly")).group prec✝
- instReprModality.repr always prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Modality.always")).group prec✝
Instances For
@[instance_reducible]
Equations
- instReprModality = { reprPrec := instReprModality.repr }
@[reducible]
Supremum on Modality: the join in never < possibly < always.
max a b = a when a is the greater element.
Reducible so that a grade product of named grades (conditional * conditional, ...)
still reduces under instances transparency, which is what dsimp/rw type-check
goals at since Lean v4.31.
Equations
Instances For
@[instance_reducible]
Equations
- Modality.instMax = { max := Modality.sup }
@[instance_reducible]
Equations
- Modality.instMin = { min := Modality.inf }
@[instance_reducible]
Equations
- Modality.instLE = { le := Modality.le }
@[instance_reducible]
Decidability of ≤ on Modality.
Equations
- never.instDecidableLe never = isTrue True.intro
- never.instDecidableLe possibly = isTrue True.intro
- never.instDecidableLe always = isTrue True.intro
- possibly.instDecidableLe never = isFalse Modality.instDecidableLe._proof_1
- possibly.instDecidableLe possibly = isTrue True.intro
- possibly.instDecidableLe always = isTrue True.intro
- always.instDecidableLe never = isFalse Modality.instDecidableLe._proof_2
- always.instDecidableLe possibly = isFalse Modality.instDecidableLe._proof_3
- always.instDecidableLe always = isTrue True.intro