no goals
α : Type u_1
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
c' : RBColor
t : RBNode α
path : Path α
hp : Path.Balanced c₀ n₀ path c n
ht : DelProp c' t n
hc : c = black → c' ≠ red
⊢ ∃ n, Balanced (del path t c') black n
induction hp generalizing t c' with
| root => match c', ht with
  | red, ⟨_, h⟩ | black, ⟨_, _, h⟩ => exact h.setBlack
| @redL _ n _ _ hb hp ih => match c', n, ht with
  | red, _, _ => cases hc rfl rfl
  | black, _, ⟨_, rfl, ha⟩ => exact ih ((hb.balLeft ha).of_false (fun.)) (fun.)
| @redR _ n _ _ ha hp ih => match c', n, ht with
  | red, _, _ => cases hc rfl rfl
  | black, _, ⟨_, rfl, hb⟩ => exact ih ((ha.balRight hb).of_false (fun.)) (fun.)
| @blackL _ _ n _ _ _ hb hp ih => match c', n, ht with
  | red, _, ⟨_, ha⟩ => exact ih ⟨_, rfl, .redred ⟨⟩ ha hb⟩ (fun.)
  | black, _, ⟨_, rfl, ha⟩ => exact ih ⟨_, rfl, (hb.balLeft ha).imp fun _ => ⟨⟩⟩ (fun.)
| @blackR _ _ n _ _ _ ha hp ih =>  match c', n, ht with
  | red, _, ⟨_, hb⟩ => exact ih ⟨_, rfl, .redred ⟨⟩ ha hb⟩ (fun.)
  | black, _, ⟨_, rfl, hb⟩ => exact ih ⟨_, rfl, (ha.balRight hb).imp fun _ => ⟨⟩⟩ (fun.)
no goals
case root
α : Type u_1
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
path : Path α
c' : RBColor
t : RBNode α
ht : DelProp c' t n₀
hc : c₀ = black → c' ≠ red
⊢ ∃ n, Balanced (del root t c') black n
match c', ht with
| red, ⟨_, h⟩ | black, ⟨_, _, h⟩ => exact h.setBlack
no goals
α : Type u_1
c₀ : RBColor
n₀ : Nat
c : RBColor
n : Nat
path : Path α
c' : RBColor
t : RBNode α
ht : DelProp c' t n₀
w✝ : Nat
left✝ : n₀ = w✝ + 1
h : RedRed True t w✝
hc : c₀ = black → black ≠ red
⊢ ∃ n, Balanced (del root t black) black n
exact h.setBlack
no goals
case redL
α : Type u_1
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ : Nat
path : Path α
y✝ : RBNode α
n : Nat
parent✝ : Path α
v✝ : α
hb : Balanced y✝ black n
hp : Path.Balanced c₀ n₀ parent✝ red n
ih :
  ∀ {c' : RBColor} {t : RBNode α}, DelProp c' t n → (red = black → c' ≠ red) → ∃ n, Balanced (del parent✝ t c') black n
c' : RBColor
t : RBNode α
ht : DelProp c' t n
hc : black = black → c' ≠ red
⊢ ∃ n, Balanced (del (left red parent✝ v✝ y✝) t c') black n
match c', n, ht with
| red, _, _ => cases hc rfl rfl
| black, _, ⟨_, rfl, ha⟩ => exact ih ((hb.balLeft ha).of_false (fun.)) (fun.)
no goals
α : Type u_1
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ : Nat
path : Path α
y✝ : RBNode α
n : Nat
parent✝ : Path α
v✝ : α
c' : RBColor
t : RBNode α
ht : DelProp c' t n
x✝¹ : Nat
x✝ : DelProp red t x✝¹
hb : Balanced y✝ black x✝¹
hp : Path.Balanced c₀ n₀ parent✝ red x✝¹
ih :
  ∀ {c' : RBColor} {t : RBNode α},
    DelProp c' t x✝¹ → (red = black → c' ≠ red) → ∃ n, Balanced (del parent✝ t c') black n
hc : black = black → red ≠ red
⊢ ∃ n, Balanced (del (left red parent✝ v✝ y✝) t red) black n
cases hc rfl rfl
no goals
α : Type u_1
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ : Nat
path : Path α
y✝ : RBNode α
n : Nat
parent✝ : Path α
v✝ : α
c' : RBColor
t : RBNode α
ht : DelProp c' t n
w✝ : Nat
ha : RedRed True t w✝
hb : Balanced y✝ black (w✝ + 1)
hp : Path.Balanced c₀ n₀ parent✝ red (w✝ + 1)
ih :
  ∀ {c' : RBColor} {t : RBNode α},
    DelProp c' t (w✝ + 1) → (red = black → c' ≠ red) → ∃ n, Balanced (del parent✝ t c') black n
hc : black = black → black ≠ red
⊢ ∃ n, Balanced (del (left red parent✝ v✝ y✝) t black) black n
exact ih ((hb.balLeft ha).of_false (fun.)) (fun.)
no goals
case redR
α : Type u_1
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ : Nat
path : Path α
x✝ : RBNode α
n : Nat
v✝ : α
parent✝ : Path α
ha : Balanced x✝ black n
hp : Path.Balanced c₀ n₀ parent✝ red n
ih :
  ∀ {c' : RBColor} {t : RBNode α}, DelProp c' t n → (red = black → c' ≠ red) → ∃ n, Balanced (del parent✝ t c') black n
c' : RBColor
t : RBNode α
ht : DelProp c' t n
hc : black = black → c' ≠ red
⊢ ∃ n, Balanced (del (right red x✝ v✝ parent✝) t c') black n
match c', n, ht with
| red, _, _ => cases hc rfl rfl
| black, _, ⟨_, rfl, hb⟩ => exact ih ((ha.balRight hb).of_false (fun.)) (fun.)
no goals
α : Type u_1
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ : Nat
path : Path α
x✝² : RBNode α
n : Nat
v✝ : α
parent✝ : Path α
c' : RBColor
t : RBNode α
ht : DelProp c' t n
x✝¹ : Nat
x✝ : DelProp red t x✝¹
ha : Balanced x✝² black x✝¹
hp : Path.Balanced c₀ n₀ parent✝ red x✝¹
ih :
  ∀ {c' : RBColor} {t : RBNode α},
    DelProp c' t x✝¹ → (red = black → c' ≠ red) → ∃ n, Balanced (del parent✝ t c') black n
hc : black = black → red ≠ red
⊢ ∃ n, Balanced (del (right red x✝² v✝ parent✝) t red) black n
cases hc rfl rfl
no goals
α : Type u_1
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ : Nat
path : Path α
x✝ : RBNode α
n : Nat
v✝ : α
parent✝ : Path α
c' : RBColor
t : RBNode α
ht : DelProp c' t n
w✝ : Nat
hb : RedRed True t w✝
ha : Balanced x✝ black (w✝ + 1)
hp : Path.Balanced c₀ n₀ parent✝ red (w✝ + 1)
ih :
  ∀ {c' : RBColor} {t : RBNode α},
    DelProp c' t (w✝ + 1) → (red = black → c' ≠ red) → ∃ n, Balanced (del parent✝ t c') black n
hc : black = black → black ≠ red
⊢ ∃ n, Balanced (del (right red x✝ v✝ parent✝) t black) black n
exact ih ((ha.balRight hb).of_false (fun.)) (fun.)
no goals
case blackL
α : Type u_1
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ : Nat
path : Path α
y✝ : RBNode α
c₂✝ : RBColor
n : Nat
parent✝ : Path α
v✝ : α
c₁✝ : RBColor
hb : Balanced y✝ c₂✝ n
hp : Path.Balanced c₀ n₀ parent✝ black (n + 1)
ih :
  ∀ {c' : RBColor} {t : RBNode α},
    DelProp c' t (n + 1) → (black = black → c' ≠ red) → ∃ n, Balanced (del parent✝ t c') black n
c' : RBColor
t : RBNode α
ht : DelProp c' t n
hc : c₁✝ = black → c' ≠ red
⊢ ∃ n, Balanced (del (left black parent✝ v✝ y✝) t c') black n
match c', n, ht with
| red, _, ⟨_, ha⟩ => exact ih ⟨_, rfl, .redred ⟨⟩ ha hb⟩ (fun.)
| black, _, ⟨_, rfl, ha⟩ => exact ih ⟨_, rfl, (hb.balLeft ha).imp fun _ => ⟨⟩⟩ (fun.)
no goals
α : Type u_1
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ : Nat
path : Path α
y✝ : RBNode α
c₂✝ : RBColor
n : Nat
parent✝ : Path α
v✝ : α
c₁✝ c' : RBColor
t : RBNode α
ht : DelProp c' t n
x✝ : Nat
w✝ : RBColor
ha : Balanced t w✝ x✝
hb : Balanced y✝ c₂✝ x✝
hp : Path.Balanced c₀ n₀ parent✝ black (x✝ + 1)
ih :
  ∀ {c' : RBColor} {t : RBNode α},
    DelProp c' t (x✝ + 1) → (black = black → c' ≠ red) → ∃ n, Balanced (del parent✝ t c') black n
hc : c₁✝ = black → red ≠ red
⊢ ∃ n, Balanced (del (left black parent✝ v✝ y✝) t red) black n
exact ih ⟨_, rfl, .redred ⟨⟩ ha hb⟩ (fun.)
no goals
α : Type u_1
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ : Nat
path : Path α
y✝ : RBNode α
c₂✝ : RBColor
n : Nat
parent✝ : Path α
v✝ : α
c₁✝ c' : RBColor
t : RBNode α
ht : DelProp c' t n
w✝ : Nat
ha : RedRed True t w✝
hb : Balanced y✝ c₂✝ (w✝ + 1)
hp : Path.Balanced c₀ n₀ parent✝ black (w✝ + 1 + 1)
ih :
  ∀ {c' : RBColor} {t : RBNode α},
    DelProp c' t (w✝ + 1 + 1) → (black = black → c' ≠ red) → ∃ n, Balanced (del parent✝ t c') black n
hc : c₁✝ = black → black ≠ red
⊢ ∃ n, Balanced (del (left black parent✝ v✝ y✝) t black) black n
exact ih ⟨_, rfl, (hb.balLeft ha).imp fun _ => ⟨⟩⟩ (fun.)
no goals
case blackR
α : Type u_1
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ : Nat
path : Path α
x✝ : RBNode α
c₁✝ : RBColor
n : Nat
v✝ : α
parent✝ : Path α
c₂✝ : RBColor
ha : Balanced x✝ c₁✝ n
hp : Path.Balanced c₀ n₀ parent✝ black (n + 1)
ih :
  ∀ {c' : RBColor} {t : RBNode α},
    DelProp c' t (n + 1) → (black = black → c' ≠ red) → ∃ n, Balanced (del parent✝ t c') black n
c' : RBColor
t : RBNode α
ht : DelProp c' t n
hc : c₂✝ = black → c' ≠ red
⊢ ∃ n, Balanced (del (right black x✝ v✝ parent✝) t c') black n
match c', n, ht with
| red, _, ⟨_, hb⟩ => exact ih ⟨_, rfl, .redred ⟨⟩ ha hb⟩ (fun.)
| black, _, ⟨_, rfl, hb⟩ => exact ih ⟨_, rfl, (ha.balRight hb).imp fun _ => ⟨⟩⟩ (fun.)
no goals
α : Type u_1
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ : Nat
path : Path α
x✝¹ : RBNode α
c₁✝ : RBColor
n : Nat
v✝ : α
parent✝ : Path α
c₂✝ c' : RBColor
t : RBNode α
ht : DelProp c' t n
x✝ : Nat
w✝ : RBColor
hb : Balanced t w✝ x✝
ha : Balanced x✝¹ c₁✝ x✝
hp : Path.Balanced c₀ n₀ parent✝ black (x✝ + 1)
ih :
  ∀ {c' : RBColor} {t : RBNode α},
    DelProp c' t (x✝ + 1) → (black = black → c' ≠ red) → ∃ n, Balanced (del parent✝ t c') black n
hc : c₂✝ = black → red ≠ red
⊢ ∃ n, Balanced (del (right black x✝¹ v✝ parent✝) t red) black n
exact ih ⟨_, rfl, .redred ⟨⟩ ha hb⟩ (fun.)
no goals
α : Type u_1
c₀ : RBColor
n₀ : Nat
c : RBColor
n✝ : Nat
path : Path α
x✝ : RBNode α
c₁✝ : RBColor
n : Nat
v✝ : α
parent✝ : Path α
c₂✝ c' : RBColor
t : RBNode α
ht : DelProp c' t n
w✝ : Nat
hb : RedRed True t w✝
ha : Balanced x✝ c₁✝ (w✝ + 1)
hp : Path.Balanced c₀ n₀ parent✝ black (w✝ + 1 + 1)
ih :
  ∀ {c' : RBColor} {t : RBNode α},
    DelProp c' t (w✝ + 1 + 1) → (black = black → c' ≠ red) → ∃ n, Balanced (del parent✝ t c') black n
hc : c₂✝ = black → black ≠ red
⊢ ∃ n, Balanced (del (right black x✝ v✝ parent✝) t black) black n
exact ih ⟨_, rfl, (ha.balRight hb).imp fun _ => ⟨⟩⟩ (fun.)