lean4-htt/tests/lean/run/inductiveIndicesIssue.lean
Leonardo de Moura 7b84b4cdaa fix: improve inductive indices elaboration
TODO: convert fixed indices to parameters. Motivation: types such as
```lean
inductive Foo : List α → Type
  | mk : Foo []
```
Users should not need to write
```lean
inductive Foo {α} : List α → Type
  | mk : Foo []
```
2022-03-08 17:48:46 -08:00

22 lines
795 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.

import Lean
inductive sublist : List α → List α → Prop
| slnil : sublist [] []
| cons l₁ l₂ a : sublist l₁ l₂ → sublist l₁ (a :: l₂)
| cons2 l₁ l₂ a : sublist l₁ l₂ → sublist (a :: l₁) (a :: l₂)
namespace Lean.PrefixTreeNode
namespace Ex1
inductive WellFormed (cmp : αα → Ordering) : PrefixTreeNode α β → Prop where
| emptyWff : WellFormed cmp empty
| insertWff {t : PrefixTreeNode α β} {k : List α} {val : β} : WellFormed cmp t → WellFormed cmp (insert t cmp k val)
end Ex1
namespace Ex2
inductive WellFormed (cmp : αα → Ordering) : PrefixTreeNode α β → Prop where
| emptyWff : WellFormed cmp empty
| insertWff : WellFormed cmp t → WellFormed cmp (insert t cmp k val)
end Ex2
end Lean.PrefixTreeNode