lean4-htt/tests/lean/run/def15.lean
Joachim Breitner 42e8011320 feat: make noConfusion even more heterogeneous
This PR makes the noConfusion principles even more heterogeneous, by
allowing not just indices but also parameters to be differ.

This is a breaking change for manual use of `noConfusion` for types with
parameters. Pass suitable `rfl` arguments, and use `eq_of_heq` on the
resulting equalities as needed.

This fixes #11560.
2025-12-10 17:28:06 +01:00

11 lines
313 B
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.

def head {α} : (as : List α) → as ≠ [] → α
| [], h => absurd rfl h
| a::as, _ => a
theorem head_cons {α} (a : α) (as : List α) : head (a::as) (fun h => List.noConfusion rfl (heq_of_eq h)) = a :=
rfl
theorem head_cons' {α} (a : α) (as : List α) (h : a::as ≠ []) : head (a::as) h = a :=
rfl