@@ -9,18 +9,17 @@ namespace TraceTheory
99variable {α : Type *} {I : Independence α}
1010
1111lemma indep_of_flatten {u : List α} {vs : List (List α)}
12- (i : Fin vs.length) (h : Independent I u vs.flatten) :
13- Independent I u vs[i] := by
14- rcases i with ⟨i, hi⟩
12+ (i : ℕ) (hi : i < vs.length) (h : Independent I u vs.flatten) :
13+ Independent I u (vs[i]'(hi)) := by
1514 induction vs generalizing i with
1615 | nil => contradiction
1716 | cons v vs' ih =>
1817 simp [-Independent] at h ⊢
1918 cases i with
2019 | zero => exact (indep_of_indep_append_right h).left
21- | succ i =>
22- simp at hi
23- exact ih (indep_of_indep_append_right h).right i hi
20+ | succ i' =>
21+ simp only [List.length_cons, add_lt_add_iff_right] at hi
22+ exact ih i' hi (indep_of_indep_append_right h).right
2423
2524/-- (i) → (ii) of Corollary (2.3) in `Partial Commutation and Traces`.
2625 Note that t₁, t₂, …, tₙ is expressed as a list [ ts ] , and (t₁ ++ t₂ ++ … ++ tₙ) via [ ts.flatten ] .
@@ -32,55 +31,48 @@ theorem levi_lemma_gen {u v : List α} {ts : List (List α)} [DecidableEq α]
3231 qs.length = ts.length ∧
3332 TraceEqv I u ps.flatten ∧
3433 TraceEqv I v qs.flatten ∧
35- (∀ i : Fin (min ts.length (min ps.length qs.length)), TraceEqv I ts[i] (ps[i] ++ qs[i])) ∧
36- ∀ i : Fin qs.length, ∀ j : Fin ps.length, i.val < j.val → Independent I qs[i] ps[j] := by
34+ (∀ i (ht : i < ts.length) (hp : i < ps.length) (hq : i < qs.length),
35+ TraceEqv I ts[i] (ps[i] ++ qs[i])) ∧
36+ (∀ i j (hi : i < qs.length) (hj : j < ps.length), i < j →
37+ Independent I qs[i] ps[j]) := by
3738 induction ts generalizing u v with
3839 | nil =>
39- rw [List.flatten_nil] at h
40- replace h := length_eq_of_eqv h
41- simp only [List.length_append, List.length_nil, Nat.add_eq_zero_iff,
42- List.length_eq_zero_iff] at h
43- rcases h with ⟨rfl, rfl⟩
40+ simp only [List.flatten_nil] at h
41+ have h_len := length_eq_of_eqv h
42+ simp only [List.length_append, List.length_nil] at h_len
43+ have hu : u = [] := List.length_eq_zero_iff.mp (by omega)
44+ have hv : v = [] := List.length_eq_zero_iff.mp (by omega)
45+ subst hu hv
4446 use [], []
45- simp only [List.length_nil, List.flatten_nil, Fin.getElem_fin, Independent, IsEmpty.forall_iff,
46- and_true, true_and, TraceEqv.refl]
47- intro ⟨i, hi⟩
48- contradiction
47+ simp [TraceEqv.refl]
4948 | cons t tsuf ih =>
5049 rcases levi_lemma h with ⟨p, psuf, q, qsuf, h_ind, h_up, h_vq, h_tpq, h_tpq_suf⟩
5150 rcases ih h_tpq_suf.symm with ⟨ps_i, qs_i, ih_p_len, ih_q_len, ih_p, ih_q, ih_tpq, ih_ind⟩
5251 use p :: ps_i, q :: qs_i
5352 and_intros
54- · simpa
55- · simpa
53+ · simp [ih_p_len]
54+ · simp [ih_q_len]
5655 · apply TraceEqv.trans h_up
5756 simp only [List.flatten_cons]
5857 exact TraceEqv.compat (TraceEqv.refl p) ih_p
5958 · apply TraceEqv.trans h_vq
6059 simp only [List.flatten_cons]
6160 exact TraceEqv.compat (TraceEqv.refl q) ih_q
62- · intro ⟨i, hi⟩
63- by_cases hzi : i = 0
64- · simp [hzi, h_tpq]
65- · cases i with
66- | zero => contradiction
67- | succ i =>
68- simp only [List.length_cons, Nat.add_min_add_right, Nat.add_lt_add_iff_right, lt_inf_iff,
69- Fin.getElem_fin, List.getElem_cons_succ] at hi ⊢
70- exact ih_tpq ⟨i, by simpa⟩
71- · intro ⟨i, hi⟩ ⟨j, hj⟩ hij
61+ · intro i ht hp hq
62+ cases i with
63+ | zero => exact h_tpq
64+ | succ i' => apply ih_tpq i'
65+ · intro i j hi hj hij
7266 cases j with
7367 | zero => contradiction
74- | succ j =>
68+ | succ j' =>
7569 cases i with
7670 | zero =>
77- simp only [List.length_cons, Nat.add_lt_add_iff_right, Independent, Fin.zero_eta,
78- Fin.getElem_fin, Fin.val_zero, List.getElem_cons_zero, List.getElem_cons_succ] at hj ⊢
79- exact indep_of_flatten ⟨j, hj⟩ (indep_of_indep_of_eqv (independent_symm h_ind) ih_p)
80- | succ i =>
81- simp only [List.length_cons, Nat.add_lt_add_iff_right, Independent, Fin.getElem_fin,
82- List.getElem_cons_succ] at hi hj hij ⊢
83- exact ih_ind ⟨i, hi⟩ ⟨j, hj⟩ hij
71+ simp only [List.length_cons, add_lt_add_iff_right] at hj
72+ exact indep_of_flatten j' hj (indep_of_indep_of_eqv (independent_symm h_ind) ih_p)
73+ | succ i' =>
74+ apply ih_ind i' j'
75+ exact Nat.succ_lt_succ_iff.mp hij
8476
8577variable {M : Type } {σ : Type } [Monoid M] [Monoid α]
8678
0 commit comments