lean4-htt/tests/elab/issue7322.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

60 lines
1.5 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- set_option trace.Elab.definition.fixedParams true in
-- set_option debug.skipKernelTC true
-- set_option debug.definition.wf.replaceRecApps true
-- set_option trace.Elab.definition.wf true
set_option pp.proofs true
/-!
This test case show a tricky issue, originally shown in
`Std.Tactic.BVDecide.BVExpr.bitblast.blastShiftLeftConst.go_denote_eq`
where type of `fix`s induction hypothese change when being refined
in a way that makes the resulting proof term type incorrect.
-/
/-- warning: declaration uses `sorry` -/
#guard_msgs in
theorem demo (distance : Nat) (idx : Nat) (a : Fin distance) (fuel : Nat) :
a = if hidx : idx < distance then Fin.mk idx hidx else a := by
cases fuel
· sorry
next fuel =>
split
· rw [demo distance idx a fuel]
sorry
· rfl
termination_by fuel
decreasing_by sorry
structure Ev (p : Prop) : Type where
isTrue : p
/--
warning: declaration uses `sorry`
---
warning: declaration uses `sorry`
---
warning: declaration uses `sorry`
---
warning: declaration uses `sorry`
-/
#guard_msgs in
def bar (distance : Nat) (idx : Nat) (a : Fin distance) (fuel : Nat) :
Ev (a = if hidx : idx < distance then Fin.mk idx hidx else a) := by
cases fuel
· sorry
next fuel =>
split
· rw [(bar distance idx a fuel).isTrue]
sorry
· apply Ev.mk
rfl
termination_by fuel
decreasing_by sorry
/--
info: bar.induct (motive : Nat → Prop) (case1 : ∀ (x : Nat), (∀ (n : Nat), motive n) → motive x) (fuel : Nat) : motive fuel
---
warning: declaration uses `sorry`
-/
#guard_msgs in
#check bar.induct