lean4-htt/tests/elab/fixedParamsAnnot.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

75 lines
1.9 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.

/-!
This test contains functions with fixed parameter that have dependencies on varying parameter,
but only in annotations (optional parameters).
-/
private axiom test_sorry : ∀ {α}, α
namespace Ex1
mutual
def foo (varying : Nat) (fixed := varying) : Nat := bar fixed (varying + fixed)
decreasing_by exact test_sorry
def bar (fixed : Nat) (varying : Nat) : Nat := foo (varying + fixed) fixed
decreasing_by exact test_sorry
end
/--
info: equations:
theorem Ex1.foo.eq_1 : ∀ (varying fixed : Nat), foo varying fixed = bar fixed (varying + fixed)
-/
#guard_msgs in
#print equations foo
/--
info: equations:
theorem Ex1.bar.eq_1 : ∀ (fixed varying : Nat), bar fixed varying = foo (varying + fixed) fixed
-/
#guard_msgs in
#print equations bar
/--
info: Ex1.foo.induct (fixed : Nat) (motive1 motive2 : Nat → Prop)
(case1 : ∀ (varying : Nat), motive2 (varying + fixed) → motive1 varying)
(case2 : ∀ (varying : Nat), motive1 (varying + fixed) → motive2 varying) (varying : Nat) : motive1 varying
-/
#guard_msgs in
#check foo.induct
end Ex1
namespace Ex2
mutual
def bar (fixed : Nat) (varying : Nat) : Nat := foo (varying + fixed) fixed
decreasing_by exact test_sorry
def foo (varying : Nat) (fixed := varying) : Nat := bar fixed (varying + fixed)
decreasing_by exact test_sorry
end
/--
info: equations:
theorem Ex2.foo.eq_1 : ∀ (varying fixed : Nat), foo varying fixed = bar fixed (varying + fixed)
-/
#guard_msgs in
#print equations foo
/--
info: equations:
theorem Ex2.bar.eq_1 : ∀ (fixed varying : Nat), bar fixed varying = foo (varying + fixed) fixed
-/
#guard_msgs in
#print equations bar
/--
info: Ex2.foo.induct (fixed : Nat) (motive1 motive2 : Nat → Prop)
(case1 : ∀ (varying : Nat), motive2 (varying + fixed) → motive1 varying)
(case2 : ∀ (varying : Nat), motive1 (varying + fixed) → motive2 varying) (varying : Nat) : motive2 varying
-/
#guard_msgs in
#check foo.induct
end Ex2