Add termination

This commit is contained in:
Yiyun Liu 2025-03-05 00:18:28 -05:00
parent c4f01d7dfc
commit b29d567ef0

14
theories/termination.v Normal file
View file

@ -0,0 +1,14 @@
Require Import common Autosubst2.core Autosubst2.unscoped Autosubst2.syntax algorithmic fp_red executable.
From Hammer Require Import Tactics.
Require Import ssreflect ssrbool.
From stdpp Require Import relations (nsteps (..)).
Definition term_metric k (a b : PTm) :=
exists i j va vb, nsteps LoRed.R i a va /\ nsteps LoRed.R j b vb /\ nf va /\ nf vb /\ size_PTm va + size_PTm vb + i + j <= k.
Lemma term_metric_algo_dom : forall k a b, term_metric k a b -> algo_dom_r a b.
Proof.
elim /Wf_nat.lt_wf_ind.
move => n ih a b h.
case : (fancy_hred a); cycle 1.
move => [a' ha']. apply : A_HRedL; eauto.