Documentation

Jxm.HydrophobicPolarModel

Hydrophobic-polar protein folding model: main theoretical development #

A treatment of the hydrophobic-polar protein folding model in a generality that covers rectangular, triangular and hexagonal lattices: P_rect, P_tri, P_hex.

We formalize the non-monotonicity of the objective function, refuting an unpublished conjecture of Stecher.

We prove objective function bounds: P_tri ≤ P_rect ≤ P_hex (using a theory of embeddings) and for any model, P ≤ b * l and P ≤ l * (l-1)/2 [see pts_earned_bound_loc']

(The latter is worth keeping when l ≤ 2b+1.)

where b is the number of moves and l is the word length. We also prove P ≤ b * l / 2 using "handshake lemma" type reasoning that was pointed out in Agarwala, Batzoglou et al. (RECOMB 97, Lemma 2.1) and a symmetry assumption on the folding model that holds for rect and hex but not for tri. The latter result required improving our definitions.

We prove the correctness of our backtracking algorithm for protein folding.

To prove some results about rotations (we can always assume our fold starts by going to the right) we use the type Fin n → α instead of Vector α n

def morphSep {α : Type} [Zero α] {b₀ : } {b₁ : } (f : Fin b₀αFin b₁) (go₀ : Fin b₀αα) (l : List (Fin b₀)) :
List (Fin b₁)

Extend a map on moves to lists. Trying a new def. Sep 13, 2024.

Equations
Instances For
    theorem morphSep_len {α : Type} [Zero α] {b₀ : } {b₁ : } (f : Fin b₀αFin b₁) (go₀ : Fin b₀αα) (l : List (Fin b₀)) :
    (morphSep f go₀ l).length = l.length

    morph is length-preserving. New proof Sep 13, 2024 using rw [← itself].

    def morphSepᵥ {l : } {α : Type} [Zero α] {b₀ : } {b₁ : } (f : Fin b₀αFin b₁) (go₀ : Fin b₀αα) (v : Mathlib.Vector (Fin b₀) l) :

    .

    Equations
    Instances For
      theorem morphSep_nil {α : Type} [Zero α] {b₀ : } {b₁ : } (f : Fin b₀αFin b₁) (go₀ : Fin b₀αα) :
      morphSep f go₀ [] = []

      .

      def morph {α : Type} [Zero α] {b₀ : } {b₁ : } (f : Fin b₀αFin b₁) (go₀ : Fin b₀αα) (l : List (Fin b₀)) :
      List (Fin b₁)

      Extend a map on moves to lists.

      Equations
      Instances For
        theorem morph_len {α : Type} [Zero α] {b₀ : } {b₁ : } (f : Fin b₀αFin b₁) (go₀ : Fin b₀αα) (l : List (Fin b₀)) :
        (morph f go₀ l).length = l.length

        morph is length-preserving

        def morphᵥ {l : } {α : Type} [Zero α] {b₀ : } {b₁ : } (f : Fin b₀αFin b₁) (go₀ : Fin b₀αα) (v : Mathlib.Vector (Fin b₀) l) :

        .

        Equations
        Instances For
          def morf {l : } {b₀ : } {b₁ : } (f : Fin b₀Fin b₁) (v : Mathlib.Vector (Fin b₀) l) :

          .

          Equations
          Instances For
            def morfF {l : } {b₀ : } {b₁ : } (f : Fin b₀Fin b₁) (v : Fin lFin b₀) :
            Fin lFin b₁

            Here, "f" means: f doesn't depend on space. "F" means: use Fin not Vector 3/10/24. Hopefully simple enough to prove a lot about it.

            Equations
            Instances For
              def morf_list {b₀ : } {b₁ : } (f : Fin b₀Fin b₁) (v : List (Fin b₀)) :
              List (Fin b₁)

              .

              Equations
              Instances For
                theorem morf_len {b₀ : } {b₁ : } (f : Fin b₀Fin b₁) (l : List (Fin b₀)) :
                (morf_list f l).length = l.length

                finished March 8, 2024

                @[reducible, inline]
                abbrev σ {l : } {α : Type} [Zero α] {b₀ : } {b₁ : } (f : Fin b₀αFin b₁) (go₀ : Fin b₀αα) (v : Mathlib.Vector (Fin b₀) l) :

                .

                Equations
                Instances For
                  theorem nearby_of_embeds {α : Type} [DecidableEq α] {b₀ : } {b₁ : } {go₀ : Fin b₀αα} {go₁ : Fin b₁αα} (h_embed : embeds_in go₀ go₁) {x : α} {y : α} (hn : nearby go₀ x y = true) :
                  nearby go₁ x y = true

                  .

                  theorem pt_loc_of_embeds {α : Type} [DecidableEq α] {b₀ : } {b₁ : } {go₀ : Fin b₀αα} {go₁ : Fin b₁αα} (h_embed : embeds_in go₀ go₁) {l : } (fold : Mathlib.Vector α l) (a : Fin l) (b : Fin l) (phobic : Mathlib.Vector Bool l) (htri : pt_loc go₀ fold a b phobic = true) :
                  pt_loc go₁ fold a b phobic = true

                  .

                  theorem pts_at_of_embeds' {α : Type} [DecidableEq α] {b₀ : } {b₁ : } {go₀ : Fin b₀αα} {go₁ : Fin b₁αα} (h_embed : embeds_in go₀ go₁) {l : } (k : Fin l) (ph : Mathlib.Vector Bool l) (fold : Mathlib.Vector α l) :
                  pts_at' go₀ k ph fold pts_at' go₁ k ph fold

                  .

                  def pts_tot' {α : Type} {β : Type} [Fintype β] (go : βαα) [DecidableEq α] {l : } (ph : Mathlib.Vector Bool l) (fold : Mathlib.Vector α l) :

                  .

                  Equations
                  Instances For
                    def points_tot {α : Type} {β : Type} [DecidableEq α] [Fintype β] (go : βαα) {l : } (ph : Mathlib.Vector Bool l) (fold : Mathlib.Vector α l) :

                    This is needed to get the Handshake Lemma bound from Agarwal et al.'s paper, but it is also just a nicer definition. March 13, 2024. think "ik = (i,k)"

                    Equations
                    Instances For
                      def SuccGraph {l : } :
                      SimpleGraph (Fin l.succ)

                      In order to use the handshaking lemma from https://leanprover-community.github.io/mathlib4_docs/Mathlib/Combinatorics/SimpleGraph/DegreeSum.html#SimpleGraph.sum_degrees_eq_twice_card_edges Bonds: https://leanprover-community.github.io/mathlib4_docs/Mathlib/Combinatorics/SimpleGraph/Dart.html#SimpleGraph.Dart we may introduce this: note that we form a graph on the amino acids rather than on the ambient space.

                      Equations
                      • SuccGraph = { Adj := fun (i j : Fin l.succ) => i = (↑j).succ j = (↑i).succ, symm := , loopless := }
                      Instances For
                        def ProteinGraph₀ {α : Type} {β : Type} [Fintype β] (go : βαα) [DecidableEq α] {l : } (ph : Mathlib.Vector Bool l.succ) (fold : Mathlib.Vector α l.succ) :
                        SimpleGraph (Fin l.succ)

                        .

                        Equations
                        Instances For
                          def slicer {l : } (P : Fin lFin lBool) :
                          Fin lFinset (Fin l × Fin l)

                          .

                          Equations
                          Instances For
                            theorem slicer_disjointness {l : } (P : Fin lFin lBool) (k₁ : Fin l) (k₂ : Fin l) :
                            k₁ k₂Disjoint (slicer P k₁) (slicer P k₂)

                            .

                            theorem slicer_card {l : } (P : Fin lFin lBool) (x : Fin l) :
                            (Finset.filter (fun (ik : Fin l × Fin l) => ik.2 = x P ik.1 x = true) Finset.univ).card = (Finset.filter (fun (i_1 : Fin l) => P i_1 x = true) Finset.univ).card

                            .

                            theorem pts_tot'_eq_points_tot {α : Type} {β : Type} [Fintype β] (go : βαα) [DecidableEq α] {l : } (ph : Mathlib.Vector Bool l) (fold : Mathlib.Vector α l) :
                            points_tot go ph fold = pts_tot' go ph fold

                            Write points_tot as a disjoint union over ik.2 to prove. March 14, 2024

                            theorem pts_bound_of_embeds' {α : Type} [DecidableEq α] {b₀ : } {b₁ : } {go₀ : Fin b₀αα} {go₁ : Fin b₁αα} (h_embed : embeds_in go₀ go₁) {l : } (ph : Mathlib.Vector Bool l) (fold : Mathlib.Vector α l) :
                            pts_tot' go₀ ph fold pts_tot' go₁ ph fold

                            .

                            def pts_at_improved {α : Type} {β : Type} [Fintype β] (go : βαα) [DecidableEq α] {l : } (k : Fin l) (ph : Mathlib.Vector Bool l) (fold : Mathlib.Vector α l) :

                            .

                            Equations
                            Instances For
                              theorem pts_at_eq_pts_at'_improved {α : Type} {β : Type} [Fintype β] (go : βαα) [DecidableEq α] {l : } (k : Fin l) (ph : Mathlib.Vector Bool l) (fold : Mathlib.Vector α l) :
                              pts_at_improved go k ph fold = pts_at' go k ph fold

                              .

                              theorem pts_at_bound'_improved {α : Type} [DecidableEq α] {β : Type} [Fintype β] (go : βαα) {l : } (ph : Mathlib.Vector Bool l) (fold : Mathlib.Vector α l) (i : Fin l) :
                              pts_at' go i ph fold (↑i).pred

                              can make this i.pred I think

                              theorem Fin_sum_range (i : ) :
                              j : Fin (i + 1), j = i.succ * i / 2

                              .

                              theorem Fin_sum_range_pred (i : ) :
                              j : Fin (i + 1), (↑j).pred = i * (i - 1) / 2

                              April 2, 2024

                              theorem pts_earned_bound_loc'_improved {α : Type} [DecidableEq α] {β : Type} [Fintype β] (go : βαα) {l : } (ph : Mathlib.Vector Bool l.succ) (fold : Mathlib.Vector α l.succ) :
                              pts_tot' go ph fold l * l.pred / 2

                              .

                              theorem when_zero {α : Type} [DecidableEq α] {β : Type} [Fintype β] (go : βαα) {l : } (ph : Mathlib.Vector Bool l.succ) (fold : Mathlib.Vector α l.succ) :
                              ph.length 2pts_tot' go ph fold = 0

                              The result pts_earned_bound_loc'_improved is sharp in that for l=2, we have words of length 3 and the points bound is 1, which does in fact happen for hex fold. April 2, 2024

                              theorem path_len {α : Type} [Zero α] {β : Type} (go : βαα) {l : } (moves : Mathlib.Vector β l) :
                              (↑(path go moves)).length = l.succ

                              .

                              theorem path_at_len {α : Type} (base : α) {β : Type} (go : βαα) {l : } (moves : Mathlib.Vector β l) :
                              (↑(path_at base go moves)).length = l.succ

                              .

                              def pathᵥ {l : } {α : Type} [Zero α] {β : Type} (go : βαα) (moves : Mathlib.Vector β l) :
                              Mathlib.Vector α l.succ

                              .

                              Equations
                              Instances For
                                @[reducible, inline]
                                abbrev π {l : } {α : Type} [Zero α] {β : Type} (go : βαα) (moves : Mathlib.Vector β l) :
                                Mathlib.Vector α l.succ

                                .

                                Equations
                                Instances For
                                  theorem pathᵥ_len {α : Type} [Zero α] {β : Type} (go : βαα) {l : } (moves : Mathlib.Vector β l) :
                                  (pathᵥ go moves).length = l.succ

                                  .

                                  def pathᵥ_at {l : } {α : Type} (base : α) {β : Type} (go : βαα) (moves : Mathlib.Vector β l) :
                                  Mathlib.Vector α l.succ

                                  .

                                  Equations
                                  Instances For
                                    def pt_dir {α : Type} [Zero α] {β : Type} (go : βαα) {l : } (j : Fin l.succ) (moves : Mathlib.Vector β l) (ph : Mathlib.Vector Bool l.succ) :
                                    βFin l.succProp

                                    .

                                    Equations
                                    Instances For
                                      theorem unique_loc {α : Type} [Zero α] {β : Type} {go : βαα} {l : } {j : Fin l.succ} {moves : Mathlib.Vector β l} {ph : Mathlib.Vector Bool l.succ} (path_inj : Function.Injective fun (k : Fin l.succ) => (pathᵥ go moves).get k) (right_inj : right_injective go) (a : β) (i₀ : Fin l.succ) (i₁ : Fin l.succ) (hai₀ : pt_dir go j moves ph a i₀) (hai₁ : pt_dir go j moves ph a i₁) :
                                      i₀ = i₁

                                      .

                                      theorem unique_dir {α : Type} [Zero α] {β : Type} {go : βαα} {l : } (j : Fin l.succ) (moves : Mathlib.Vector β l) (ph : Mathlib.Vector Bool l.succ) (left_inj : left_injective go) (i : Fin l.succ) (a₀ : β) (a₁ : β) (hai₀ : pt_dir go j moves ph a₀ i) (hai₁ : pt_dir go j moves ph a₁ i) :
                                      a₀ = a₁

                                      .

                                      theorem unique_loc_dir {α : Type} [Zero α] {β : Type} {go : βαα} {l : } {j : Fin l.succ} {moves : Mathlib.Vector β l} {ph : Mathlib.Vector Bool l.succ} (path_inj : Function.Injective fun (k : Fin l.succ) => (pathᵥ go moves).get k) (right_inj : right_injective go) (left_inj : left_injective go) :
                                      (∀ (a : β) (i₀ i₁ : Fin l.succ), pt_dir go j moves ph a i₀pt_dir go j moves ph a i₁i₀ = i₁) ∀ (i : Fin l.succ) (a₀ a₁ : β), pt_dir go j moves ph a₀ ipt_dir go j moves ph a₁ ia₀ = a₁

                                      .

                                      theorem left_injective_of_embeds_in_strongly {α : Type} {b : } {go₀ : Fin bαα} {go₁ : Fin bαα} (f : Fin bαFin b) (is_emb : is_embedding go₀ go₁ f) (left_inj_emb : left_injective f) (left_inj_go : left_injective go₁) :

                                      left_injective f which we can prove for tri_rect_embedding although it's harder than left_injective_tri!

                                      theorem unique_loc_dir_rect {l : } (j : Fin l.succ) (moves : Mathlib.Vector (Fin 4) l) (ph : Mathlib.Vector Bool l.succ) (path_inj : Function.Injective fun (k : Fin l.succ) => (pathᵥ rect moves).get k) :
                                      (∀ (a : Fin 4) (i₀ i₁ : Fin l.succ), pt_dir rect j moves ph a i₀pt_dir rect j moves ph a i₁i₀ = i₁) ∀ (i : Fin l.succ) (a₀ a₁ : Fin 4), pt_dir rect j moves ph a₀ ipt_dir rect j moves ph a₁ ia₀ = a₁

                                      location, direction

                                      theorem unique_loc_dir_hex {l : } (j : Fin l.succ) (moves : Mathlib.Vector (Fin 6) l) (ph : Mathlib.Vector Bool l.succ) (path_inj : Function.Injective fun (k : Fin l.succ) => (pathᵥ hex moves).get k) :
                                      (∀ (a : Fin 6) (i₀ i₁ : Fin l.succ), pt_dir hex j moves ph a i₀pt_dir hex j moves ph a i₁i₀ = i₁) ∀ (i : Fin l.succ) (a₀ a₁ : Fin 6), pt_dir hex j moves ph a₀ ipt_dir hex j moves ph a₁ ia₀ = a₁

                                      .

                                      instance instDecidablePt_dirFinOfDecidableEq {α : Type} [Zero α] [DecidableEq α] {b : } {go : Fin bαα} {l : } (j : Fin l.succ) (ph : Mathlib.Vector Bool l.succ) (moves : Mathlib.Vector (Fin b) l) (a : Fin b) (i : Fin l.succ) :
                                      Decidable (pt_dir go j moves ph a i)

                                      This trivial instance is nonetheless needed.

                                      Equations
                                      theorem pts_at'_dir {α : Type} [Zero α] [DecidableEq α] {b : } {go : Fin bαα} {l : } (j : Fin l.succ) (ph : Mathlib.Vector Bool l.succ) (moves : Mathlib.Vector (Fin b) l) (path_inj : Function.Injective fun (k : Fin l.succ) => (pathᵥ go moves).get k) (right_inj : right_injective go) (left_inj : left_injective go) :
                                      pts_at' go j ph (pathᵥ go moves) b

                                      .

                                      theorem pts_earned_bound_dir' {α : Type} [Zero α] [DecidableEq α] {b : } {go : Fin bαα} {l : } (ph : Mathlib.Vector Bool l.succ) (moves : Mathlib.Vector (Fin b) l) (path_inj : Function.Injective fun (k : Fin l.succ) => (pathᵥ go moves).get k) (right_inj : right_injective go) (left_inj : left_injective go) :
                                      pts_tot' go ph (pathᵥ go moves) l.succ * b

                                      Almost obsolete, except for rect₃ fold which is not symmetric so that Handshake Lemma reasoning does not apply.

                                      theorem independence_in_symmetric_pts_earned_bound_dir'₁ :
                                      ∃ (α : Type) (β : Type) (x : Fintype β) (x_1 : DecidableEq α) (go : βαα), right_injective go left_injective go ¬Symmetric fun (x_2 y : α) => nearby go x_2 y = true

                                      .

                                      def f_dni :
                                      Fin 2 × Fin 2Fin 2

                                      "does not imply"

                                      Equations
                                      Instances For
                                        def g :
                                        Fin 2Fin 2Fin 2

                                        .

                                        Equations
                                        Instances For
                                          def ctrex :
                                          (Fin 2Fin 2)Fin 2Fin 2

                                          This is the first example I thought of that has a Symmetric nearby function, but is neither left nor right injective.

                                          Equations
                                          Instances For
                                            theorem independence_in_symmetric_pts_earned_bound_dir'₂ :
                                            ∃ (α : Type) (β : Type) (x : Fintype β) (x_1 : DecidableEq α) (go : βαα), ¬right_injective go ¬left_injective go Symmetric fun (x_2 y : α) => nearby go x_2 y = true

                                            .

                                            theorem pts_earned_bound' {α : Type} [Zero α] [DecidableEq α] {b : } {go : Fin bαα} {l : } (ph : Mathlib.Vector Bool l.succ) (moves : Mathlib.Vector (Fin b) l) (path_inj : Function.Injective fun (k : Fin l.succ) => (pathᵥ go moves).get k) (right_inj : right_injective go) (left_inj : left_injective go) :
                                            pts_tot' go ph (pathᵥ go moves) l.succ * b l * l.pred / 2

                                            this is anyway obsolete since Handshake lemma gives another /2 factor

                                            theorem two_heads {α : Type} {k : } (v : Mathlib.Vector α k.succ) (w : List α) (hw : w []) (h : v = w) :
                                            v.head = w.head hw

                                            .

                                            theorem path_cons {α : Type} [Zero α] {b₀ : } (go₀ : Fin b₀αα) (head : Fin b₀) (tail : List (Fin b₀)) :
                                            (path go₀ (head :: tail)) = go₀ head (path go₀ tail).head :: (path go₀ tail)

                                            .

                                            theorem path_cons_vec {α : Type} [Zero α] {b₀ : } (go₀ : Fin b₀αα) (head : Fin b₀) (tail : List (Fin b₀)) :
                                            path go₀ (head :: tail) = go₀ head (path go₀ tail).head ::ᵥ path go₀ tail

                                            .

                                            theorem path_at_cons {α : Type} (base : α) {b₀ : } (go₀ : Fin b₀αα) (hd : Fin b₀) (tl : List (Fin b₀)) :
                                            (path_at base go₀ (hd :: tl)) = go₀ hd (path_at base go₀ tl).head :: (path_at base go₀ tl)

                                            .

                                            theorem path_at_cons_vec {α : Type} (base : α) {b₀ : } (go₀ : Fin b₀αα) (hd : Fin b₀) (tl : List (Fin b₀)) :
                                            path_at base go₀ (hd :: tl) = go₀ hd (path_at base go₀ tl).head ::ᵥ path_at base go₀ tl

                                            .

                                            theorem plane_assoc (x : × ) (y : × ) (z : × ) :
                                            x + (y + z) = x + y + z

                                            .

                                            theorem orderly_injective_helper {β : Type} (x : β) (a : β) (b : β) (hab : a b) (h₀ : x 0 = a) (j : ) (hj : i < j, x i.succ = b) (h₂ : i < j, x i = a x i = b) [DecidablePred fun (n : ) => n < j x n.succ = b] :
                                            i < j, x i = a x i.succ = b

                                            .

                                            theorem fin_fin {k : } {i : } {j : Fin k.succ} (h : i < j) :
                                            i < k

                                            .

                                            theorem fin_fi {k : } {i : } {j : Fin k.succ} (h : i < j) :
                                            i < k.succ

                                            .

                                            theorem orderly_injective_helper₁ {β : Type} {k : } {x : Fin k.succβ} {a : β} {b : β} (hab : a b) (h₀ : x 0 = a) {j : Fin k.succ} (hj : ∃ (i : Fin k), i < j x i.succ = b) (h₂ : ∀ (i : Fin k.succ), i < jx i = a x i = b) [DecidablePred fun (n : ) => ∃ (h : n < j), x n, .succ = b] :
                                            ∃ (i : Fin k), i < j x i.castSucc = a x i.succ = b

                                            .

                                            theorem orderly_injective_helper₂ (k : ) (x : Fin k.succFin 4) (h₀ : x 0 = 0) (j : Fin k.succ) (hj : ∃ (i : Fin k), i < j x i.succ = 1) (h₂ : ∀ (i : Fin k.succ), i < jx i = 0 x i = 1) :
                                            ∃ (i : Fin k), i < j x i.castSucc = 0 x i.succ = 1

                                            .

                                            theorem path_len' {α : Type} [Zero α] {β : Type} (go : βαα) (l : ) (moves : List β) (hm : moves.length = l) :
                                            (↑(path go moves)).length = l.succ

                                            .

                                            theorem path_nil {α : Type} [Zero α] {β : Type} (go : βαα) :
                                            (path go []) = [0]

                                            .

                                            theorem path_at_nil {α : Type} (base : α) {β : Type} (go : βαα) :
                                            (path_at base go []) = [base]

                                            .

                                            theorem path_at_nil_vec {α : Type} (base : α) {β : Type} (go : βαα) :
                                            path_at base go [] = [base],

                                            .

                                            theorem ne_nil_of_succ_length {α : Type} {k : } (tail_ih : Mathlib.Vector α k.succ) :
                                            tail_ih []

                                            .

                                            theorem path_eq_path_morph {α : Type} [Zero α] {b₀ : } {b₁ : } (f : Fin b₀αFin b₁) (go₀ : Fin b₀αα) (go₁ : Fin b₁αα) (g : is_embedding go₀ go₁ f) (moves : List (Fin b₀)) :
                                            (path go₀ moves) = (path go₁ (morph f go₀ moves))

                                            .

                                            theorem path_eq_path_morphᵥ {l : } {α : Type} [Zero α] {b₀ : } {b₁ : } (f : Fin b₀αFin b₁) (go₀ : Fin b₀αα) (go₁ : Fin b₁αα) (g : is_embedding go₀ go₁ f) (moves : Mathlib.Vector (Fin b₀) l) :
                                            (path go₀ moves) = (path go₁ (morphᵥ f go₀ moves))

                                            .

                                            theorem pathᵥ_eq_path_morphᵥ1 {l : } {α : Type} [Zero α] {b₀ : } {b₁ : } (f : Fin b₀αFin b₁) (go₀ : Fin b₀αα) (go₁ : Fin b₁αα) (g : is_embedding go₀ go₁ f) (moves : Mathlib.Vector (Fin b₀) l) :
                                            (pathᵥ go₀ moves) = (pathᵥ go₁ (morphᵥ f go₀ moves))

                                            .

                                            theorem pathᵥ_eq_path_morphᵥ {l : } {α : Type} [Zero α] {b₀ : } {b₁ : } (f : Fin b₀αFin b₁) (go₀ : Fin b₀αα) (go₁ : Fin b₁αα) (g : is_embedding go₀ go₁ f) (moves : Mathlib.Vector (Fin b₀) l) :
                                            pathᵥ go₀ moves = pathᵥ go₁ (morphᵥ f go₀ moves)

                                            .

                                            def path_transformed {α : Type} [Zero α] {b₀ : } {b₁ : } (f : Fin b₀αFin b₁) (go₀ : Fin b₀αα) (go₁ : Fin b₁αα) (l : List (Fin b₀)) :
                                            Mathlib.Vector α l.length.succ

                                            .

                                            Equations
                                            Instances For
                                              def path_transformedᵥ {l : } {α : Type} [Zero α] {b₀ : } {b₁ : } (f : Fin b₀αFin b₁) (go₀ : Fin b₀αα) (go₁ : Fin b₁αα) (v : Mathlib.Vector (Fin b₀) l) :
                                              Mathlib.Vector α l.succ

                                              .

                                              Equations
                                              Instances For
                                                theorem transform_of_embed {α : Type} [Zero α] {b₀ : } {b₁ : } (f : Fin b₀αFin b₁) (go₀ : Fin b₀αα) (go₁ : Fin b₁αα) (l : List (Fin b₀)) (h_embed : is_embedding go₀ go₁ f) :
                                                path_transformed f go₀ go₁ l = path go₀ l
                                                def pts_tot_bound {α : Type} [Zero α] [DecidableEq α] {β : Type} [Fintype β] (go : βαα) {l : } (ph : Mathlib.Vector Bool l.succ) (q : ) :

                                                .

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  def pts_tot_bound_rev {α : Type} [Zero α] [DecidableEq α] {β : Type} [Fintype β] (go : βαα) {l : } (ph : Mathlib.Vector Bool l.succ) (q : ) :

                                                  This version of pts_tot_bound is correct even for the asymmetric 3-move version of rect:

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    instance instDecidablePredNatPts_tot_bound {l : } {α : Type} [Zero α] [DecidableEq α] {β : Type} [Fintype β] {ph : Mathlib.Vector Bool l.succ} (go : βαα) :

                                                    .

                                                    Equations
                                                    instance instDecidablePredNatPts_tot_bound_1 {l : } {α : Type} [Zero α] [DecidableEq α] {β : Type} [Fintype β] {ph : Mathlib.Vector Bool l.succ} (go : βαα) :
                                                    DecidablePred fun (n : ) => pts_tot_bound go ph n

                                                    .

                                                    Equations
                                                    instance instDecidablePredNatPts_tot_bound_rev {l : } {α : Type} [Zero α] [DecidableEq α] {β : Type} [Fintype β] (go : βαα) {ph : Mathlib.Vector Bool l.succ} :

                                                    .

                                                    Equations
                                                    instance instDecidablePredNatPts_tot_bound_rev_1 {l : } {α : Type} [Zero α] [DecidableEq α] {β : Type} [Fintype β] (go : βαα) {ph : Mathlib.Vector Bool l.succ} :
                                                    DecidablePred fun (n : ) => pts_tot_bound_rev go ph n

                                                    .

                                                    Equations
                                                    theorem pts_tot_bound_rev_exists {α : Type} [Zero α] [DecidableEq α] {β : Type} [Fintype β] (go : βαα) {l : } (ph : Mathlib.Vector Bool l.succ) :
                                                    ∃ (q : ), pts_tot_bound_rev go ph q

                                                    .

                                                    theorem pts_tot_bound_exists {α : Type} [Zero α] [DecidableEq α] {β : Type} [Fintype β] (go : βαα) {l : } (ph : Mathlib.Vector Bool l.succ) :
                                                    ∃ (q : ), pts_tot_bound go ph q

                                                    .

                                                    def HP {α : Type} [Zero α] [DecidableEq α] {β : Type} [Fintype β] (go : βαα) {l : } (ph : Mathlib.Vector Bool l.succ) :

                                                    HP is the HP protein folding model "objective function" or "value function":

                                                    Equations
                                                    Instances For
                                                      def HP_rev {α : Type} [Zero α] [DecidableEq α] {β : Type} [Fintype β] (go : βαα) {l : } (ph : Mathlib.Vector Bool l.succ) :

                                                      For nonsymmetric "nearby" relations we must use this version.

                                                      Equations
                                                      Instances For
                                                        def P_tri' {l : } (ph : Mathlib.Vector Bool l.succ) :

                                                        .

                                                        Equations
                                                        Instances For
                                                          def P_rect' {l : } (ph : Mathlib.Vector Bool l.succ) :

                                                          .

                                                          Equations
                                                          Instances For
                                                            def P_rect₃' {l : } (ph : Mathlib.Vector Bool l.succ) :

                                                            .

                                                            Equations
                                                            Instances For
                                                              def P_hex' {l : } (ph : Mathlib.Vector Bool l.succ) :

                                                              .

                                                              Equations
                                                              Instances For
                                                                theorem Vector_inj_of_list_inj {t : Type} {n : } {v : Mathlib.Vector t n} (h : Function.Injective fun (k : Fin (↑v).length) => (↑v).get k) :
                                                                Function.Injective fun (k : Fin n) => v.get k

                                                                .

                                                                theorem list_inj_of_Vector_inj {t : Type} {n : } {v : Mathlib.Vector t n} (h : Function.Injective fun (k : Fin n) => v.get k) :
                                                                Function.Injective fun (k : Fin (↑v).length) => (↑v).get k

                                                                .

                                                                theorem P_tri_lin_bound {l : } (ph : Mathlib.Vector Bool l.succ) :
                                                                P_tri' ph l.succ * 3

                                                                .

                                                                theorem P_hex_lin_bound {l : } (ph : Mathlib.Vector Bool l.succ) :
                                                                P_hex' ph l.succ * 6

                                                                .

                                                                theorem P_rect_lin_bound {l : } (ph : Mathlib.Vector Bool l.succ) :
                                                                P_rect' ph l.succ * 4

                                                                .

                                                                theorem value_bound_of_embeds_strongly {α : Type} [Zero α] [DecidableEq α] {b₀ : } {b₁ : } {go₀ : Fin b₀αα} {go₁ : Fin b₁αα} (h_embed : go₀ go₁) {l : } (ph : Mathlib.Vector Bool l.succ) :
                                                                HP go₀ ph HP go₁ ph

                                                                .

                                                                theorem HP_quad_bounds_tri {l : } (ph : Mathlib.Vector Bool l.succ) :
                                                                HP tri ph HP rect ph

                                                                .

                                                                theorem HP_hex_bounds_quad {l : } (ph : Mathlib.Vector Bool l.succ) :
                                                                HP rect ph HP hex ph

                                                                .