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

39 lines
1 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.

namespace MWE
universe u v w
inductive Id {A : Type u} : A → A → Type u
| refl {a : A} : Id a a
attribute [induction_eliminator] Id.casesOn
infix:50 (priority := high) " = " => Id
inductive Unit : Type u
| star : Unit
attribute [induction_eliminator] Unit.casesOn
notation "𝟏" => Unit
notation "★" => Unit.star
notation "" => Nat
def vect (A : Type u) : → Type u
| Nat.zero => 𝟏
| Nat.succ n => A × vect A n
def vect.const {A : Type u} (a : A) : ∀ n, vect A n
| Nat.zero => ★
| Nat.succ n => (a, const a n)
def vect.map {A : Type u} {B : Type v} (f : A → B) :
∀ {n : }, vect A n → vect B n
| Nat.zero => λ _ => ★
| Nat.succ n => λ v => (f v.1, map f v.2)
def transport {A : Type u} (B : A → Type v) {a b : A} (p : a = b) : B a → B b :=
by { induction p; apply id }
def vect.subst {A B : Type u} (p : A = B) (f : B → A) {n : } (v : vect A n) :
vect.map f (transport (vect · n) p v) = vect.map (f ∘ transport id p) v :=
by { induction p; apply Id.refl }