feat: implement isEquiv in Lean
This commit is contained in:
parent
2f4a1f1239
commit
875d7657d9
1 changed files with 11 additions and 6 deletions
|
|
@ -49,6 +49,11 @@ def isIMax : Level → Bool
|
|||
| imax _ _ => true
|
||||
| _ => false
|
||||
|
||||
def isMaxIMax : Level → Bool
|
||||
| max _ _ => true
|
||||
| imax _ _ => true
|
||||
| _ => false
|
||||
|
||||
def isParam : Level → Bool
|
||||
| param _ => true
|
||||
| _ => false
|
||||
|
|
@ -144,12 +149,6 @@ protected constant beq (a : @& Level) (b : @& Level) : Bool := default _
|
|||
|
||||
instance : HasBeq Level := ⟨Level.beq⟩
|
||||
|
||||
/- Return true if `a` and `b` denote the same level.
|
||||
Check is currently incomplete.
|
||||
TODO: implement in Lean. -/
|
||||
@[extern "lean_level_eqv"]
|
||||
constant isEquiv (a : @& Level) (b : @& Level) : Bool := default _
|
||||
|
||||
/-- `occurs u l` return `true` iff `u` occurs in `l`. -/
|
||||
def occurs : Level → Level → Bool
|
||||
| u, l@(succ l₁) => u == l || occurs u l₁
|
||||
|
|
@ -259,6 +258,12 @@ partial def normalize : Level → Level
|
|||
addOffset (mkIMaxAux l₁ l₂) k
|
||||
| _ => unreachable!
|
||||
|
||||
|
||||
/- Return true if `u` and `v` denote the same level.
|
||||
Check is currently incomplete. -/
|
||||
def isEquiv (u v : Level) : Bool :=
|
||||
u == v || u.normalize == v.normalize
|
||||
|
||||
/- Level to Format -/
|
||||
namespace LevelToFormat
|
||||
inductive Result
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue