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

31 lines
1.1 KiB
Text
Raw Permalink 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.

opaque ID : Type
-- A `Reactor` contains "things" identified by an `ID`. It also contains other `Reactor`s, thereby giving us a tree structure of reactors.
inductive Reactor
| mk
(things : ID → Option Nat)
(nested : ID → Option Reactor)
-- Structure projections.
def Reactor.things : Reactor → ID → Option Nat | mk t _ => t
def Reactor.nested : Reactor → ID → Option Reactor | mk _ n => n
inductive Lineage : Reactor → ID → Type
| thing {rtr i} : (∃ t, rtr.things i = some t) → Lineage rtr i
| nested {rtr' i' rtr i} : (Lineage rtr' i) → (rtr.nested i' = some rtr') → Lineage rtr i
def Lineage.container' {rtr i} : Lineage rtr i → (Option ID × Reactor)
| .nested (.nested l h) _ => (Lineage.nested l h).container'
| @nested rtr' i' .. => (i', rtr')
| _ => (none, rtr)
attribute [simp] Lineage.container'
#check @Lineage.container'.eq_1
#check @Lineage.container'.eq_2
#check @Lineage.container'.eq_3
@[simp] def Lineage.container : Lineage rtr i → (Option ID × Reactor)
| nested l@h:(nested ..) _ => l.container
| @nested rtr' i' .. => (i', rtr')
| _ => (none, rtr)