Register cases rules on lattice carriers for aesop automation
Tag the finite lattice carrier types with `@[aesop safe cases]` (`AboveBelow`, `Sign`) so aesop performs the dominant proof step in this framework -- case-splitting a lattice element -- automatically. Combined with the existing `@[simp]` operation lemmas, this collapses the recurring "case-split then reduce" proofs to a bare `aesop`: * AboveBelow's six lattice axioms drop their explicit `rcases` * Sign/Constant `plus_mono₂`/`minus_mono₂` become `by aesop` * Constant `plus_valid`/`minus_valid` shrink to a 2-line `rcases <;> simp_all` * `not_mk_lt_mk` is reexpressed via `le_cases` Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,8 @@ inductive Sign where
|
||||
| zero
|
||||
deriving DecidableEq
|
||||
|
||||
attribute [aesop safe cases] Sign
|
||||
|
||||
instance : Showable Sign :=
|
||||
⟨fun
|
||||
| .plus => "+"
|
||||
@@ -57,21 +59,13 @@ def minus : SignLattice → SignLattice → SignLattice
|
||||
|
||||
lemma plus_mono₂ : Monotone₂ plus :=
|
||||
AboveBelow.monotone₂_of_strict plus
|
||||
(fun y => by cases y <;> rfl)
|
||||
(fun x => by rcases x with _ | _ | s <;> first | rfl | (cases s <;> rfl))
|
||||
(fun y hy => by cases y <;> first | exact absurd rfl hy | rfl)
|
||||
(fun x hx => by
|
||||
rcases x with _ | _ | s <;>
|
||||
first | exact absurd rfl hx | rfl | (cases s <;> rfl))
|
||||
(fun y => by aesop) (fun x => by aesop)
|
||||
(fun y hy => by aesop) (fun x hx => by aesop)
|
||||
|
||||
lemma minus_mono₂ : Monotone₂ minus :=
|
||||
AboveBelow.monotone₂_of_strict minus
|
||||
(fun y => by cases y <;> rfl)
|
||||
(fun x => by rcases x with _ | _ | s <;> first | rfl | (cases s <;> rfl))
|
||||
(fun y hy => by cases y <;> first | exact absurd rfl hy | rfl)
|
||||
(fun x hx => by
|
||||
rcases x with _ | _ | s <;>
|
||||
first | exact absurd rfl hx | rfl | (cases s <;> rfl))
|
||||
(fun y => by aesop) (fun x => by aesop)
|
||||
(fun y hy => by aesop) (fun x hx => by aesop)
|
||||
|
||||
def interpSign : SignLattice → Value → Prop
|
||||
| .bot, _ => False
|
||||
|
||||
Reference in New Issue
Block a user