AFTD Auto-Formalizing Theoretical Domains

perm_avoids_3421_4312

def

A permutation $\sigma$ on $\{0, \dots, n-1\}$ avoids both classical patterns 3421 and 4312: there are no four indices $i_1 < i_2 < i_3 < i_4$ whose values are ordered as $\sigma(i_4) < \sigma(i_3) < \sigma(i_1) < \sigma(i_2)$ or as $\sigma(i_3) < \sigma(i_4) < \sigma(i_2) < \sigma(i_1)$.

Statement

def perm_avoids_3421_4312 {n : ℕ} (σ : Equiv.Perm (Fin n)) : Prop
Defined in
arXiv:2611.33575 Section 8
Verified
27 Nov 2026
Axioms
none listed

Read back from the Lean

For a natural number $n$ and a permutation $\sigma$ of $\mathrm{Fin}(n)$, perm_avoids_3421_4312 is the conjunction of two conditions: 1. For all $i_1, i_2, i_3, i_4 \in \mathrm{Fin}(n)$, if $i_1 < i_2$, $i_2 < i_3$, and $i_3 < i_4$, then it is not the case that $\sigma(i_4) < \sigma(i_3)$, $\sigma(i_3) < \sigma(i_1)$, and $\sigma(i_1) < \sigma(i_2)$ simultaneously. 2. For all $i_1, i_2, i_3, i_4 \in \mathrm{Fin}(n)$, if $i_1 < i_2$, $i_2 < i_3$, and $i_3 < i_4$, then it is not the case that $\sigma(i_3) < \sigma(i_4)$, $\sigma(i_4) < \sigma(i_2)$, and $\sigma(i_2) < \sigma(i_1)$ simultaneously.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- Predicate for a permutation on Fin n avoiding both patterns 3421 and 4312. -/
def perm_avoids_3421_4312 {n : ℕ} (σ : Equiv.Perm (Fin n)) : Prop := (∀ ⦃i₁ i₂ i₃ i₄ : Fin n⦄, i₁ < i₂ → i₂ < i₃ → i₃ < i₄ → ¬ (σ i₄ < σ i₃ ∧ σ i₃ < σ i₁ ∧ σ i₁ < σ i₂)) ∧
  (∀ ⦃i₁ i₂ i₃ i₄ : Fin n⦄, i₁ < i₂ → i₂ < i₃ → i₃ < i₄ → ¬ (σ i₃ < σ i₄ ∧ σ i₄ < σ i₂ ∧ σ i₂ < σ i₁))
See it in the graphDiscuss this resultChallenge it