case refl
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
hp : Path.Balanced c₀ n₀ path black 0
⊢ ∃ c n, Balanced nil c n ∧ Path.Balanced c₀ n₀ path c n
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
hp : Path.Balanced c₀ n₀ path black 0
e : zoom cut nil path = (t', path')
⊢ ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
cases e
no goals
case refl
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
hp : Path.Balanced c₀ n₀ path black 0
⊢ ∃ c n, Balanced nil c n ∧ Path.Balanced c₀ n₀ path c n
exact ⟨_, _, .nil, hp⟩
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ n : Nat
x✝ y✝ : RBNode α✝
v✝ : α✝
ha : Balanced x✝ black n
hb : Balanced y✝ black n
hp : Path.Balanced c₀ n₀ path red n
⊢ (match cut v✝ with
      | Ordering.lt => zoom cut x✝ (left red path v✝ y✝)
      | Ordering.gt => zoom cut y✝ (right red x✝ v✝ path)
      | Ordering.eq => (node red x✝ v✝ y✝, path)) =
      (t', path') →
    ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ n : Nat
x✝ y✝ : RBNode α✝
v✝ : α✝
ha : Balanced x✝ black n
hb : Balanced y✝ black n
hp : Path.Balanced c₀ n₀ path red n
⊢ zoom cut (node red x✝ v✝ y✝) path = (t', path') → ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
unfold zoom
case h_1
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ n : Nat
x✝¹ y✝ : RBNode α✝
v✝ : α✝
ha : Balanced x✝¹ black n
hb : Balanced y✝ black n
hp : Path.Balanced c₀ n₀ path red n
x✝ : Ordering
heq✝ : cut v✝ = Ordering.lt
⊢ zoom cut x✝¹ (left red path v✝ y✝) = (t', path') → ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n

case h_2
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ n : Nat
x✝¹ y✝ : RBNode α✝
v✝ : α✝
ha : Balanced x✝¹ black n
hb : Balanced y✝ black n
hp : Path.Balanced c₀ n₀ path red n
x✝ : Ordering
heq✝ : cut v✝ = Ordering.gt
⊢ zoom cut y✝ (right red x✝¹ v✝ path) = (t', path') → ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n

case h_3
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ n : Nat
x✝¹ y✝ : RBNode α✝
v✝ : α✝
ha : Balanced x✝¹ black n
hb : Balanced y✝ black n
hp : Path.Balanced c₀ n₀ path red n
x✝ : Ordering
heq✝ : cut v✝ = Ordering.eq
⊢ (node red x✝¹ v✝ y✝, path) = (t', path') → ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ n : Nat
x✝ y✝ : RBNode α✝
v✝ : α✝
ha : Balanced x✝ black n
hb : Balanced y✝ black n
hp : Path.Balanced c₀ n₀ path red n
⊢ (match cut v✝ with
      | Ordering.lt => zoom cut x✝ (left red path v✝ y✝)
      | Ordering.gt => zoom cut y✝ (right red x✝ v✝ path)
      | Ordering.eq => (node red x✝ v✝ y✝, path)) =
      (t', path') →
    ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
split
no goals
case h_1
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ n : Nat
x✝¹ y✝ : RBNode α✝
v✝ : α✝
ha : Balanced x✝¹ black n
hb : Balanced y✝ black n
hp : Path.Balanced c₀ n₀ path red n
x✝ : Ordering
heq✝ : cut v✝ = Ordering.lt
⊢ zoom cut x✝¹ (left red path v✝ y✝) = (t', path') → ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
exact ha.zoom (.redL hb hp)
no goals
case h_2
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ n : Nat
x✝¹ y✝ : RBNode α✝
v✝ : α✝
ha : Balanced x✝¹ black n
hb : Balanced y✝ black n
hp : Path.Balanced c₀ n₀ path red n
x✝ : Ordering
heq✝ : cut v✝ = Ordering.gt
⊢ zoom cut y✝ (right red x✝¹ v✝ path) = (t', path') → ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
exact hb.zoom (.redR ha hp)
case h_3
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ n : Nat
x✝¹ y✝ : RBNode α✝
v✝ : α✝
ha : Balanced x✝¹ black n
hb : Balanced y✝ black n
hp : Path.Balanced c₀ n₀ path red n
x✝ : Ordering
heq✝ : cut v✝ = Ordering.eq
e : (node red x✝¹ v✝ y✝, path) = (t', path')
⊢ ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
case h_3
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ n : Nat
x✝¹ y✝ : RBNode α✝
v✝ : α✝
ha : Balanced x✝¹ black n
hb : Balanced y✝ black n
hp : Path.Balanced c₀ n₀ path red n
x✝ : Ordering
heq✝ : cut v✝ = Ordering.eq
⊢ (node red x✝¹ v✝ y✝, path) = (t', path') → ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
intro e
case h_3.refl
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ n : Nat
x✝¹ y✝ : RBNode α✝
v✝ : α✝
ha : Balanced x✝¹ black n
hb : Balanced y✝ black n
hp : Path.Balanced c₀ n₀ path red n
x✝ : Ordering
heq✝ : cut v✝ = Ordering.eq
⊢ ∃ c n, Balanced (node red x✝¹ v✝ y✝) c n ∧ Path.Balanced c₀ n₀ path c n
case h_3
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ n : Nat
x✝¹ y✝ : RBNode α✝
v✝ : α✝
ha : Balanced x✝¹ black n
hb : Balanced y✝ black n
hp : Path.Balanced c₀ n₀ path red n
x✝ : Ordering
heq✝ : cut v✝ = Ordering.eq
e : (node red x✝¹ v✝ y✝, path) = (t', path')
⊢ ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
cases e
no goals
case h_3.refl
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ n : Nat
x✝¹ y✝ : RBNode α✝
v✝ : α✝
ha : Balanced x✝¹ black n
hb : Balanced y✝ black n
hp : Path.Balanced c₀ n₀ path red n
x✝ : Ordering
heq✝ : cut v✝ = Ordering.eq
⊢ ∃ c n, Balanced (node red x✝¹ v✝ y✝) c n ∧ Path.Balanced c₀ n₀ path c n
exact ⟨_, _, .red ha hb, hp⟩
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
x✝ : RBNode α✝
c₁✝ : RBColor
n✝ : Nat
y✝ : RBNode α✝
c₂✝ : RBColor
v✝ : α✝
ha : Balanced x✝ c₁✝ n✝
hb : Balanced y✝ c₂✝ n✝
hp : Path.Balanced c₀ n₀ path black (n✝ + 1)
⊢ (match cut v✝ with
      | Ordering.lt => zoom cut x✝ (left black path v✝ y✝)
      | Ordering.gt => zoom cut y✝ (right black x✝ v✝ path)
      | Ordering.eq => (node black x✝ v✝ y✝, path)) =
      (t', path') →
    ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
x✝ : RBNode α✝
c₁✝ : RBColor
n✝ : Nat
y✝ : RBNode α✝
c₂✝ : RBColor
v✝ : α✝
ha : Balanced x✝ c₁✝ n✝
hb : Balanced y✝ c₂✝ n✝
hp : Path.Balanced c₀ n₀ path black (n✝ + 1)
⊢ zoom cut (node black x✝ v✝ y✝) path = (t', path') → ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
unfold zoom
case h_1
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
x✝¹ : RBNode α✝
c₁✝ : RBColor
n✝ : Nat
y✝ : RBNode α✝
c₂✝ : RBColor
v✝ : α✝
ha : Balanced x✝¹ c₁✝ n✝
hb : Balanced y✝ c₂✝ n✝
hp : Path.Balanced c₀ n₀ path black (n✝ + 1)
x✝ : Ordering
heq✝ : cut v✝ = Ordering.lt
⊢ zoom cut x✝¹ (left black path v✝ y✝) = (t', path') → ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n

case h_2
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
x✝¹ : RBNode α✝
c₁✝ : RBColor
n✝ : Nat
y✝ : RBNode α✝
c₂✝ : RBColor
v✝ : α✝
ha : Balanced x✝¹ c₁✝ n✝
hb : Balanced y✝ c₂✝ n✝
hp : Path.Balanced c₀ n₀ path black (n✝ + 1)
x✝ : Ordering
heq✝ : cut v✝ = Ordering.gt
⊢ zoom cut y✝ (right black x✝¹ v✝ path) = (t', path') → ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n

case h_3
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
x✝¹ : RBNode α✝
c₁✝ : RBColor
n✝ : Nat
y✝ : RBNode α✝
c₂✝ : RBColor
v✝ : α✝
ha : Balanced x✝¹ c₁✝ n✝
hb : Balanced y✝ c₂✝ n✝
hp : Path.Balanced c₀ n₀ path black (n✝ + 1)
x✝ : Ordering
heq✝ : cut v✝ = Ordering.eq
⊢ (node black x✝¹ v✝ y✝, path) = (t', path') → ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
x✝ : RBNode α✝
c₁✝ : RBColor
n✝ : Nat
y✝ : RBNode α✝
c₂✝ : RBColor
v✝ : α✝
ha : Balanced x✝ c₁✝ n✝
hb : Balanced y✝ c₂✝ n✝
hp : Path.Balanced c₀ n₀ path black (n✝ + 1)
⊢ (match cut v✝ with
      | Ordering.lt => zoom cut x✝ (left black path v✝ y✝)
      | Ordering.gt => zoom cut y✝ (right black x✝ v✝ path)
      | Ordering.eq => (node black x✝ v✝ y✝, path)) =
      (t', path') →
    ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
split
no goals
case h_1
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
x✝¹ : RBNode α✝
c₁✝ : RBColor
n✝ : Nat
y✝ : RBNode α✝
c₂✝ : RBColor
v✝ : α✝
ha : Balanced x✝¹ c₁✝ n✝
hb : Balanced y✝ c₂✝ n✝
hp : Path.Balanced c₀ n₀ path black (n✝ + 1)
x✝ : Ordering
heq✝ : cut v✝ = Ordering.lt
⊢ zoom cut x✝¹ (left black path v✝ y✝) = (t', path') → ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
exact ha.zoom (.blackL hb hp)
no goals
case h_2
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
x✝¹ : RBNode α✝
c₁✝ : RBColor
n✝ : Nat
y✝ : RBNode α✝
c₂✝ : RBColor
v✝ : α✝
ha : Balanced x✝¹ c₁✝ n✝
hb : Balanced y✝ c₂✝ n✝
hp : Path.Balanced c₀ n₀ path black (n✝ + 1)
x✝ : Ordering
heq✝ : cut v✝ = Ordering.gt
⊢ zoom cut y✝ (right black x✝¹ v✝ path) = (t', path') → ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
exact hb.zoom (.blackR ha hp)
case h_3
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
x✝¹ : RBNode α✝
c₁✝ : RBColor
n✝ : Nat
y✝ : RBNode α✝
c₂✝ : RBColor
v✝ : α✝
ha : Balanced x✝¹ c₁✝ n✝
hb : Balanced y✝ c₂✝ n✝
hp : Path.Balanced c₀ n₀ path black (n✝ + 1)
x✝ : Ordering
heq✝ : cut v✝ = Ordering.eq
e : (node black x✝¹ v✝ y✝, path) = (t', path')
⊢ ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
case h_3
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
x✝¹ : RBNode α✝
c₁✝ : RBColor
n✝ : Nat
y✝ : RBNode α✝
c₂✝ : RBColor
v✝ : α✝
ha : Balanced x✝¹ c₁✝ n✝
hb : Balanced y✝ c₂✝ n✝
hp : Path.Balanced c₀ n₀ path black (n✝ + 1)
x✝ : Ordering
heq✝ : cut v✝ = Ordering.eq
⊢ (node black x✝¹ v✝ y✝, path) = (t', path') → ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
intro e
case h_3.refl
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
x✝¹ : RBNode α✝
c₁✝ : RBColor
n✝ : Nat
y✝ : RBNode α✝
c₂✝ : RBColor
v✝ : α✝
ha : Balanced x✝¹ c₁✝ n✝
hb : Balanced y✝ c₂✝ n✝
hp : Path.Balanced c₀ n₀ path black (n✝ + 1)
x✝ : Ordering
heq✝ : cut v✝ = Ordering.eq
⊢ ∃ c n, Balanced (node black x✝¹ v✝ y✝) c n ∧ Path.Balanced c₀ n₀ path c n
case h_3
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
t' : RBNode α✝
path' : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
x✝¹ : RBNode α✝
c₁✝ : RBColor
n✝ : Nat
y✝ : RBNode α✝
c₂✝ : RBColor
v✝ : α✝
ha : Balanced x✝¹ c₁✝ n✝
hb : Balanced y✝ c₂✝ n✝
hp : Path.Balanced c₀ n₀ path black (n✝ + 1)
x✝ : Ordering
heq✝ : cut v✝ = Ordering.eq
e : (node black x✝¹ v✝ y✝, path) = (t', path')
⊢ ∃ c n, Balanced t' c n ∧ Path.Balanced c₀ n₀ path' c n
cases e
no goals
case h_3.refl
α✝ : Type u_1
cut : α✝ → Ordering
t : RBNode α✝
path : Path α✝
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
x✝¹ : RBNode α✝
c₁✝ : RBColor
n✝ : Nat
y✝ : RBNode α✝
c₂✝ : RBColor
v✝ : α✝
ha : Balanced x✝¹ c₁✝ n✝
hb : Balanced y✝ c₂✝ n✝
hp : Path.Balanced c₀ n₀ path black (n✝ + 1)
x✝ : Ordering
heq✝ : cut v✝ = Ordering.eq
⊢ ∃ c n, Balanced (node black x✝¹ v✝ y✝) c n ∧ Path.Balanced c₀ n₀ path c n
exact ⟨_, _, .black ha hb, hp⟩