l3lab/ntp-mathlib huggingface dataset:
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (

Proof state:
case inl.inl
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ↑x = ↑i
h₂ : ↑y = ↑i ∧ rank m ↑i = rank m ↑y
⊢ ¬↑y = ↑i → rank m ↑y + 1 < if rank m ↑i = rank m ↑y then rank m ↑y + 1 else rank m ↑y

Next tactic:
intro h
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; 

Proof state:
case inl.inl
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ↑x = ↑i
h₂ : ↑y = ↑i ∧ rank m ↑i = rank m ↑y
h : ¬↑y = ↑i
⊢ rank m ↑y + 1 < if rank m ↑i = rank m ↑y then rank m ↑y + 1 else rank m ↑y

Next tactic:
try simp [h] at h₂ <;> simp [h₁, h₂, h]
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; try 

Proof state:
case inl.inl
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ↑x = ↑i
h₂ : ↑y = ↑i ∧ rank m ↑i = rank m ↑y
h : ¬↑y = ↑i
⊢ rank m ↑y + 1 < if rank m ↑i = rank m ↑y then rank m ↑y + 1 else rank m ↑y

Next tactic:
simp [h] at h₂
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (

Proof state:
case inl.inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ↑x = ↑i
h₂ : ¬(↑y = ↑i ∧ rank m ↑i = rank m ↑y)
⊢ ¬↑y = ↑i → rank m ↑i < if rank m ↑i = rank m ↑y then rank m ↑y + 1 else rank m ↑y

Next tactic:
intro h
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; 

Proof state:
case inl.inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ↑x = ↑i
h₂ : ¬(↑y = ↑i ∧ rank m ↑i = rank m ↑y)
h : ¬↑y = ↑i
⊢ rank m ↑i < if rank m ↑i = rank m ↑y then rank m ↑y + 1 else rank m ↑y

Next tactic:
try simp [h] at h₂ <;> simp [h₁, h₂, h]
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; try 

Proof state:
case inl.inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ↑x = ↑i
h₂ : ¬(↑y = ↑i ∧ rank m ↑i = rank m ↑y)
h : ¬↑y = ↑i
⊢ rank m ↑i < if rank m ↑i = rank m ↑y then rank m ↑y + 1 else rank m ↑y

Next tactic:
simp [h] at h₂
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; try simp [h] at h₂ <;> 

Proof state:
case inl.inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ↑x = ↑i
h : ¬↑y = ↑i
h₂ : True
⊢ rank m ↑i < if rank m ↑i = rank m ↑y then rank m ↑y + 1 else rank m ↑y

Next tactic:
simp [h₁, h₂, h]
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (

Proof state:
case inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h✝ : ¬↑x = ↑i
⊢ ¬↑(parent m i) = ↑i →
    (if ↑y = ↑i ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑i) <
      if ↑y = ↑(parent m i) ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑(parent m i)

Next tactic:
rename_i h₁
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (

Proof state:
case inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ¬↑x = ↑i
⊢ ¬↑(parent m i) = ↑i →
    (if ↑y = ↑i ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑i) <
      if ↑y = ↑(parent m i) ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑(parent m i)

Next tactic:
try simp [h₁]
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try 

Proof state:
case inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ¬↑x = ↑i
⊢ ¬↑(parent m i) = ↑i →
    (if ↑y = ↑i ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑i) <
      if ↑y = ↑(parent m i) ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑(parent m i)

Next tactic:
simp [h₁]
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); 

Proof state:
case inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ¬↑x = ↑i
⊢ ¬↑(parent m i) = ↑i →
    (if ↑y = ↑i ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑i) <
      if ↑y = ↑(parent m i) ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑(parent m i)

Next tactic:
split
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> 

Proof state:
case inr.inl
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ¬↑x = ↑i
h✝ : ↑y = ↑i ∧ rank m ↑x = rank m ↑y
⊢ ¬↑(parent m i) = ↑i →
    rank m ↑y + 1 < if ↑y = ↑(parent m i) ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑(parent m i)

Next tactic:
rename_i h₂
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> 

Proof state:
case inr.inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ¬↑x = ↑i
h✝ : ¬(↑y = ↑i ∧ rank m ↑x = rank m ↑y)
⊢ ¬↑(parent m i) = ↑i →
    rank m ↑i < if ↑y = ↑(parent m i) ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑(parent m i)

Next tactic:
rename_i h₂
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (

Proof state:
case inr.inl
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ¬↑x = ↑i
h₂ : ↑y = ↑i ∧ rank m ↑x = rank m ↑y
⊢ ¬↑(parent m i) = ↑i →
    rank m ↑y + 1 < if ↑y = ↑(parent m i) ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑(parent m i)

Next tactic:
intro h
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; 

Proof state:
case inr.inl
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ¬↑x = ↑i
h₂ : ↑y = ↑i ∧ rank m ↑x = rank m ↑y
h : ¬↑(parent m i) = ↑i
⊢ rank m ↑y + 1 < if ↑y = ↑(parent m i) ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑(parent m i)

Next tactic:
try simp [h] at h₂ <;> simp [h₁, h₂, h]
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; try 

Proof state:
case inr.inl
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ¬↑x = ↑i
h₂ : ↑y = ↑i ∧ rank m ↑x = rank m ↑y
h : ¬↑(parent m i) = ↑i
⊢ rank m ↑y + 1 < if ↑y = ↑(parent m i) ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑(parent m i)

Next tactic:
simp [h] at h₂
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (

Proof state:
case inr.inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ¬↑x = ↑i
h₂ : ¬(↑y = ↑i ∧ rank m ↑x = rank m ↑y)
⊢ ¬↑(parent m i) = ↑i →
    rank m ↑i < if ↑y = ↑(parent m i) ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑(parent m i)

Next tactic:
intro h
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; 

Proof state:
case inr.inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ¬↑x = ↑i
h₂ : ¬(↑y = ↑i ∧ rank m ↑x = rank m ↑y)
h : ¬↑(parent m i) = ↑i
⊢ rank m ↑i < if ↑y = ↑(parent m i) ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑(parent m i)

Next tactic:
try simp [h] at h₂ <;> simp [h₁, h₂, h]
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; try 

Proof state:
case inr.inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ¬↑x = ↑i
h₂ : ¬(↑y = ↑i ∧ rank m ↑x = rank m ↑y)
h : ¬↑(parent m i) = ↑i
⊢ rank m ↑i < if ↑y = ↑(parent m i) ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑(parent m i)

Next tactic:
simp [h] at h₂
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; try simp [h] at h₂ <;> 

Proof state:
case inr.inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ¬↑x = ↑i
h : ¬↑(parent m i) = ↑i
h₂ : ↑y = ↑i → ¬rank m ↑x = rank m ↑y
⊢ rank m ↑i < if ↑y = ↑(parent m i) ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑(parent m i)

Next tactic:
simp [h₁, h₂, h]
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; try simp [h] at h₂ <;> simp [h₁, h₂, h]))
    · 

Proof state:
case inl.inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ↑x = ↑i
h₂ : ¬(↑y = ↑i ∧ rank m ↑i = rank m ↑y)
h : ¬↑y = ↑i
⊢ rank m ↑i < if rank m ↑i = rank m ↑y then rank m ↑y + 1 else rank m ↑y

Next tactic:
simp [← h₁]
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; try simp [h] at h₂ <;> simp [h₁, h₂, h]))
    · simp [← h₁]; 

Proof state:
case inl.inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ↑x = ↑i
h₂ : ¬(↑y = ↑i ∧ rank m ↑i = rank m ↑y)
h : ¬↑y = ↑i
⊢ rank m ↑x < if rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑y

Next tactic:
split
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; try simp [h] at h₂ <;> simp [h₁, h₂, h]))
    · simp [← h₁]; split <;> 

Proof state:
case inl.inr.inl
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ↑x = ↑i
h₂ : ¬(↑y = ↑i ∧ rank m ↑i = rank m ↑y)
h : ¬↑y = ↑i
h✝ : rank m ↑x = rank m ↑y
⊢ rank m ↑x < rank m ↑y + 1

Next tactic:
rename_i h₃
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; try simp [h] at h₂ <;> simp [h₁, h₂, h]))
    · simp [← h₁]; split <;> 

Proof state:
case inl.inr.inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ↑x = ↑i
h₂ : ¬(↑y = ↑i ∧ rank m ↑i = rank m ↑y)
h : ¬↑y = ↑i
h✝ : ¬rank m ↑x = rank m ↑y
⊢ rank m ↑x < rank m ↑y

Next tactic:
rename_i h₃
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; try simp [h] at h₂ <;> simp [h₁, h₂, h]))
    · simp [← h₁]; split <;> rename_i h₃
      · 

Proof state:
case inl.inr.inl
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ↑x = ↑i
h₂ : ¬(↑y = ↑i ∧ rank m ↑i = rank m ↑y)
h : ¬↑y = ↑i
h₃ : rank m ↑x = rank m ↑y
⊢ rank m ↑x < rank m ↑y + 1

Next tactic:
rw [h₃]
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; try simp [h] at h₂ <;> simp [h₁, h₂, h]))
    · simp [← h₁]; split <;> rename_i h₃
      · rw [h₃]; 

Proof state:
case inl.inr.inl
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ↑x = ↑i
h₂ : ¬(↑y = ↑i ∧ rank m ↑i = rank m ↑y)
h : ¬↑y = ↑i
h₃ : rank m ↑x = rank m ↑y
⊢ rank m ↑y < rank m ↑y + 1

Next tactic:
apply Nat.lt_succ_self
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; try simp [h] at h₂ <;> simp [h₁, h₂, h]))
    · simp [← h₁]; split <;> rename_i h₃
      · rw [h₃]; apply Nat.lt_succ_self
      · 

Proof state:
case inl.inr.inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ↑x = ↑i
h₂ : ¬(↑y = ↑i ∧ rank m ↑i = rank m ↑y)
h : ¬↑y = ↑i
h₃ : ¬rank m ↑x = rank m ↑y
⊢ rank m ↑x < rank m ↑y

Next tactic:
exact lt_of_le_of_ne H h₃
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; try simp [h] at h₂ <;> simp [h₁, h₂, h]))
    · simp [← h₁]; split <;> rename_i h₃
      · rw [h₃]; apply Nat.lt_succ_self
      · exact lt_of_le_of_ne H h₃
    · 

Proof state:
case inr.inl
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ¬↑x = ↑i
h₂ : ↑y = ↑i ∧ rank m ↑x = rank m ↑y
h : ¬↑(parent m i) = ↑i
⊢ rank m ↑y + 1 < if ↑y = ↑(parent m i) ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑(parent m i)

Next tactic:
have := Fin.eq_of_val_eq h₂.1
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; try simp [h] at h₂ <;> simp [h₁, h₂, h]))
    · simp [← h₁]; split <;> rename_i h₃
      · rw [h₃]; apply Nat.lt_succ_self
      · exact lt_of_le_of_ne H h₃
    · have := Fin.eq_of_val_eq h₂.1; 

Proof state:
case inr.inl
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ¬↑x = ↑i
h₂ : ↑y = ↑i ∧ rank m ↑x = rank m ↑y
h : ¬↑(parent m i) = ↑i
this : y = i
⊢ rank m ↑y + 1 < if ↑y = ↑(parent m i) ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑(parent m i)

Next tactic:
subst this
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; try simp [h] at h₂ <;> simp [h₁, h₂, h]))
    · simp [← h₁]; split <;> rename_i h₃
      · rw [h₃]; apply Nat.lt_succ_self
      · exact lt_of_le_of_ne H h₃
    · have := Fin.eq_of_val_eq h₂.1; subst this
      

Proof state:
case inr.inl
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
h₁ : ¬↑x = ↑y
h₂ : ↑y = ↑y ∧ rank m ↑x = rank m ↑y
h : ¬↑(parent m y) = ↑y
⊢ rank m ↑y + 1 < if ↑y = ↑(parent m y) ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑(parent m y)

Next tactic:
simp [hroot] at h
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; try simp [h] at h₂ <;> simp [h₁, h₂, h]))
    · simp [← h₁]; split <;> rename_i h₃
      · rw [h₃]; apply Nat.lt_succ_self
      · exact lt_of_le_of_ne H h₃
    · have := Fin.eq_of_val_eq h₂.1; subst this
      simp [hroot] at h
    · 

Proof state:
case inr.inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ¬↑x = ↑i
h₂ : ¬(↑y = ↑i ∧ rank m ↑x = rank m ↑y)
h : ¬↑(parent m i) = ↑i
⊢ rank m ↑i < if ↑y = ↑(parent m i) ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑(parent m i)

Next tactic:
have := m.rank_lt i h
def setParentBump {n} (m : UFModel n) (x y : Fin n)
    (H : m.rank x ≤ m.rank y) (hroot : (m.parent y).1 = y) : UFModel n where
  parent i := if x.1 = i then y else m.parent i
  rank i := if y.1 = i ∧ m.rank x = m.rank y then m.rank y + 1 else m.rank i
  rank_lt i := by
    simp; split <;>
      (rename_i h₁; (try simp [h₁]); split <;> rename_i h₂ <;>
        (intro h; try simp [h] at h₂ <;> simp [h₁, h₂, h]))
    · simp [← h₁]; split <;> rename_i h₃
      · rw [h₃]; apply Nat.lt_succ_self
      · exact lt_of_le_of_ne H h₃
    · have := Fin.eq_of_val_eq h₂.1; subst this
      simp [hroot] at h
    · have := m.rank_lt i h
      

Proof state:
case inr.inr
n : ℕ
m : UFModel n
x y : Fin n
H : rank m ↑x ≤ rank m ↑y
hroot : ↑(parent m y) = ↑y
i : Fin n
h₁ : ¬↑x = ↑i
h₂ : ¬(↑y = ↑i ∧ rank m ↑x = rank m ↑y)
h : ¬↑(parent m i) = ↑i
this : rank m ↑i < rank m ↑(parent m i)
⊢ rank m ↑i < if ↑y = ↑(parent m i) ∧ rank m ↑x = rank m ↑y then rank m ↑y + 1 else rank m ↑(parent m i)

Next tactic:
split