-- Mathlib/.lake/packages/lean4/src/lean/Init/Data/Array/Lex/Lemmas.lean
theorem lex_eq_false_iff_exists [BEq α] [PartialEquivBEq α] (lt : α → α → Bool)
    (lt_irrefl : ∀ x y, x == y → lt x y = false)
    (lt_asymm : ∀ x y, lt x y = true → lt y x = false)
    (lt_antisymm : ∀ x y, lt x y = false → lt y x = false → x == y) :
    lex l₁ l₂ lt = false ↔
      (l₂.isEqv (l₁.take l₂.size) (· == ·)) ∨
        (∃ (i : Nat) (h₁ : i < l₁.size) (h₂ : i < l₂.size),
          (∀ j, (hj : j < i) →
            l₁[j]'(Nat.lt_trans hj h₁) == l₂[j]'(Nat.lt_trans hj h₂)) ∧ lt l₂[i] l₁[i])

Proof state:
case mk.mk
α : Type u_1
inst✝¹ : BEq α
inst✝ : PartialEquivBEq α
lt : α → α → Bool
lt_irrefl : ∀ (x y : α), (x == y) = true → lt x y = false
lt_asymm : ∀ (x y : α), lt x y = true → lt y x = false
lt_antisymm : ∀ (x y : α), lt x y = false → lt y x = false → (x == y) = true
toList✝¹ toList✝ : List α
⊢ { toList := toList✝¹ }.lex { toList := toList✝ } lt = false ↔
    ({ toList := toList✝ }.isEqv ({ toList := toList✝¹ }.take { toList := toList✝ }.size) fun x1 x2 => x1 == x2) =
        true ∨
      ∃ i h₁ h₂,
        (∀ (j : Nat) (hj : j < i), ({ toList := toList✝¹ }[j] == { toList := toList✝ }[j]) = true) ∧
          lt { toList := toList✝ }[i] { toList := toList✝¹ }[i] = true

Tactic:
simp_all [List.lex_eq_false_iff_exists]

Result:
no goals

Proof state:
α : Type u_1
l₁ l₂ : Array α
inst✝¹ : BEq α
inst✝ : PartialEquivBEq α
lt : α → α → Bool
lt_irrefl : ∀ (x y : α), (x == y) = true → lt x y = false
lt_asymm : ∀ (x y : α), lt x y = true → lt y x = false
lt_antisymm : ∀ (x y : α), lt x y = false → lt y x = false → (x == y) = true
⊢ l₁.lex l₂ lt = false ↔
    (l₂.isEqv (l₁.take l₂.size) fun x1 x2 => x1 == x2) = true ∨
      ∃ i h₁ h₂, (∀ (j : Nat) (hj : j < i), (l₁[j] == l₂[j]) = true) ∧ lt l₂[i] l₁[i] = true

Tactic:
cases l₁

Result:
case mk
α : Type u_1
l₂ : Array α
inst✝¹ : BEq α
inst✝ : PartialEquivBEq α
lt : α → α → Bool
lt_irrefl : ∀ (x y : α), (x == y) = true → lt x y = false
lt_asymm : ∀ (x y : α), lt x y = true → lt y x = false
lt_antisymm : ∀ (x y : α), lt x y = false → lt y x = false → (x == y) = true
toList✝ : List α
⊢ { toList := toList✝ }.lex l₂ lt = false ↔
    (l₂.isEqv ({ toList := toList✝ }.take l₂.size) fun x1 x2 => x1 == x2) = true ∨
      ∃ i h₁ h₂,
        (∀ (j : Nat) (hj : j < i), ({ toList := toList✝ }[j] == l₂[j]) = true) ∧
          lt l₂[i] { toList := toList✝ }[i] = true

Proof state:
case mk
α : Type u_1
l₂ : Array α
inst✝¹ : BEq α
inst✝ : PartialEquivBEq α
lt : α → α → Bool
lt_irrefl : ∀ (x y : α), (x == y) = true → lt x y = false
lt_asymm : ∀ (x y : α), lt x y = true → lt y x = false
lt_antisymm : ∀ (x y : α), lt x y = false → lt y x = false → (x == y) = true
toList✝ : List α
⊢ { toList := toList✝ }.lex l₂ lt = false ↔
    (l₂.isEqv ({ toList := toList✝ }.take l₂.size) fun x1 x2 => x1 == x2) = true ∨
      ∃ i h₁ h₂,
        (∀ (j : Nat) (hj : j < i), ({ toList := toList✝ }[j] == l₂[j]) = true) ∧
          lt l₂[i] { toList := toList✝ }[i] = true

Tactic:
cases l₂

Result:
case mk.mk
α : Type u_1
inst✝¹ : BEq α
inst✝ : PartialEquivBEq α
lt : α → α → Bool
lt_irrefl : ∀ (x y : α), (x == y) = true → lt x y = false
lt_asymm : ∀ (x y : α), lt x y = true → lt y x = false
lt_antisymm : ∀ (x y : α), lt x y = false → lt y x = false → (x == y) = true
toList✝¹ toList✝ : List α
⊢ { toList := toList✝¹ }.lex { toList := toList✝ } lt = false ↔
    ({ toList := toList✝ }.isEqv ({ toList := toList✝¹ }.take { toList := toList✝ }.size) fun x1 x2 => x1 == x2) =
        true ∨
      ∃ i h₁ h₂,
        (∀ (j : Nat) (hj : j < i), ({ toList := toList✝¹ }[j] == { toList := toList✝ }[j]) = true) ∧
          lt { toList := toList✝ }[i] { toList := toList✝¹ }[i] = true