lean4-htt/tests/lean/run/1228.lean
2022-06-17 17:37:33 -07:00

46 lines
1,018 B
Text

inductive Foo (n : Nat) : Type
| foo (t: Foo n): Foo n
namespace Foo
inductive Bar: Foo n → Prop
theorem ex₁ {s: Foo n} (H: s.Bar): True := by
cases h₁ : s
case foo s' =>
cases h₂ : n; sorry
have: Bar s' := sorry
exact ex₁ this
termination_by _ => sizeOf s
theorem ex₂
{s: Foo n}
(H: s.Bar):
True := by
generalize hs': s = s'
match s' with
| foo s' =>
have: Bar s' := sorry
have hterm: sizeOf s' < sizeOf s := by simp_all_arith
exact ex₂ this
termination_by _ => sizeOf s
theorem ex₃ {s: Foo n} (H: s.Bar): True := by
cases h₁ : s
case foo s' =>
match n with
| 0 => sorry
| _ =>
have: Bar s' := sorry
exact ex₃ this
termination_by _ => sizeOf s
-- it works
theorem ex₄ {s: Foo n} (H: s.Bar): True := by
match s with
| foo s' =>
match n with
| 0 => sorry
| _ =>
have: Bar s' := sorry
exact ex₄ this
termination_by _ => sizeOf s