Skip to content

Commit

Permalink
Avoid termination_by', use termination_by (#42)
Browse files Browse the repository at this point in the history
I plan to remove support for `termination_by'
(leanprover/lean4#3033), and investigated uses
in the wild. Your case case be replaced with `termination_by` rather
easily.
  • Loading branch information
nomeata authored Dec 8, 2023
1 parent 1fffd82 commit 5ec035f
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions ConNF/Foa/Complete/HypAction.lean
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,8 @@ namespace HypAction

variable {β : Iic α}

def fixMap :
PSum (Σ' _ : ExtendedIndex β, Atom) (Σ' _ : ExtendedIndex β, NearLitter) → SupportCondition β
| PSum.inl ⟨A, a⟩ => ⟨A, inl a⟩
| PSum.inr ⟨A, N⟩ => ⟨A, inr N⟩

def fixWf :
WellFoundedRelation
(PSum (Σ' _ : ExtendedIndex β, Atom) (Σ' _ : ExtendedIndex β, NearLitter)) :=
⟨InvImage (Relation.TransGen (Constrains α β)) fixMap,
InvImage.wf _ (WellFounded.transGen <| constrains_wf α β)⟩
instance : WellFoundedRelation (SupportCondition β) :=
⟨_, WellFounded.transGen <| constrains_wf α β⟩

mutual
/-- Construct the fixed-point functions `fix_atom` and `fix_near_litter`.
Expand All @@ -49,7 +41,9 @@ mutual
ExtendedIndex β → NearLitter → NearLitter
| A, N => FN A N ⟨fun B b _ => fixAtom Fa FN B b, fun B N _ => fixNearLitter Fa FN B N⟩
end
termination_by' fixWf
termination_by
fixAtom A n => SupportCondition.mk A (inl n)
fixNearLitter A N => SupportCondition.mk A (inr N)

theorem fixAtom_eq (Fa FN) (A : ExtendedIndex β) (a : Atom) :
fixAtom Fa FN A a =
Expand Down

0 comments on commit 5ec035f

Please sign in to comment.