Skip to content

Instantly share code, notes, and snippets.

@Ruben-VandeVelde
Created October 18, 2020 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ruben-VandeVelde/ef797b8fb8d8f9bf51dd5218c118ccee to your computer and use it in GitHub Desktop.
Save Ruben-VandeVelde/ef797b8fb8d8f9bf51dd5218c118ccee to your computer and use it in GitHub Desktop.
lemma pnat.strong_induction_on {p : pnat → Prop} (n : pnat) (h : ∀ k, (∀ m, m < k → p m) → p k) : p n :=
begin
let p' : nat → Prop := λ n, if h : 0 < n then p ⟨n, h⟩ else true,
have : ∀ n', p' n',
{
intro n',
refine nat.strong_induction_on n' _,
intro k,
dsimp [p'],
split_ifs,
{
intros a,
apply h,
intros m hm,
have := a m.1 hm,
split_ifs at this,
{
convert this,
simp only [subtype.coe_eta, subtype.val_eq_coe],
},
{exfalso,
exact h_2 m.2}},
{intros, trivial}
},
have a := this n.1,
dsimp [p'] at a,
split_ifs at a,
{ convert a, simp only [subtype.coe_eta], },
{ exfalso, exact h_1 n.pos },
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment