Skip to content

Commit e5ce130

Browse files
committed
Update lexNf_of_factorCondition to not require classical logic
1 parent 04ac399 commit e5ce130

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

TraceTheory/TraceTheory/Language.lean

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,22 @@ lemma lexNf_of_factorCondition
117117
(I : Independence α) (x : List α) (h : SatisfiesFactorCondition I x) :
118118
IsLexNf I x := by
119119
unfold IsLexNf
120-
by_contra! h_not_nf
121-
have ⟨w, h_equiv, hlt⟩ := h_not_nf
120+
contrapose! h
121+
have ⟨w, h_equiv, hlt⟩ := h
122122
have ⟨p, a, b, w', x', hw, hx, hlt'⟩ :=
123123
exists_decomp_of_lt_of_len_eq hlt (length_eq_of_equiv h_equiv).symm
124124
rw [hw, hx, List.append_assoc, List.append_assoc] at h_equiv
125125
replace h_equiv := (equiv_cancel_left h_equiv).symm
126126
have ⟨h_indep, u, v, hx', hu⟩ := indep_and_decomp_of_equiv_of_head_ne I h_equiv (ne_of_lt hlt')
127-
unfold SatisfiesFactorCondition at h
127+
unfold SatisfiesFactorCondition
128+
push_neg
128129
simp only [hx', ← List.append_assoc] at hx
129-
have ⟨c, hc_mem, hc_indep⟩ := h p u v a b hx h_indep hlt'
130+
use p, u, v, a, b
131+
apply And.intro hx
132+
apply And.intro h_indep
133+
apply And.intro hlt'
130134
simp at hu
131-
exact hc_indep (hu c hc_mem)
135+
exact hu
132136

133137
/-- The characterization of strings in Lexicographic Normal Form. -/
134138
theorem isLexNf_iff_factorCondition (I : Independence α) (x : List α) :
@@ -137,4 +141,6 @@ theorem isLexNf_iff_factorCondition (I : Independence α) (x : List α) :
137141
· apply factorCondition_of_lexNf
138142
· apply lexNf_of_factorCondition
139143

144+
-- TODO proof that both NF are regular
145+
140146
#lint

0 commit comments

Comments
 (0)