lean4-htt/tests
Sebastian Graf 7517f768f9
feat: lightweight dependent match motive for do match (#12673)
This PR allows for a leightweight version of dependent `match` in the
new `do` elaborator: discriminant types get abstracted over previous
discriminants. The match result type and the local context still are not
considered for abstraction. For example, if both `i : Nat` and `h : i <
len` are discrminants, then if an alternative matches `i` with `0`, we
also have `h : 0 < len`:

```lean
example {α : Type u} {β : Type v} {m : Type v → Type w} [Monad m] (as : Array α) (b : β) (f : (a : α) → a ∈ as → β → m (ForInStep β)) : m β :=
  let rec loop (i : Nat) (h : i ≤ as.size) (b : β) : m β := do
    match i, h with
    | 0,   _ => pure b
    | i+1, h =>
      have h' : i < as.size            := Nat.lt_of_lt_of_le (Nat.lt_succ_self i) h
      have : as.size - 1 < as.size     := Nat.sub_lt (Nat.zero_lt_of_lt h') (by decide)
      have : as.size - 1 - i < as.size := Nat.lt_of_le_of_lt (Nat.sub_le (as.size - 1) i) this
      match (← f as[as.size - 1 - i] (Array.getElem_mem this) b) with
      | ForInStep.done b  => pure b
      | ForInStep.yield b => loop i (Nat.le_of_lt h') b
  loop as.size (Nat.le_refl _) b
```

This feature turns out to be enough to save quite a few adaptations
(6/16) during bootstrep.
2026-02-24 14:29:29 +00:00
..
bench test: add benchmark vcgen_reader_state (#12671) 2026-02-24 13:19:15 +00:00
bench-radar chore: fail benchmarks if lakeprof upload fails (#12313) 2026-02-04 15:53:33 +00:00
compiler chore: remove orphaned *.expected.out files (#12357) 2026-02-06 17:05:43 +00:00
elabissues
ir
lake feat: lake: system-wide cache configuration (#12490) 2026-02-20 05:48:58 +00:00
lean feat: lightweight dependent match motive for do match (#12673) 2026-02-24 14:29:29 +00:00
pkg fix: mark failed compilations as noncomputable (#12625) 2026-02-23 09:18:21 +00:00
playground
plugin
simpperf
.gitignore
CMakeLists.txt chore: remove outdated trust0 test (#12401) 2026-02-10 13:07:10 +00:00
common.sh
lakefile.toml
lean-toolchain