I'm not used to using Program , so maybe the best solution, but this is what I came up with, deploying bla , seeing that it was internally defined using Fix_sub and looking at theorems about what SearchAbout Fix_sub .
Lemma obvious: forall n, bla n = n. Proof. intro n ; induction n. reflexivity. unfold bla ; rewrite fix_sub_eq ; simpl ; fold (bla n). rewrite IHn ; reflexivity. (* This can probably be automated using Ltac *) intros xfg Heq. destruct x. reflexivity. f_equal ; apply Heq. Qed.
In your real-life example, you probably want to introduce reduction lemmas so that you don't have to do the same job every time. For example:.
Lemma blaS_red : forall n, bla (S n) = S (bla n). Proof. intro n. unfold bla ; rewrite fix_sub_eq ; simpl ; fold (bla n). reflexivity. (* This can probably be automated using Ltac *) intros xfg Heq. destruct x. reflexivity. f_equal ; apply Heq. Qed.
So the next time you have bla (S _) , you can just rewrite blaS_red .
gallais
source share