Theorem: Ordnode.Valid'.map_aux
File: Mathlib/Data/Ordmap/Ordset.lean

tactic: simp [map]
state_before: case nil
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ nil a₂
⊢ Valid' (Option.map f a₁) (map f nil) (Option.map f a₂) ∧ size (map f nil) = size nil

tactic: apply valid'_nil
state_before: case nil
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ nil a₂
⊢ Valid' (Option.map f a₁) nil (Option.map f a₂)

tactic: cases a₁
state_before: case nil.h
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ nil a₂
⊢ Bounded nil (Option.map f a₁) (Option.map f a₂)

tactic: cases a₂
state_before: case nil.h.some
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
a₂ : WithTop α
val✝ : α
h : Valid' (some val✝) nil a₂
⊢ Bounded nil (Option.map f (some val✝)) (Option.map f a₂)

tactic: simp [Bounded]
state_before: case nil.h.some.some
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
val✝¹ val✝ : α
h : Valid' (some val✝¹) nil (some val✝)
⊢ Bounded nil (Option.map f (some val✝¹)) (Option.map f (some val✝))

tactic: exact f_strict_mono h.ord
state_before: case nil.h.some.some
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
val✝¹ val✝ : α
h : Valid' (some val✝¹) nil (some val✝)
⊢ f val✝¹ < f val✝

tactic: trivial
state_before: case nil.h.none
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
a₂ : WithTop α
h : Valid' none nil a₂
⊢ Bounded nil (Option.map f none) (Option.map f a₂)

tactic: trivial
state_before: case nil.h.some.none
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
val✝ : α
h : Valid' (some val✝) nil none
⊢ Bounded nil (Option.map f (some val✝)) (Option.map f none)

tactic: have t_ih_l' := t_ih_l h.left
state_before: case node
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
t_ih_l :
  ∀ {a₁ : WithBot α} {a₂ : WithTop α},
    Valid' a₁ l✝ a₂ → Valid' (Option.map f a₁) (map f l✝) (Option.map f a₂) ∧ size (map f l✝) = size l✝
t_ih_r :
  ∀ {a₁ : WithBot α} {a₂ : WithTop α},
    Valid' a₁ r✝ a₂ → Valid' (Option.map f a₁) (map f r✝) (Option.map f a₂) ∧ size (map f r✝) = size r✝
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
⊢ Valid' (Option.map f a₁) (map f (Ordnode.node size✝ l✝ x✝ r✝)) (Option.map f a₂) ∧
    size (map f (Ordnode.node size✝ l✝ x✝ r✝)) = size (Ordnode.node size✝ l✝ x✝ r✝)

tactic: have t_ih_r' := t_ih_r h.right
state_before: case node
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
t_ih_l :
  ∀ {a₁ : WithBot α} {a₂ : WithTop α},
    Valid' a₁ l✝ a₂ → Valid' (Option.map f a₁) (map f l✝) (Option.map f a₂) ∧ size (map f l✝) = size l✝
t_ih_r :
  ∀ {a₁ : WithBot α} {a₂ : WithTop α},
    Valid' a₁ r✝ a₂ → Valid' (Option.map f a₁) (map f r✝) (Option.map f a₂) ∧ size (map f r✝) = size r✝
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_ih_l' : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝) ∧ size (map f l✝) = size l✝
⊢ Valid' (Option.map f a₁) (map f (Ordnode.node size✝ l✝ x✝ r✝)) (Option.map f a₂) ∧
    size (map f (Ordnode.node size✝ l✝ x✝ r✝)) = size (Ordnode.node size✝ l✝ x✝ r✝)

tactic: clear t_ih_l t_ih_r
state_before: case node
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
t_ih_l :
  ∀ {a₁ : WithBot α} {a₂ : WithTop α},
    Valid' a₁ l✝ a₂ → Valid' (Option.map f a₁) (map f l✝) (Option.map f a₂) ∧ size (map f l✝) = size l✝
t_ih_r :
  ∀ {a₁ : WithBot α} {a₂ : WithTop α},
    Valid' a₁ r✝ a₂ → Valid' (Option.map f a₁) (map f r✝) (Option.map f a₂) ∧ size (map f r✝) = size r✝
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_ih_l' : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝) ∧ size (map f l✝) = size l✝
t_ih_r' : Valid' (Option.map f ↑x✝) (map f r✝) (Option.map f a₂) ∧ size (map f r✝) = size r✝
⊢ Valid' (Option.map f a₁) (map f (Ordnode.node size✝ l✝ x✝ r✝)) (Option.map f a₂) ∧
    size (map f (Ordnode.node size✝ l✝ x✝ r✝)) = size (Ordnode.node size✝ l✝ x✝ r✝)

tactic: cases' t_ih_l' with t_l_valid t_l_size
state_before: case node
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_ih_l' : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝) ∧ size (map f l✝) = size l✝
t_ih_r' : Valid' (Option.map f ↑x✝) (map f r✝) (Option.map f a₂) ∧ size (map f r✝) = size r✝
⊢ Valid' (Option.map f a₁) (map f (Ordnode.node size✝ l✝ x✝ r✝)) (Option.map f a₂) ∧
    size (map f (Ordnode.node size✝ l✝ x✝ r✝)) = size (Ordnode.node size✝ l✝ x✝ r✝)

tactic: cases' t_ih_r' with t_r_valid t_r_size
state_before: case node.intro
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_ih_r' : Valid' (Option.map f ↑x✝) (map f r✝) (Option.map f a₂) ∧ size (map f r✝) = size r✝
t_l_valid : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝)
t_l_size : size (map f l✝) = size l✝
⊢ Valid' (Option.map f a₁) (map f (Ordnode.node size✝ l✝ x✝ r✝)) (Option.map f a₂) ∧
    size (map f (Ordnode.node size✝ l✝ x✝ r✝)) = size (Ordnode.node size✝ l✝ x✝ r✝)

tactic: simp [map]
state_before: case node.intro.intro
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_l_valid : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝)
t_l_size : size (map f l✝) = size l✝
t_r_valid : Valid' (Option.map f ↑x✝) (map f r✝) (Option.map f a₂)
t_r_size : size (map f r✝) = size r✝
⊢ Valid' (Option.map f a₁) (map f (Ordnode.node size✝ l✝ x✝ r✝)) (Option.map f a₂) ∧
    size (map f (Ordnode.node size✝ l✝ x✝ r✝)) = size (Ordnode.node size✝ l✝ x✝ r✝)

tactic: constructor
state_before: case node.intro.intro
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_l_valid : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝)
t_l_size : size (map f l✝) = size l✝
t_r_valid : Valid' (Option.map f ↑x✝) (map f r✝) (Option.map f a₂)
t_r_size : size (map f r✝) = size r✝
⊢ Valid' (Option.map f a₁) (Ordnode.node size✝ (map f l✝) (f x✝) (map f r✝)) (Option.map f a₂)

tactic: exact And.intro t_l_valid.ord t_r_valid.ord
state_before: case node.intro.intro.ord
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_l_valid : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝)
t_l_size : size (map f l✝) = size l✝
t_r_valid : Valid' (Option.map f ↑x✝) (map f r✝) (Option.map f a₂)
t_r_size : size (map f r✝) = size r✝
⊢ Bounded (Ordnode.node size✝ (map f l✝) (f x✝) (map f r✝)) (Option.map f a₁) (Option.map f a₂)

tactic: constructor
state_before: case node.intro.intro.sz
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_l_valid : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝)
t_l_size : size (map f l✝) = size l✝
t_r_valid : Valid' (Option.map f ↑x✝) (map f r✝) (Option.map f a₂)
t_r_size : size (map f r✝) = size r✝
⊢ Sized (Ordnode.node size✝ (map f l✝) (f x✝) (map f r✝))

tactic: rw [t_l_size, t_r_size]
state_before: case node.intro.intro.sz.left
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_l_valid : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝)
t_l_size : size (map f l✝) = size l✝
t_r_valid : Valid' (Option.map f ↑x✝) (map f r✝) (Option.map f a₂)
t_r_size : size (map f r✝) = size r✝
⊢ size✝ = size (map f l✝) + size (map f r✝) + 1

tactic: exact h.sz.1
state_before: case node.intro.intro.sz.left
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_l_valid : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝)
t_l_size : size (map f l✝) = size l✝
t_r_valid : Valid' (Option.map f ↑x✝) (map f r✝) (Option.map f a₂)
t_r_size : size (map f r✝) = size r✝
⊢ size✝ = size l✝ + size r✝ + 1

tactic: constructor
state_before: case node.intro.intro.sz.right
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_l_valid : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝)
t_l_size : size (map f l✝) = size l✝
t_r_valid : Valid' (Option.map f ↑x✝) (map f r✝) (Option.map f a₂)
t_r_size : size (map f r✝) = size r✝
⊢ Sized (map f l✝) ∧ Sized (map f r✝)

tactic: exact t_l_valid.sz
state_before: case node.intro.intro.sz.right.left
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_l_valid : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝)
t_l_size : size (map f l✝) = size l✝
t_r_valid : Valid' (Option.map f ↑x✝) (map f r✝) (Option.map f a₂)
t_r_size : size (map f r✝) = size r✝
⊢ Sized (map f l✝)

tactic: exact t_r_valid.sz
state_before: case node.intro.intro.sz.right.right
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_l_valid : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝)
t_l_size : size (map f l✝) = size l✝
t_r_valid : Valid' (Option.map f ↑x✝) (map f r✝) (Option.map f a₂)
t_r_size : size (map f r✝) = size r✝
⊢ Sized (map f r✝)

tactic: constructor
state_before: case node.intro.intro.bal
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_l_valid : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝)
t_l_size : size (map f l✝) = size l✝
t_r_valid : Valid' (Option.map f ↑x✝) (map f r✝) (Option.map f a₂)
t_r_size : size (map f r✝) = size r✝
⊢ Balanced (Ordnode.node size✝ (map f l✝) (f x✝) (map f r✝))

tactic: rw [t_l_size, t_r_size]
state_before: case node.intro.intro.bal.left
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_l_valid : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝)
t_l_size : size (map f l✝) = size l✝
t_r_valid : Valid' (Option.map f ↑x✝) (map f r✝) (Option.map f a₂)
t_r_size : size (map f r✝) = size r✝
⊢ BalancedSz (size (map f l✝)) (size (map f r✝))

tactic: exact h.bal.1
state_before: case node.intro.intro.bal.left
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_l_valid : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝)
t_l_size : size (map f l✝) = size l✝
t_r_valid : Valid' (Option.map f ↑x✝) (map f r✝) (Option.map f a₂)
t_r_size : size (map f r✝) = size r✝
⊢ BalancedSz (size l✝) (size r✝)

tactic: constructor
state_before: case node.intro.intro.bal.right
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_l_valid : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝)
t_l_size : size (map f l✝) = size l✝
t_r_valid : Valid' (Option.map f ↑x✝) (map f r✝) (Option.map f a₂)
t_r_size : size (map f r✝) = size r✝
⊢ Balanced (map f l✝) ∧ Balanced (map f r✝)

tactic: exact t_l_valid.bal
state_before: case node.intro.intro.bal.right.left
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_l_valid : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝)
t_l_size : size (map f l✝) = size l✝
t_r_valid : Valid' (Option.map f ↑x✝) (map f r✝) (Option.map f a₂)
t_r_size : size (map f r✝) = size r✝
⊢ Balanced (map f l✝)

tactic: exact t_r_valid.bal
state_before: case node.intro.intro.bal.right.right
α : Type u_2
inst✝¹ : Preorder α
β : Type u_1
inst✝ : Preorder β
f : α → β
f_strict_mono : StrictMono f
size✝ : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
a₁ : WithBot α
a₂ : WithTop α
h : Valid' a₁ (Ordnode.node size✝ l✝ x✝ r✝) a₂
t_l_valid : Valid' (Option.map f a₁) (map f l✝) (Option.map f ↑x✝)
t_l_size : size (map f l✝) = size l✝
t_r_valid : Valid' (Option.map f ↑x✝) (map f r✝) (Option.map f a₂)
t_r_size : size (map f r✝) = size r✝
⊢ Balanced (map f r✝)