This adds a number of lemmas for simplification of `Bool` and `Prop` terms. It pulls lemmas from Mathlib and adds additional lemmas where confluence or consistency suggested they are needed. It has been tested against Mathlib using some automated test infrastructure. That testing module is not yet included in this PR, but will be included as part of this. Note. There are currently some comments saying the origin of the simp rule. These will be removed prior to merging, but are added to clarify where the rule came from during review. --------- Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
24 lines
820 B
Text
24 lines
820 B
Text
/-
|
||
Copyright (c) 2024 Lean FRO. All rights reserved.
|
||
Released under Apache 2.0 license as described in the file LICENSE.
|
||
Authors: Joe Hendrix
|
||
-/
|
||
prelude
|
||
import Lean.Meta.Basic
|
||
|
||
namespace Lean.Meta.CheckTactic
|
||
|
||
def mkCheckGoalType (val type : Expr) : MetaM Expr := do
|
||
let lvl ← mkFreshLevelMVar
|
||
pure <| mkApp2 (mkConst ``CheckGoalType [lvl]) type val
|
||
|
||
def matchCheckGoalType (stx : Syntax) (goalType : Expr) : MetaM (Expr × Expr × Level) := do
|
||
let u ← mkFreshLevelMVar
|
||
let type ← mkFreshExprMVar (some (.sort u))
|
||
let val ← mkFreshExprMVar (some type)
|
||
let extType := mkAppN (.const ``CheckGoalType [u]) #[type, val]
|
||
if !(← isDefEq goalType extType) then
|
||
throwErrorAt stx "Goal{indentExpr goalType}\nis expected to match {indentExpr extType}"
|
||
pure (val, type, u)
|
||
|
||
end Lean.Meta.CheckTactic
|