From e59c5563b6a16a87b4d44f563ce6dbc51798e2f6 Mon Sep 17 00:00:00 2001 From: lengyijun Date: Tue, 21 Jul 2026 12:35:43 +0800 Subject: [PATCH] feat: Add lemma SN.to_WN: SN implies Normalizable `SN.to_WN (hx : SN r x) : Normalizable r x` Proves that strong normalization implies weak normalization by induction on the SN structure, constructing the normal form via the single reduction step when a successor exists. --- Cslib/Foundations/Relation/Confluence.lean | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Cslib/Foundations/Relation/Confluence.lean b/Cslib/Foundations/Relation/Confluence.lean index cd23f5684..753fab828 100644 --- a/Cslib/Foundations/Relation/Confluence.lean +++ b/Cslib/Foundations/Relation/Confluence.lean @@ -187,6 +187,14 @@ lemma SN.onFun_of_image {r : β → β → Prop} {f : α → β} (hx : SN r (f x lemma SN.of_normal (hx : Normal r x) : SN r x := SN.intro fun y hy => (hx ⟨y, hy⟩).elim +lemma SN.to_WN (hx : SN r x) : Normalizable r x := by + induction hx with | intro x h ih => + by_cases hy: (∃ y, r x y) + · obtain ⟨y, hy⟩ := hy + obtain ⟨z, hz, hnormal⟩ := ih y hy + exact ⟨z, .trans (.single hy) hz, hnormal⟩ + · exists x + lemma Terminating.apply (hr : Terminating r) (x : α) : SN r x := WellFounded.apply hr x lemma Terminating.iff_forall_sn : Terminating r ↔ ∀ x, SN r x :=