Skip to content

Commit db0d45a

Browse files
committed
Add proof of concat of closed has rank at most one
1 parent c3cc4d2 commit db0d45a

1 file changed

Lines changed: 37 additions & 2 deletions

File tree

TraceTheory/TraceTheory/Language.lean

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def IsValidFactorization
372372
TraceEqv I x xs.flatten ∧
373373
TraceEqv I y ys.flatten ∧
374374
∀ i : ℕ, ∀ (h : i + 1 < xs.length),
375-
Independent I (xs[i]'(Nat.lt_of_succ_lt h)) ((ys.drop i).flatten)
375+
Independent I (xs[i + 1]'(h)) ((ys.take (i + 1)).flatten)
376376

377377
/-- Predicate for language `X` having rank at most `k`. -/
378378
def HasRankAtMost (I : Independence α) (X : Language α) (k : ℕ) : Prop :=
@@ -385,9 +385,44 @@ def HasRankAtMost (I : Independence α) (X : Language α) (k : ℕ) : Prop :=
385385
def HasFiniteRank (I : Independence α) (X : Language α) : Prop :=
386386
∃ k : ℕ, HasRankAtMost I X k
387387

388+
variable [DecidableEq α]
389+
388390
theorem concat_closed_rank (X₁ X₂ : Language α) (h₁ : IsClosed I X₁) (h₂ : IsClosed I X₂) :
389391
HasRankAtMost I (X₁ * X₂) 1 := by
390-
sorry
392+
intro x y hxy
393+
rcases hxy with ⟨w, hw, heqv⟩
394+
rcases hw with ⟨x₁, hx₁, x₂, hx₂, rfl⟩
395+
unfold IsClosed traceClosure at h₁ h₂
396+
rw [Language.ext_iff] at h₁ h₂
397+
simp only at heqv
398+
replace heqv := heqv.symm
399+
have ⟨z₁, z₂, z₃, z₄, h_indep, hx, hy, hx₁_eqv, hx₂_eqv⟩ := levi_lemma heqv
400+
use [z₁, z₂], [z₃, z₄]
401+
unfold IsValidFactorization
402+
and_intros
403+
· simp
404+
· simp
405+
· simp only [List.zipWith_cons_cons, List.zipWith_self, List.map_nil, List.flatten_cons,
406+
List.flatten_nil, List.append_nil]
407+
replace h₁ := h₁ (z₁ ++ z₃)
408+
replace h₂ := h₂ (z₂ ++ z₄)
409+
rw [Set.mem_setOf] at h₁ h₂
410+
use z₁ ++ z₃
411+
constructor
412+
· apply h₁.mp
413+
use x₁
414+
· use z₂ ++ z₄
415+
simp only [List.append_assoc, and_true]
416+
apply h₂.mp
417+
use x₂
418+
· simpa
419+
· simpa
420+
· intro i hlt
421+
cases i with
422+
| zero => simpa using h_indep
423+
| succ i' =>
424+
simp only [List.length_cons, List.length_nil, zero_add, Nat.reduceAdd] at hlt
425+
contradiction
391426

392427
end rank
393428

0 commit comments

Comments
 (0)