Omnitigs and safe walks in genome assembly
StructureDirected multigraph#✓fully proved
A directed multigraph given by the source and target of each edge.
structure Multigraph (V : Type*) (E : Type*) where
/-- The source (tail) of an edge. -/
src : E → V
/-- The target (head) of an edge. -/
tgt : E → V
DefinitionWalk in a directed multigraph#✓fully proved
A list of edges is a walk when consecutive edges are incident (head to tail).
def IsWalk (w : List E) : Prop := w.IsChain (fun e f => G.tgt e = G.src f)
Uses 1 · Used by 5
DefinitionPath in a directed multigraph#✓fully proved
A path: a nonempty walk whose nodes src e₀, tgt e₀, …, tgt e_ℓ are distinct, except that
the first and last node may coincide.
def IsPath (p : List E) : Prop :=
p ≠ [] ∧ IsWalk G p ∧ (p.map G.tgt).Nodup ∧
∀ e₀ ∈ p.head?, G.src e₀ ∉ (p.map G.tgt).dropLast
def IsWalk (w : List E) : Prop := w.IsChain (fun e f => G.tgt e = G.src f)
CSLibExt/Bioinformatics/Assembly/Omnitig.lean:79
Uses 2 · Used by 3
DefinitionCircular edge-covering walk#✓fully proved
A circular edge-covering walk: a nonempty closed walk through every edge.
def IsCircularCovering (A : List E) : Prop :=
A ≠ [] ∧ IsWalk G A ∧ (∀ a ∈ A.getLast?, ∀ b ∈ A.head?, G.tgt a = G.src b) ∧ ∀ e, e ∈ A
def IsWalk (w : List E) : Prop := w.IsChain (fun e f => G.tgt e = G.src f)
CSLibExt/Bioinformatics/Assembly/Omnitig.lean:79
Uses 2 · Used by 3
DefinitionSubwalk of a circular walk#✓fully proved
w is a subwalk of the circular walk A: it is read off A from some start position,
wrapping around (possibly several times).
def IsCircularSubwalk (w A : List E) : Prop :=
∃ p : ℕ, ∀ (i : ℕ) (hi : i < w.length), A[(p + i) % A.length]? = some w[i]
Used by 3
DefinitionSafe walk in a multigraph#✓fully proved
Safe walk: a subwalk of every circular edge-covering walk.
def IsSafe (w : List E) : Prop :=
∀ A, IsCircularCovering G A → IsCircularSubwalk w A
def IsCircularCovering (A : List E) : Prop :=
A ≠ [] ∧ IsWalk G A ∧ (∀ a ∈ A.getLast?, ∀ b ∈ A.head?, G.tgt a = G.src b) ∧ ∀ e, e ∈ A
CSLibExt/Bioinformatics/Assembly/Omnitig.lean:88
def IsCircularSubwalk (w A : List E) : Prop :=
∃ p : ℕ, ∀ (i : ℕ) (hi : i < w.length), A[(p + i) % A.length]? = some w[i]
CSLibExt/Bioinformatics/Assembly/Omnitig.lean:93
Uses 3 · Used by 2
DefinitionOmnitig#✓fully proved
Omnitig (Tomescu–Medvedev, Definition 5): for all 1 ≤ i ≤ j ≤ t (t + 1 = w.length),
no path from v_j = src e_j to v_i = src e_i has first edge ≠ e_j and last edge
≠ e_{i-1}.
def IsOmnitig (w : List E) : Prop :=
w ≠ [] ∧ IsWalk G w ∧
∀ (i j : ℕ) (hi : 1 ≤ i) (hij : i ≤ j) (hj : j < w.length) (p : List E), IsPath G p →
∀ f ∈ p.head?, ∀ l ∈ p.getLast?,
G.src f = G.src w[j] → G.tgt l = G.src w[i] → f ≠ w[j] → l ≠ w[i - 1] → False
def IsWalk (w : List E) : Prop := w.IsChain (fun e f => G.tgt e = G.src f)
CSLibExt/Bioinformatics/Assembly/Omnitig.lean:79
def IsPath (p : List E) : Prop :=
p ≠ [] ∧ IsWalk G p ∧ (p.map G.tgt).Nodup ∧
∀ e₀ ∈ p.head?, G.src e₀ ∉ (p.map G.tgt).dropLast
CSLibExt/Bioinformatics/Assembly/Omnitig.lean:83
Uses 3 · Used by 2
TheoremOmnitigs are safe walks#✓fully proved
Omnitigs are safe (Theorem 1, (2) ⇒ (1)).
theorem IsOmnitig.isSafe {w : List E} (hw : IsOmnitig G w) : IsSafe G w
def IsOmnitig (w : List E) : Prop :=
w ≠ [] ∧ IsWalk G w ∧
∀ (i j : ℕ) (hi : 1 ≤ i) (hij : i ≤ j) (hj : j < w.length) (p : List E), IsPath G p →
∀ f ∈ p.head?, ∀ l ∈ p.getLast?,
G.src f = G.src w[j] → G.tgt l = G.src w[i] → f ≠ w[j] → l ≠ w[i - 1] → False
CSLibExt/Bioinformatics/Assembly/Omnitig.lean:103
def IsSafe (w : List E) : Prop :=
∀ A, IsCircularCovering G A → IsCircularSubwalk w A
CSLibExt/Bioinformatics/Assembly/Omnitig.lean:97
Uses 7
TheoremSafe walks are omnitigs#✓fully proved
Safe walks are omnitigs (Theorem 1, (1) ⇒ (2)), when a circular edge-covering walk exists (otherwise every walk is vacuously safe).
theorem isOmnitig_of_isSafe {w : List E} (hne : w ≠ []) (hwalk : IsWalk G w)
(hA : ∃ A, IsCircularCovering G A) (hs : IsSafe G w) : IsOmnitig G w
def IsWalk (w : List E) : Prop := w.IsChain (fun e f => G.tgt e = G.src f)
CSLibExt/Bioinformatics/Assembly/Omnitig.lean:79
def IsCircularCovering (A : List E) : Prop :=
A ≠ [] ∧ IsWalk G A ∧ (∀ a ∈ A.getLast?, ∀ b ∈ A.head?, G.tgt a = G.src b) ∧ ∀ e, e ∈ A
CSLibExt/Bioinformatics/Assembly/Omnitig.lean:88
def IsSafe (w : List E) : Prop :=
∀ A, IsCircularCovering G A → IsCircularSubwalk w A
CSLibExt/Bioinformatics/Assembly/Omnitig.lean:97
def IsOmnitig (w : List E) : Prop :=
w ≠ [] ∧ IsWalk G w ∧
∀ (i j : ℕ) (hi : 1 ≤ i) (hij : i ≤ j) (hj : j < w.length) (p : List E), IsPath G p →
∀ f ∈ p.head?, ∀ l ∈ p.getLast?,
G.src f = G.src w[j] → G.tgt l = G.src w[i] → f ≠ w[j] → l ≠ w[i - 1] → False
CSLibExt/Bioinformatics/Assembly/Omnitig.lean:103
Uses 7
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.