l3lab/ntp-mathlib huggingface dataset:
theorem dual_balanceL (l : Ordnode α) (x : α) (r : Ordnode α) :
    dual (balanceL l x r) = balanceR (dual r) x (dual l) := by
  unfold balanceL balanceR
  cases' r with rs rl rx rr
  · cases' l with ls ll lx lr; · rfl
    cases' ll with lls lll llx llr <;> cases' lr with lrs lrl lrx lrr <;> dsimp only [dual, id] <;>
      try rfl
    split_ifs with h <;> repeat simp [h, add_comm]
  · cases' l with ls ll lx lr; · rfl
    dsimp only [dual, id]
    split_ifs; swap; · simp [add_comm]
    

Proof state:
case pos
α : Type u_1
x : α
rs : ℕ
rl : Ordnode α
rx : α
rr : Ordnode α
ls : ℕ
ll : Ordnode α
lx : α
lr : Ordnode α
h✝ : ls > delta * rs
⊢ dual
      (rec (motive := fun t => ll = t → Ordnode α) (fun h => nil)
        (fun size l x_1 r l_ih r_ih h =>
          rec (motive := fun t => lr = t → Ordnode α) (fun h => nil)
            (fun size_1 l x_2 r l_ih r_ih h =>
              if size_1 < ratio * size then node (ls + rs + 1) ll lx (node (rs + size_1 + 1) lr x (node rs rl rx rr))
              else
                node (ls + rs + 1) (node (size + Ordnode.size l + 1) ll lx l) x_2
                  (node (Ordnode.size r + rs + 1) r x (node rs rl rx rr)))
            lr (_ : id lr = id lr))
        ll (_ : id ll = id ll)) =
    rec (motive := fun t => dual ll = t → Ordnode α) (fun h => nil)
      (fun size l x_1 r l_ih r_ih h =>
        rec (motive := fun t => dual lr = t → Ordnode α) (fun h => nil)
          (fun size_1 l x_2 r l_ih r_ih h =>
            if size_1 < ratio * size then
              node (rs + ls + 1) (node (rs + size_1 + 1) (node rs (dual rr) rx (dual rl)) x (dual lr)) lx (dual ll)
            else
              node (rs + ls + 1) (node (rs + Ordnode.size l + 1) (node rs (dual rr) rx (dual rl)) x l) x_2
                (node (Ordnode.size r + size + 1) r lx (dual ll)))
          (dual lr) (_ : id (dual lr) = id (dual lr)))
      (dual ll) (_ : id (dual ll) = id (dual ll))

Next tactic:
cases' ll with lls lll llx llr
theorem dual_balanceL (l : Ordnode α) (x : α) (r : Ordnode α) :
    dual (balanceL l x r) = balanceR (dual r) x (dual l) := by
  unfold balanceL balanceR
  cases' r with rs rl rx rr
  · cases' l with ls ll lx lr; · rfl
    cases' ll with lls lll llx llr <;> cases' lr with lrs lrl lrx lrr <;> dsimp only [dual, id] <;>
      try rfl
    split_ifs with h <;> repeat simp [h, add_comm]
  · cases' l with ls ll lx lr; · rfl
    dsimp only [dual, id]
    split_ifs; swap; · simp [add_comm]
    cases' ll with lls lll llx llr <;> 

Proof state:
case pos.nil
α : Type u_1
x : α
rs : ℕ
rl : Ordnode α
rx : α
rr : Ordnode α
ls : ℕ
lx : α
lr : Ordnode α
h✝ : ls > delta * rs
⊢ dual
      (rec (motive := fun t => nil = t → Ordnode α) (fun h => nil)
        (fun size l x_1 r l_ih r_ih h =>
          rec (motive := fun t => lr = t → Ordnode α) (fun h => nil)
            (fun size_1 l x_2 r l_ih r_ih h =>
              if size_1 < ratio * size then node (ls + rs + 1) nil lx (node (rs + size_1 + 1) lr x (node rs rl rx rr))
              else
                node (ls + rs + 1) (node (size + Ordnode.size l + 1) nil lx l) x_2
                  (node (Ordnode.size r + rs + 1) r x (node rs rl rx rr)))
            lr (_ : id lr = id lr))
        nil (_ : id nil = id nil)) =
    rec (motive := fun t => dual nil = t → Ordnode α) (fun h => nil)
      (fun size l x_1 r l_ih r_ih h =>
        rec (motive := fun t => dual lr = t → Ordnode α) (fun h => nil)
          (fun size_1 l x_2 r l_ih r_ih h =>
            if size_1 < ratio * size then
              node (rs + ls + 1) (node (rs + size_1 + 1) (node rs (dual rr) rx (dual rl)) x (dual lr)) lx (dual nil)
            else
              node (rs + ls + 1) (node (rs + Ordnode.size l + 1) (node rs (dual rr) rx (dual rl)) x l) x_2
                (node (Ordnode.size r + size + 1) r lx (dual nil)))
          (dual lr) (_ : id (dual lr) = id (dual lr)))
      (dual nil) (_ : id (dual nil) = id (dual nil))

Next tactic:
cases' lr with lrs lrl lrx lrr
theorem dual_balanceL (l : Ordnode α) (x : α) (r : Ordnode α) :
    dual (balanceL l x r) = balanceR (dual r) x (dual l) := by
  unfold balanceL balanceR
  cases' r with rs rl rx rr
  · cases' l with ls ll lx lr; · rfl
    cases' ll with lls lll llx llr <;> cases' lr with lrs lrl lrx lrr <;> dsimp only [dual, id] <;>
      try rfl
    split_ifs with h <;> repeat simp [h, add_comm]
  · cases' l with ls ll lx lr; · rfl
    dsimp only [dual, id]
    split_ifs; swap; · simp [add_comm]
    cases' ll with lls lll llx llr <;> 

Proof state:
case pos.node
α : Type u_1
x : α
rs : ℕ
rl : Ordnode α
rx : α
rr : Ordnode α
ls : ℕ
lx : α
lr : Ordnode α
h✝ : ls > delta * rs
lls : ℕ
lll : Ordnode α
llx : α
llr : Ordnode α
⊢ dual
      (rec (motive := fun t => node lls lll llx llr = t → Ordnode α) (fun h => nil)
        (fun size l x_1 r l_ih r_ih h =>
          rec (motive := fun t => lr = t → Ordnode α) (fun h => nil)
            (fun size_1 l x_2 r l_ih r_ih h =>
              if size_1 < ratio * size then
                node (ls + rs + 1) (node lls lll llx llr) lx (node (rs + size_1 + 1) lr x (node rs rl rx rr))
              else
                node (ls + rs + 1) (node (size + Ordnode.size l + 1) (node lls lll llx llr) lx l) x_2
                  (node (Ordnode.size r + rs + 1) r x (node rs rl rx rr)))
            lr (_ : id lr = id lr))
        (node lls lll llx llr) (_ : id (node lls lll llx llr) = id (node lls lll llx llr))) =
    rec (motive := fun t => dual (node lls lll llx llr) = t → Ordnode α) (fun h => nil)
      (fun size l x_1 r l_ih r_ih h =>
        rec (motive := fun t => dual lr = t → Ordnode α) (fun h => nil)
          (fun size_1 l x_2 r l_ih r_ih h =>
            if size_1 < ratio * size then
              node (rs + ls + 1) (node (rs + size_1 + 1) (node rs (dual rr) rx (dual rl)) x (dual lr)) lx
                (dual (node lls lll llx llr))
            else
              node (rs + ls + 1) (node (rs + Ordnode.size l + 1) (node rs (dual rr) rx (dual rl)) x l) x_2
                (node (Ordnode.size r + size + 1) r lx (dual (node lls lll llx llr))))
          (dual lr) (_ : id (dual lr) = id (dual lr)))
      (dual (node lls lll llx llr)) (_ : id (dual (node lls lll llx llr)) = id (dual (node lls lll llx llr)))

Next tactic:
cases' lr with lrs lrl lrx lrr
theorem dual_balanceL (l : Ordnode α) (x : α) (r : Ordnode α) :
    dual (balanceL l x r) = balanceR (dual r) x (dual l) := by
  unfold balanceL balanceR
  cases' r with rs rl rx rr
  · cases' l with ls ll lx lr; · rfl
    cases' ll with lls lll llx llr <;> cases' lr with lrs lrl lrx lrr <;> dsimp only [dual, id] <;>
      try rfl
    split_ifs with h <;> repeat simp [h, add_comm]
  · cases' l with ls ll lx lr; · rfl
    dsimp only [dual, id]
    split_ifs; swap; · simp [add_comm]
    cases' ll with lls lll llx llr <;> cases' lr with lrs lrl lrx lrr <;> 

Proof state:
case pos.nil.nil
α : Type u_1
x : α
rs : ℕ
rl : Ordnode α
rx : α
rr : Ordnode α
ls : ℕ
lx : α
h✝ : ls > delta * rs
⊢ dual
      (rec (motive := fun t => nil = t → Ordnode α) (fun h => nil)
        (fun size l x_1 r l_ih r_ih h =>
          rec (motive := fun t => nil = t → Ordnode α) (fun h => nil)
            (fun size_1 l x_2 r l_ih r_ih h =>
              if size_1 < ratio * size then node (ls + rs + 1) nil lx (node (rs + size_1 + 1) nil x (node rs rl rx rr))
              else
                node (ls + rs + 1) (node (size + Ordnode.size l + 1) nil lx l) x_2
                  (node (Ordnode.size r + rs + 1) r x (node rs rl rx rr)))
            nil (_ : id nil = id nil))
        nil (_ : id nil = id nil)) =
    rec (motive := fun t => dual nil = t → Ordnode α) (fun h => nil)
      (fun size l x_1 r l_ih r_ih h =>
        rec (motive := fun t => dual nil = t → Ordnode α) (fun h => nil)
          (fun size_1 l x_2 r l_ih r_ih h =>
            if size_1 < ratio * size then
              node (rs + ls + 1) (node (rs + size_1 + 1) (node rs (dual rr) rx (dual rl)) x (dual nil)) lx (dual nil)
            else
              node (rs + ls + 1) (node (rs + Ordnode.size l + 1) (node rs (dual rr) rx (dual rl)) x l) x_2
                (node (Ordnode.size r + size + 1) r lx (dual nil)))
          (dual nil) (_ : id (dual nil) = id (dual nil)))
      (dual nil) (_ : id (dual nil) = id (dual nil))

Next tactic:
try rfl
theorem dual_balanceL (l : Ordnode α) (x : α) (r : Ordnode α) :
    dual (balanceL l x r) = balanceR (dual r) x (dual l) := by
  unfold balanceL balanceR
  cases' r with rs rl rx rr
  · cases' l with ls ll lx lr; · rfl
    cases' ll with lls lll llx llr <;> cases' lr with lrs lrl lrx lrr <;> dsimp only [dual, id] <;>
      try rfl
    split_ifs with h <;> repeat simp [h, add_comm]
  · cases' l with ls ll lx lr; · rfl
    dsimp only [dual, id]
    split_ifs; swap; · simp [add_comm]
    cases' ll with lls lll llx llr <;> cases' lr with lrs lrl lrx lrr <;> try 

Proof state:
case pos.nil.nil
α : Type u_1
x : α
rs : ℕ
rl : Ordnode α
rx : α
rr : Ordnode α
ls : ℕ
lx : α
h✝ : ls > delta * rs
⊢ dual
      (rec (motive := fun t => nil = t → Ordnode α) (fun h => nil)
        (fun size l x_1 r l_ih r_ih h =>
          rec (motive := fun t => nil = t → Ordnode α) (fun h => nil)
            (fun size_1 l x_2 r l_ih r_ih h =>
              if size_1 < ratio * size then node (ls + rs + 1) nil lx (node (rs + size_1 + 1) nil x (node rs rl rx rr))
              else
                node (ls + rs + 1) (node (size + Ordnode.size l + 1) nil lx l) x_2
                  (node (Ordnode.size r + rs + 1) r x (node rs rl rx rr)))
            nil (_ : id nil = id nil))
        nil (_ : id nil = id nil)) =
    rec (motive := fun t => dual nil = t → Ordnode α) (fun h => nil)
      (fun size l x_1 r l_ih r_ih h =>
        rec (motive := fun t => dual nil = t → Ordnode α) (fun h => nil)
          (fun size_1 l x_2 r l_ih r_ih h =>
            if size_1 < ratio * size then
              node (rs + ls + 1) (node (rs + size_1 + 1) (node rs (dual rr) rx (dual rl)) x (dual nil)) lx (dual nil)
            else
              node (rs + ls + 1) (node (rs + Ordnode.size l + 1) (node rs (dual rr) rx (dual rl)) x l) x_2
                (node (Ordnode.size r + size + 1) r lx (dual nil)))
          (dual nil) (_ : id (dual nil) = id (dual nil)))
      (dual nil) (_ : id (dual nil) = id (dual nil))

Next tactic:
rfl
theorem dual_balanceL (l : Ordnode α) (x : α) (r : Ordnode α) :
    dual (balanceL l x r) = balanceR (dual r) x (dual l) := by
  unfold balanceL balanceR
  cases' r with rs rl rx rr
  · cases' l with ls ll lx lr; · rfl
    cases' ll with lls lll llx llr <;> cases' lr with lrs lrl lrx lrr <;> dsimp only [dual, id] <;>
      try rfl
    split_ifs with h <;> repeat simp [h, add_comm]
  · cases' l with ls ll lx lr; · rfl
    dsimp only [dual, id]
    split_ifs; swap; · simp [add_comm]
    cases' ll with lls lll llx llr <;> cases' lr with lrs lrl lrx lrr <;> 

Proof state:
case pos.nil.node
α : Type u_1
x : α
rs : ℕ
rl : Ordnode α
rx : α
rr : Ordnode α
ls : ℕ
lx : α
h✝ : ls > delta * rs
lrs : ℕ
lrl : Ordnode α
lrx : α
lrr : Ordnode α
⊢ dual
      (rec (motive := fun t => nil = t → Ordnode α) (fun h => nil)
        (fun size l x_1 r l_ih r_ih h =>
          rec (motive := fun t => node lrs lrl lrx lrr = t → Ordnode α) (fun h => nil)
            (fun size_1 l x_2 r l_ih r_ih h =>
              if size_1 < ratio * size then
                node (ls + rs + 1) nil lx (node (rs + size_1 + 1) (node lrs lrl lrx lrr) x (node rs rl rx rr))
              else
                node (ls + rs + 1) (node (size + Ordnode.size l + 1) nil lx l) x_2
                  (node (Ordnode.size r + rs + 1) r x (node rs rl rx rr)))
            (node lrs lrl lrx lrr) (_ : id (node lrs lrl lrx lrr) = id (node lrs lrl lrx lrr)))
        nil (_ : id nil = id nil)) =
    rec (motive := fun t => dual nil = t → Ordnode α) (fun h => nil)
      (fun size l x_1 r l_ih r_ih h =>
        rec (motive := fun t => dual (node lrs lrl lrx lrr) = t → Ordnode α) (fun h => nil)
          (fun size_1 l x_2 r l_ih r_ih h =>
            if size_1 < ratio * size then
              node (rs + ls + 1)
                (node (rs + size_1 + 1) (node rs (dual rr) rx (dual rl)) x (dual (node lrs lrl lrx lrr))) lx (dual nil)
            else
              node (rs + ls + 1) (node (rs + Ordnode.size l + 1) (node rs (dual rr) rx (dual rl)) x l) x_2
                (node (Ordnode.size r + size + 1) r lx (dual nil)))
          (dual (node lrs lrl lrx lrr)) (_ : id (dual (node lrs lrl lrx lrr)) = id (dual (node lrs lrl lrx lrr))))
      (dual nil) (_ : id (dual nil) = id (dual nil))

Next tactic:
try rfl
theorem dual_balanceL (l : Ordnode α) (x : α) (r : Ordnode α) :
    dual (balanceL l x r) = balanceR (dual r) x (dual l) := by
  unfold balanceL balanceR
  cases' r with rs rl rx rr
  · cases' l with ls ll lx lr; · rfl
    cases' ll with lls lll llx llr <;> cases' lr with lrs lrl lrx lrr <;> dsimp only [dual, id] <;>
      try rfl
    split_ifs with h <;> repeat simp [h, add_comm]
  · cases' l with ls ll lx lr; · rfl
    dsimp only [dual, id]
    split_ifs; swap; · simp [add_comm]
    cases' ll with lls lll llx llr <;> cases' lr with lrs lrl lrx lrr <;> try 

Proof state:
case pos.nil.node
α : Type u_1
x : α
rs : ℕ
rl : Ordnode α
rx : α
rr : Ordnode α
ls : ℕ
lx : α
h✝ : ls > delta * rs
lrs : ℕ
lrl : Ordnode α
lrx : α
lrr : Ordnode α
⊢ dual
      (rec (motive := fun t => nil = t → Ordnode α) (fun h => nil)
        (fun size l x_1 r l_ih r_ih h =>
          rec (motive := fun t => node lrs lrl lrx lrr = t → Ordnode α) (fun h => nil)
            (fun size_1 l x_2 r l_ih r_ih h =>
              if size_1 < ratio * size then
                node (ls + rs + 1) nil lx (node (rs + size_1 + 1) (node lrs lrl lrx lrr) x (node rs rl rx rr))
              else
                node (ls + rs + 1) (node (size + Ordnode.size l + 1) nil lx l) x_2
                  (node (Ordnode.size r + rs + 1) r x (node rs rl rx rr)))
            (node lrs lrl lrx lrr) (_ : id (node lrs lrl lrx lrr) = id (node lrs lrl lrx lrr)))
        nil (_ : id nil = id nil)) =
    rec (motive := fun t => dual nil = t → Ordnode α) (fun h => nil)
      (fun size l x_1 r l_ih r_ih h =>
        rec (motive := fun t => dual (node lrs lrl lrx lrr) = t → Ordnode α) (fun h => nil)
          (fun size_1 l x_2 r l_ih r_ih h =>
            if size_1 < ratio * size then
              node (rs + ls + 1)
                (node (rs + size_1 + 1) (node rs (dual rr) rx (dual rl)) x (dual (node lrs lrl lrx lrr))) lx (dual nil)
            else
              node (rs + ls + 1) (node (rs + Ordnode.size l + 1) (node rs (dual rr) rx (dual rl)) x l) x_2
                (node (Ordnode.size r + size + 1) r lx (dual nil)))
          (dual (node lrs lrl lrx lrr)) (_ : id (dual (node lrs lrl lrx lrr)) = id (dual (node lrs lrl lrx lrr))))
      (dual nil) (_ : id (dual nil) = id (dual nil))

Next tactic:
rfl
theorem dual_balanceL (l : Ordnode α) (x : α) (r : Ordnode α) :
    dual (balanceL l x r) = balanceR (dual r) x (dual l) := by
  unfold balanceL balanceR
  cases' r with rs rl rx rr
  · cases' l with ls ll lx lr; · rfl
    cases' ll with lls lll llx llr <;> cases' lr with lrs lrl lrx lrr <;> dsimp only [dual, id] <;>
      try rfl
    split_ifs with h <;> repeat simp [h, add_comm]
  · cases' l with ls ll lx lr; · rfl
    dsimp only [dual, id]
    split_ifs; swap; · simp [add_comm]
    cases' ll with lls lll llx llr <;> cases' lr with lrs lrl lrx lrr <;> 

Proof state:
case pos.node.nil
α : Type u_1
x : α
rs : ℕ
rl : Ordnode α
rx : α
rr : Ordnode α
ls : ℕ
lx : α
h✝ : ls > delta * rs
lls : ℕ
lll : Ordnode α
llx : α
llr : Ordnode α
⊢ dual
      (rec (motive := fun t => node lls lll llx llr = t → Ordnode α) (fun h => nil)
        (fun size l x_1 r l_ih r_ih h =>
          rec (motive := fun t => nil = t → Ordnode α) (fun h => nil)
            (fun size_1 l x_2 r l_ih r_ih h =>
              if size_1 < ratio * size then
                node (ls + rs + 1) (node lls lll llx llr) lx (node (rs + size_1 + 1) nil x (node rs rl rx rr))
              else
                node (ls + rs + 1) (node (size + Ordnode.size l + 1) (node lls lll llx llr) lx l) x_2
                  (node (Ordnode.size r + rs + 1) r x (node rs rl rx rr)))
            nil (_ : id nil = id nil))
        (node lls lll llx llr) (_ : id (node lls lll llx llr) = id (node lls lll llx llr))) =
    rec (motive := fun t => dual (node lls lll llx llr) = t → Ordnode α) (fun h => nil)
      (fun size l x_1 r l_ih r_ih h =>
        rec (motive := fun t => dual nil = t → Ordnode α) (fun h => nil)
          (fun size_1 l x_2 r l_ih r_ih h =>
            if size_1 < ratio * size then
              node (rs + ls + 1) (node (rs + size_1 + 1) (node rs (dual rr) rx (dual rl)) x (dual nil)) lx
                (dual (node lls lll llx llr))
            else
              node (rs + ls + 1) (node (rs + Ordnode.size l + 1) (node rs (dual rr) rx (dual rl)) x l) x_2
                (node (Ordnode.size r + size + 1) r lx (dual (node lls lll llx llr))))
          (dual nil) (_ : id (dual nil) = id (dual nil)))
      (dual (node lls lll llx llr)) (_ : id (dual (node lls lll llx llr)) = id (dual (node lls lll llx llr)))

Next tactic:
try rfl
theorem dual_balanceL (l : Ordnode α) (x : α) (r : Ordnode α) :
    dual (balanceL l x r) = balanceR (dual r) x (dual l) := by
  unfold balanceL balanceR
  cases' r with rs rl rx rr
  · cases' l with ls ll lx lr; · rfl
    cases' ll with lls lll llx llr <;> cases' lr with lrs lrl lrx lrr <;> dsimp only [dual, id] <;>
      try rfl
    split_ifs with h <;> repeat simp [h, add_comm]
  · cases' l with ls ll lx lr; · rfl
    dsimp only [dual, id]
    split_ifs; swap; · simp [add_comm]
    cases' ll with lls lll llx llr <;> cases' lr with lrs lrl lrx lrr <;> try 

Proof state:
case pos.node.nil
α : Type u_1
x : α
rs : ℕ
rl : Ordnode α
rx : α
rr : Ordnode α
ls : ℕ
lx : α
h✝ : ls > delta * rs
lls : ℕ
lll : Ordnode α
llx : α
llr : Ordnode α
⊢ dual
      (rec (motive := fun t => node lls lll llx llr = t → Ordnode α) (fun h => nil)
        (fun size l x_1 r l_ih r_ih h =>
          rec (motive := fun t => nil = t → Ordnode α) (fun h => nil)
            (fun size_1 l x_2 r l_ih r_ih h =>
              if size_1 < ratio * size then
                node (ls + rs + 1) (node lls lll llx llr) lx (node (rs + size_1 + 1) nil x (node rs rl rx rr))
              else
                node (ls + rs + 1) (node (size + Ordnode.size l + 1) (node lls lll llx llr) lx l) x_2
                  (node (Ordnode.size r + rs + 1) r x (node rs rl rx rr)))
            nil (_ : id nil = id nil))
        (node lls lll llx llr) (_ : id (node lls lll llx llr) = id (node lls lll llx llr))) =
    rec (motive := fun t => dual (node lls lll llx llr) = t → Ordnode α) (fun h => nil)
      (fun size l x_1 r l_ih r_ih h =>
        rec (motive := fun t => dual nil = t → Ordnode α) (fun h => nil)
          (fun size_1 l x_2 r l_ih r_ih h =>
            if size_1 < ratio * size then
              node (rs + ls + 1) (node (rs + size_1 + 1) (node rs (dual rr) rx (dual rl)) x (dual nil)) lx
                (dual (node lls lll llx llr))
            else
              node (rs + ls + 1) (node (rs + Ordnode.size l + 1) (node rs (dual rr) rx (dual rl)) x l) x_2
                (node (Ordnode.size r + size + 1) r lx (dual (node lls lll llx llr))))
          (dual nil) (_ : id (dual nil) = id (dual nil)))
      (dual (node lls lll llx llr)) (_ : id (dual (node lls lll llx llr)) = id (dual (node lls lll llx llr)))

Next tactic:
rfl
theorem dual_balanceL (l : Ordnode α) (x : α) (r : Ordnode α) :
    dual (balanceL l x r) = balanceR (dual r) x (dual l) := by
  unfold balanceL balanceR
  cases' r with rs rl rx rr
  · cases' l with ls ll lx lr; · rfl
    cases' ll with lls lll llx llr <;> cases' lr with lrs lrl lrx lrr <;> dsimp only [dual, id] <;>
      try rfl
    split_ifs with h <;> repeat simp [h, add_comm]
  · cases' l with ls ll lx lr; · rfl
    dsimp only [dual, id]
    split_ifs; swap; · simp [add_comm]
    cases' ll with lls lll llx llr <;> cases' lr with lrs lrl lrx lrr <;> 

Proof state:
case pos.node.node
α : Type u_1
x : α
rs : ℕ
rl : Ordnode α
rx : α
rr : Ordnode α
ls : ℕ
lx : α
h✝ : ls > delta * rs
lls : ℕ
lll : Ordnode α
llx : α
llr : Ordnode α
lrs : ℕ
lrl : Ordnode α
lrx : α
lrr : Ordnode α
⊢ dual
      (rec (motive := fun t => node lls lll llx llr = t → Ordnode α) (fun h => nil)
        (fun size l x_1 r l_ih r_ih h =>
          rec (motive := fun t => node lrs lrl lrx lrr = t → Ordnode α) (fun h => nil)
            (fun size_1 l x_2 r l_ih r_ih h =>
              if size_1 < ratio * size then
                node (ls + rs + 1) (node lls lll llx llr) lx
                  (node (rs + size_1 + 1) (node lrs lrl lrx lrr) x (node rs rl rx rr))
              else
                node (ls + rs + 1) (node (size + Ordnode.size l + 1) (node lls lll llx llr) lx l) x_2
                  (node (Ordnode.size r + rs + 1) r x (node rs rl rx rr)))
            (node lrs lrl lrx lrr) (_ : id (node lrs lrl lrx lrr) = id (node lrs lrl lrx lrr)))
        (node lls lll llx llr) (_ : id (node lls lll llx llr) = id (node lls lll llx llr))) =
    rec (motive := fun t => dual (node lls lll llx llr) = t → Ordnode α) (fun h => nil)
      (fun size l x_1 r l_ih r_ih h =>
        rec (motive := fun t => dual (node lrs lrl lrx lrr) = t → Ordnode α) (fun h => nil)
          (fun size_1 l x_2 r l_ih r_ih h =>
            if size_1 < ratio * size then
              node (rs + ls + 1)
                (node (rs + size_1 + 1) (node rs (dual rr) rx (dual rl)) x (dual (node lrs lrl lrx lrr))) lx
                (dual (node lls lll llx llr))
            else
              node (rs + ls + 1) (node (rs + Ordnode.size l + 1) (node rs (dual rr) rx (dual rl)) x l) x_2
                (node (Ordnode.size r + size + 1) r lx (dual (node lls lll llx llr))))
          (dual (node lrs lrl lrx lrr)) (_ : id (dual (node lrs lrl lrx lrr)) = id (dual (node lrs lrl lrx lrr))))
      (dual (node lls lll llx llr)) (_ : id (dual (node lls lll llx llr)) = id (dual (node lls lll llx llr)))

Next tactic:
try rfl