2 theory Recur imports Main begin
4 ML "Pretty.margin_default := 64"
8 @{thm[display] mono_def[no_vars]}
11 @{thm[display] monoI[no_vars]}
14 @{thm[display] monoD[no_vars]}
17 @{thm[display] lfp_unfold[no_vars]}
20 @{thm[display] lfp_induct[no_vars]}
23 @{thm[display] gfp_unfold[no_vars]}
26 @{thm[display] coinduct[no_vars]}
32 \bfindex{wellfounded} if it has no infinite descending chain $\cdots <
33 a@2 < a@1 < a@0$. Clearly, a function definition is total iff the set
34 of all pairs $(r,l)$, where $l$ is the argument on the left-hand side
35 of an equation and $r$ the argument of some recursive call on the
36 corresponding right-hand side, induces a wellfounded relation.
38 The HOL library formalizes
39 some of the theory of wellfounded relations. For example
40 @{prop"wf r"}\index{*wf|bold} means that relation @{term[show_types]"r::('a*'a)set"} is
42 Finally we should mention that HOL already provides the mother of all
43 inductions, \textbf{wellfounded
44 induction}\indexbold{induction!wellfounded}\index{wellfounded
45 induction|see{induction, wellfounded}} (@{thm[source]wf_induct}):
46 @{thm[display]wf_induct[no_vars]}
47 where @{term"wf r"} means that the relation @{term r} is wellfounded
53 @{thm[display] wf_induct[no_vars]}
56 @{thm[display] less_than_iff[no_vars]}
57 \rulename{less_than_iff}
59 @{thm[display] inv_image_def[no_vars]}
60 \rulename{inv_image_def}
62 @{thm[display] measure_def[no_vars]}
63 \rulename{measure_def}
65 @{thm[display] wf_less_than[no_vars]}
66 \rulename{wf_less_than}
68 @{thm[display] wf_inv_image[no_vars]}
69 \rulename{wf_inv_image}
71 @{thm[display] wf_measure[no_vars]}
74 @{thm[display] lex_prod_def[no_vars]}
75 \rulename{lex_prod_def}
77 @{thm[display] wf_lex_prod[no_vars]}
78 \rulename{wf_lex_prod}