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