l3lab/ntp-mathlib huggingface dataset:
/-- **Internal use only**

O(1). Rebalance a tree which was previously balanced but has had one side change
by at most 1. -/
def balance (l : Ordnode α) (x : α) (r : Ordnode α) : Ordnode α := by
  -- porting notes: removed `clean`
  cases' id l with ls ll lx lr
  · cases' id r with rs rl rx rr
    · exact ι x
    · cases' id rl with rls rll rlx rlr
      · cases id rr
        · exact node 2 nil x r
        · exact node 3 (ι x) rx rr
      · cases' id rr with rrs
        · exact node 3 (ι x) rlx ι rx
        · exact
            if rls < ratio * rrs then node (rs + 1) (node (rls + 1) nil x rl) rx rr
            else
              node (rs + 1) (node (size rll + 1) nil x rll) rlx
                (node (size rlr + rrs + 1) rlr rx rr)
  · cases' id r with rs rl rx rr
    · cases' id ll with lls
      · cases' lr with _ _ lrx
        · exact node 2 l x nil
        · exact node 3 (ι lx) lrx ι x
      · cases' id lr with lrs lrl lrx lrr
        · exact node 3 ll lx ι x
        · exact
            if lrs < ratio * lls then node (ls + 1) ll lx (node (lrs + 1) lr x nil)
            else
              node (ls + 1) (node (lls + size lrl + 1) ll lx lrl) lrx
                (node (size lrr + 1) lrr x nil)
    · refine'
        if delta * ls < rs then _ else if delta * rs < ls then _ else node (ls + rs + 1) l x r
      · cases' id rl with rls rll rlx rlr
        · exact nil
        --should not happen
        cases' id rr with rrs
        · exact nil
        --should not happen
        exact
          if rls < ratio * rrs then node (ls + rs + 1) (node (ls + rls + 1) l x rl) rx rr
          else
            node (ls + rs + 1) (node (ls + size rll + 1) l x rll) rlx
              (node (size rlr + rrs + 1) rlr rx rr)
      · cases' id ll with lls
        · exact nil
        --should not happen
        cases' id lr with lrs lrl lrx lrr
        · 

Proof state:
case node.node.refine'_2.node.nil
α : Type u_1
l : Ordnode α
x : α
r : Ordnode α
ls : ℕ
ll : Ordnode α
lx : α
lr : Ordnode α
rs : ℕ
rl : Ordnode α
rx : α
rr : Ordnode α
lls : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
⊢ Ordnode α

Next tactic:
exact nil
/-- **Internal use only**

O(1). Rebalance a tree which was previously balanced but has had one side change
by at most 1. -/
def balance (l : Ordnode α) (x : α) (r : Ordnode α) : Ordnode α := by
  -- porting notes: removed `clean`
  cases' id l with ls ll lx lr
  · cases' id r with rs rl rx rr
    · exact ι x
    · cases' id rl with rls rll rlx rlr
      · cases id rr
        · exact node 2 nil x r
        · exact node 3 (ι x) rx rr
      · cases' id rr with rrs
        · exact node 3 (ι x) rlx ι rx
        · exact
            if rls < ratio * rrs then node (rs + 1) (node (rls + 1) nil x rl) rx rr
            else
              node (rs + 1) (node (size rll + 1) nil x rll) rlx
                (node (size rlr + rrs + 1) rlr rx rr)
  · cases' id r with rs rl rx rr
    · cases' id ll with lls
      · cases' lr with _ _ lrx
        · exact node 2 l x nil
        · exact node 3 (ι lx) lrx ι x
      · cases' id lr with lrs lrl lrx lrr
        · exact node 3 ll lx ι x
        · exact
            if lrs < ratio * lls then node (ls + 1) ll lx (node (lrs + 1) lr x nil)
            else
              node (ls + 1) (node (lls + size lrl + 1) ll lx lrl) lrx
                (node (size lrr + 1) lrr x nil)
    · refine'
        if delta * ls < rs then _ else if delta * rs < ls then _ else node (ls + rs + 1) l x r
      · cases' id rl with rls rll rlx rlr
        · exact nil
        --should not happen
        cases' id rr with rrs
        · exact nil
        --should not happen
        exact
          if rls < ratio * rrs then node (ls + rs + 1) (node (ls + rls + 1) l x rl) rx rr
          else
            node (ls + rs + 1) (node (ls + size rll + 1) l x rll) rlx
              (node (size rlr + rrs + 1) rlr rx rr)
      · cases' id ll with lls
        · exact nil
        --should not happen
        cases' id lr with lrs lrl lrx lrr
        · exact nil
        --should not happen
        

Proof state:
case node.node.refine'_2.node.node
α : Type u_1
l : Ordnode α
x : α
r : Ordnode α
ls : ℕ
ll : Ordnode α
lx : α
lr : Ordnode α
rs : ℕ
rl : Ordnode α
rx : α
rr : Ordnode α
lls : ℕ
l✝ : Ordnode α
x✝ : α
r✝ : Ordnode α
lrs : ℕ
lrl : Ordnode α
lrx : α
lrr : Ordnode α
⊢ Ordnode α

Next tactic:
exact
          if lrs < ratio * lls then node (ls + rs + 1) ll lx (node (lrs + rs + 1) lr x r)
          else
            node (ls + rs + 1) (node (lls + size lrl + 1) ll lx lrl) lrx
              (node (size lrr + rs + 1) lrr x r)
instance Emem.decidable (x : α) [DecidableEq α] : ∀ t, Decidable (Emem x t) := by
  

Proof state:
α : Type u_1
x : α
inst✝ : DecidableEq α
⊢ (t : Ordnode α) → Decidable (Emem x t)

Next tactic:
dsimp [Emem]
instance Emem.decidable (x : α) [DecidableEq α] : ∀ t, Decidable (Emem x t) := by
  dsimp [Emem]; 

Proof state:
α : Type u_1
x : α
inst✝ : DecidableEq α
⊢ (t : Ordnode α) → Decidable (Any (Eq x) t)

Next tactic:
infer_instance
instance Amem.decidable [LE α] [@DecidableRel α (· ≤ ·)] (x : α) :
    ∀ t, Decidable (Amem x t) := by
  

Proof state:
α : Type u_1
inst✝¹ : LE α
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
x : α
⊢ (t : Ordnode α) → Decidable (Amem x t)

Next tactic:
dsimp [Amem]
instance Amem.decidable [LE α] [@DecidableRel α (· ≤ ·)] (x : α) :
    ∀ t, Decidable (Amem x t) := by
  dsimp [Amem]; 

Proof state:
α : Type u_1
inst✝¹ : LE α
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
x : α
⊢ (t : Ordnode α) → Decidable (Any (fun y => x ≤ y ∧ y ≤ x) t)

Next tactic:
infer_instance
/-- The radius of the Cartesian product of two formal series is the minimum of their radii. -/
lemma FormalMultilinearSeries.radius_prod_eq_min
    (p : FormalMultilinearSeries 𝕜 E F) (q : FormalMultilinearSeries 𝕜 E G) :
    (p.prod q).radius = min p.radius q.radius := by
  

Proof state:
α : Type u_1
𝕜 : Type u_2
inst✝¹² : NontriviallyNormedField 𝕜
E : Type u_3
F : Type u_4
G : Type u_5
H : Type u_6
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace 𝕜 E
inst✝⁹ : NormedAddCommGroup F
inst✝⁸ : NormedSpace 𝕜 F
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedSpace 𝕜 G
inst✝⁵ : NormedAddCommGroup H
inst✝⁴ : NormedSpace 𝕜 H
𝕝 : Type u_7
inst✝³ : NontriviallyNormedField 𝕝
inst✝² : NormedAlgebra 𝕜 𝕝
A : Type u_8
inst✝¹ : NormedRing A
inst✝ : NormedAlgebra 𝕜 A
p : FormalMultilinearSeries 𝕜 E F
q : FormalMultilinearSeries 𝕜 E G
⊢ radius (prod p q) = min (radius p) (radius q)

Next tactic:
apply le_antisymm
/-- The radius of the Cartesian product of two formal series is the minimum of their radii. -/
lemma FormalMultilinearSeries.radius_prod_eq_min
    (p : FormalMultilinearSeries 𝕜 E F) (q : FormalMultilinearSeries 𝕜 E G) :
    (p.prod q).radius = min p.radius q.radius := by
  apply le_antisymm
  · 

Proof state:
case a
α : Type u_1
𝕜 : Type u_2
inst✝¹² : NontriviallyNormedField 𝕜
E : Type u_3
F : Type u_4
G : Type u_5
H : Type u_6
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace 𝕜 E
inst✝⁹ : NormedAddCommGroup F
inst✝⁸ : NormedSpace 𝕜 F
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedSpace 𝕜 G
inst✝⁵ : NormedAddCommGroup H
inst✝⁴ : NormedSpace 𝕜 H
𝕝 : Type u_7
inst✝³ : NontriviallyNormedField 𝕝
inst✝² : NormedAlgebra 𝕜 𝕝
A : Type u_8
inst✝¹ : NormedRing A
inst✝ : NormedAlgebra 𝕜 A
p : FormalMultilinearSeries 𝕜 E F
q : FormalMultilinearSeries 𝕜 E G
⊢ radius (prod p q) ≤ min (radius p) (radius q)

Next tactic:
refine ENNReal.le_of_forall_nnreal_lt fun r hr => ?_
/-- The radius of the Cartesian product of two formal series is the minimum of their radii. -/
lemma FormalMultilinearSeries.radius_prod_eq_min
    (p : FormalMultilinearSeries 𝕜 E F) (q : FormalMultilinearSeries 𝕜 E G) :
    (p.prod q).radius = min p.radius q.radius := by
  apply le_antisymm
  · refine ENNReal.le_of_forall_nnreal_lt fun r hr => ?_
    

Proof state:
case a
α : Type u_1
𝕜 : Type u_2
inst✝¹² : NontriviallyNormedField 𝕜
E : Type u_3
F : Type u_4
G : Type u_5
H : Type u_6
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace 𝕜 E
inst✝⁹ : NormedAddCommGroup F
inst✝⁸ : NormedSpace 𝕜 F
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedSpace 𝕜 G
inst✝⁵ : NormedAddCommGroup H
inst✝⁴ : NormedSpace 𝕜 H
𝕝 : Type u_7
inst✝³ : NontriviallyNormedField 𝕝
inst✝² : NormedAlgebra 𝕜 𝕝
A : Type u_8
inst✝¹ : NormedRing A
inst✝ : NormedAlgebra 𝕜 A
p : FormalMultilinearSeries 𝕜 E F
q : FormalMultilinearSeries 𝕜 E G
r : ℝ≥0
hr : ↑r < radius (prod p q)
⊢ ↑r ≤ min (radius p) (radius q)

Next tactic:
rw [le_min_iff]
/-- The radius of the Cartesian product of two formal series is the minimum of their radii. -/
lemma FormalMultilinearSeries.radius_prod_eq_min
    (p : FormalMultilinearSeries 𝕜 E F) (q : FormalMultilinearSeries 𝕜 E G) :
    (p.prod q).radius = min p.radius q.radius := by
  apply le_antisymm
  · refine ENNReal.le_of_forall_nnreal_lt fun r hr => ?_
    rw [le_min_iff]
    

Proof state:
case a
α : Type u_1
𝕜 : Type u_2
inst✝¹² : NontriviallyNormedField 𝕜
E : Type u_3
F : Type u_4
G : Type u_5
H : Type u_6
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace 𝕜 E
inst✝⁹ : NormedAddCommGroup F
inst✝⁸ : NormedSpace 𝕜 F
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedSpace 𝕜 G
inst✝⁵ : NormedAddCommGroup H
inst✝⁴ : NormedSpace 𝕜 H
𝕝 : Type u_7
inst✝³ : NontriviallyNormedField 𝕝
inst✝² : NormedAlgebra 𝕜 𝕝
A : Type u_8
inst✝¹ : NormedRing A
inst✝ : NormedAlgebra 𝕜 A
p : FormalMultilinearSeries 𝕜 E F
q : FormalMultilinearSeries 𝕜 E G
r : ℝ≥0
hr : ↑r < radius (prod p q)
⊢ ↑r ≤ radius p ∧ ↑r ≤ radius q

Next tactic:
have := (p.prod q).isLittleO_one_of_lt_radius hr
/-- The radius of the Cartesian product of two formal series is the minimum of their radii. -/
lemma FormalMultilinearSeries.radius_prod_eq_min
    (p : FormalMultilinearSeries 𝕜 E F) (q : FormalMultilinearSeries 𝕜 E G) :
    (p.prod q).radius = min p.radius q.radius := by
  apply le_antisymm
  · refine ENNReal.le_of_forall_nnreal_lt fun r hr => ?_
    rw [le_min_iff]
    have := (p.prod q).isLittleO_one_of_lt_radius hr
    

Proof state:
case a
α : Type u_1
𝕜 : Type u_2
inst✝¹² : NontriviallyNormedField 𝕜
E : Type u_3
F : Type u_4
G : Type u_5
H : Type u_6
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace 𝕜 E
inst✝⁹ : NormedAddCommGroup F
inst✝⁸ : NormedSpace 𝕜 F
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedSpace 𝕜 G
inst✝⁵ : NormedAddCommGroup H
inst✝⁴ : NormedSpace 𝕜 H
𝕝 : Type u_7
inst✝³ : NontriviallyNormedField 𝕝
inst✝² : NormedAlgebra 𝕜 𝕝
A : Type u_8
inst✝¹ : NormedRing A
inst✝ : NormedAlgebra 𝕜 A
p : FormalMultilinearSeries 𝕜 E F
q : FormalMultilinearSeries 𝕜 E G
r : ℝ≥0
hr : ↑r < radius (prod p q)
this : (fun n => ‖prod p q n‖ * ↑r ^ n) =o[atTop] fun x => 1
⊢ ↑r ≤ radius p ∧ ↑r ≤ radius q

Next tactic:
constructor
/-- The radius of the Cartesian product of two formal series is the minimum of their radii. -/
lemma FormalMultilinearSeries.radius_prod_eq_min
    (p : FormalMultilinearSeries 𝕜 E F) (q : FormalMultilinearSeries 𝕜 E G) :
    (p.prod q).radius = min p.radius q.radius := by
  apply le_antisymm
  · refine ENNReal.le_of_forall_nnreal_lt fun r hr => ?_
    rw [le_min_iff]
    have := (p.prod q).isLittleO_one_of_lt_radius hr
    constructor
    

Proof state:
case a.left
α : Type u_1
𝕜 : Type u_2
inst✝¹² : NontriviallyNormedField 𝕜
E : Type u_3
F : Type u_4
G : Type u_5
H : Type u_6
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace 𝕜 E
inst✝⁹ : NormedAddCommGroup F
inst✝⁸ : NormedSpace 𝕜 F
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedSpace 𝕜 G
inst✝⁵ : NormedAddCommGroup H
inst✝⁴ : NormedSpace 𝕜 H
𝕝 : Type u_7
inst✝³ : NontriviallyNormedField 𝕝
inst✝² : NormedAlgebra 𝕜 𝕝
A : Type u_8
inst✝¹ : NormedRing A
inst✝ : NormedAlgebra 𝕜 A
p : FormalMultilinearSeries 𝕜 E F
q : FormalMultilinearSeries 𝕜 E G
r : ℝ≥0
hr : ↑r < radius (prod p q)
this : (fun n => ‖prod p q n‖ * ↑r ^ n) =o[atTop] fun x => 1
⊢ ↑r ≤ radius p
case a.right
α : Type u_1
𝕜 : Type u_2
inst✝¹² : NontriviallyNormedField 𝕜
E : Type u_3
F : Type u_4
G : Type u_5
H : Type u_6
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace 𝕜 E
inst✝⁹ : NormedAddCommGroup F
inst✝⁸ : NormedSpace 𝕜 F
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedSpace 𝕜 G
inst✝⁵ : NormedAddCommGroup H
inst✝⁴ : NormedSpace 𝕜 H
𝕝 : Type u_7
inst✝³ : NontriviallyNormedField 𝕝
inst✝² : NormedAlgebra 𝕜 𝕝
A : Type u_8
inst✝¹ : NormedRing A
inst✝ : NormedAlgebra 𝕜 A
p : FormalMultilinearSeries 𝕜 E F
q : FormalMultilinearSeries 𝕜 E G
r : ℝ≥0
hr : ↑r < radius (prod p q)
this : (fun n => ‖prod p q n‖ * ↑r ^ n) =o[atTop] fun x => 1
⊢ ↑r ≤ radius q

Next tactic:
all_goals { -- kludge, there is no "work_on_goal" in Lean 4?
      apply FormalMultilinearSeries.le_radius_of_isBigO
      refine (isBigO_of_le _ fun n ↦ ?_).trans this.isBigO
      rw [norm_mul, norm_norm, norm_mul, norm_norm]
      refine mul_le_mul_of_nonneg_right ?_ (norm_nonneg _)
      rw [FormalMultilinearSeries.prod, ContinuousMultilinearMap.op_norm_prod]
      try apply le_max_left
      try apply le_max_right }
/-- The radius of the Cartesian product of two formal series is the minimum of their radii. -/
lemma FormalMultilinearSeries.radius_prod_eq_min
    (p : FormalMultilinearSeries 𝕜 E F) (q : FormalMultilinearSeries 𝕜 E G) :
    (p.prod q).radius = min p.radius q.radius := by
  apply le_antisymm
  · refine ENNReal.le_of_forall_nnreal_lt fun r hr => ?_
    rw [le_min_iff]
    have := (p.prod q).isLittleO_one_of_lt_radius hr
    constructor
    all_goals 

Proof state:
case a.left
α : Type u_1
𝕜 : Type u_2
inst✝¹² : NontriviallyNormedField 𝕜
E : Type u_3
F : Type u_4
G : Type u_5
H : Type u_6
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace 𝕜 E
inst✝⁹ : NormedAddCommGroup F
inst✝⁸ : NormedSpace 𝕜 F
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedSpace 𝕜 G
inst✝⁵ : NormedAddCommGroup H
inst✝⁴ : NormedSpace 𝕜 H
𝕝 : Type u_7
inst✝³ : NontriviallyNormedField 𝕝
inst✝² : NormedAlgebra 𝕜 𝕝
A : Type u_8
inst✝¹ : NormedRing A
inst✝ : NormedAlgebra 𝕜 A
p : FormalMultilinearSeries 𝕜 E F
q : FormalMultilinearSeries 𝕜 E G
r : ℝ≥0
hr : ↑r < radius (prod p q)
this : (fun n => ‖prod p q n‖ * ↑r ^ n) =o[atTop] fun x => 1
⊢ ↑r ≤ radius p

Next tactic:
{ -- kludge, there is no "work_on_goal" in Lean 4?
      apply FormalMultilinearSeries.le_radius_of_isBigO
      refine (isBigO_of_le _ fun n ↦ ?_).trans this.isBigO
      rw [norm_mul, norm_norm, norm_mul, norm_norm]
      refine mul_le_mul_of_nonneg_right ?_ (norm_nonneg _)
      rw [FormalMultilinearSeries.prod, ContinuousMultilinearMap.op_norm_prod]
      try apply le_max_left
      try apply le_max_right }
/-- The radius of the Cartesian product of two formal series is the minimum of their radii. -/
lemma FormalMultilinearSeries.radius_prod_eq_min
    (p : FormalMultilinearSeries 𝕜 E F) (q : FormalMultilinearSeries 𝕜 E G) :
    (p.prod q).radius = min p.radius q.radius := by
  apply le_antisymm
  · refine ENNReal.le_of_forall_nnreal_lt fun r hr => ?_
    rw [le_min_iff]
    have := (p.prod q).isLittleO_one_of_lt_radius hr
    constructor
    all_goals { -- kludge, there is no "work_on_goal" in Lean 4?
      

Proof state:
case a.left
α : Type u_1
𝕜 : Type u_2
inst✝¹² : NontriviallyNormedField 𝕜
E : Type u_3
F : Type u_4
G : Type u_5
H : Type u_6
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace 𝕜 E
inst✝⁹ : NormedAddCommGroup F
inst✝⁸ : NormedSpace 𝕜 F
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedSpace 𝕜 G
inst✝⁵ : NormedAddCommGroup H
inst✝⁴ : NormedSpace 𝕜 H
𝕝 : Type u_7
inst✝³ : NontriviallyNormedField 𝕝
inst✝² : NormedAlgebra 𝕜 𝕝
A : Type u_8
inst✝¹ : NormedRing A
inst✝ : NormedAlgebra 𝕜 A
p : FormalMultilinearSeries 𝕜 E F
q : FormalMultilinearSeries 𝕜 E G
r : ℝ≥0
hr : ↑r < radius (prod p q)
this : (fun n => ‖prod p q n‖ * ↑r ^ n) =o[atTop] fun x => 1
⊢ ↑r ≤ radius p

Next tactic:
apply FormalMultilinearSeries.le_radius_of_isBigO
/-- The radius of the Cartesian product of two formal series is the minimum of their radii. -/
lemma FormalMultilinearSeries.radius_prod_eq_min
    (p : FormalMultilinearSeries 𝕜 E F) (q : FormalMultilinearSeries 𝕜 E G) :
    (p.prod q).radius = min p.radius q.radius := by
  apply le_antisymm
  · refine ENNReal.le_of_forall_nnreal_lt fun r hr => ?_
    rw [le_min_iff]
    have := (p.prod q).isLittleO_one_of_lt_radius hr
    constructor
    all_goals { -- kludge, there is no "work_on_goal" in Lean 4?
      apply FormalMultilinearSeries.le_radius_of_isBigO
      

Proof state:
case a.left.h
α : Type u_1
𝕜 : Type u_2
inst✝¹² : NontriviallyNormedField 𝕜
E : Type u_3
F : Type u_4
G : Type u_5
H : Type u_6
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace 𝕜 E
inst✝⁹ : NormedAddCommGroup F
inst✝⁸ : NormedSpace 𝕜 F
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedSpace 𝕜 G
inst✝⁵ : NormedAddCommGroup H
inst✝⁴ : NormedSpace 𝕜 H
𝕝 : Type u_7
inst✝³ : NontriviallyNormedField 𝕝
inst✝² : NormedAlgebra 𝕜 𝕝
A : Type u_8
inst✝¹ : NormedRing A
inst✝ : NormedAlgebra 𝕜 A
p : FormalMultilinearSeries 𝕜 E F
q : FormalMultilinearSeries 𝕜 E G
r : ℝ≥0
hr : ↑r < radius (prod p q)
this : (fun n => ‖prod p q n‖ * ↑r ^ n) =o[atTop] fun x => 1
⊢ (fun n => ‖p n‖ * ↑r ^ n) =O[atTop] fun x => 1

Next tactic:
refine (isBigO_of_le _ fun n ↦ ?_).trans this.isBigO
/-- The radius of the Cartesian product of two formal series is the minimum of their radii. -/
lemma FormalMultilinearSeries.radius_prod_eq_min
    (p : FormalMultilinearSeries 𝕜 E F) (q : FormalMultilinearSeries 𝕜 E G) :
    (p.prod q).radius = min p.radius q.radius := by
  apply le_antisymm
  · refine ENNReal.le_of_forall_nnreal_lt fun r hr => ?_
    rw [le_min_iff]
    have := (p.prod q).isLittleO_one_of_lt_radius hr
    constructor
    all_goals { -- kludge, there is no "work_on_goal" in Lean 4?
      apply FormalMultilinearSeries.le_radius_of_isBigO
      refine (isBigO_of_le _ fun n ↦ ?_).trans this.isBigO
      

Proof state:
case a.left.h
α : Type u_1
𝕜 : Type u_2
inst✝¹² : NontriviallyNormedField 𝕜
E : Type u_3
F : Type u_4
G : Type u_5
H : Type u_6
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace 𝕜 E
inst✝⁹ : NormedAddCommGroup F
inst✝⁸ : NormedSpace 𝕜 F
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedSpace 𝕜 G
inst✝⁵ : NormedAddCommGroup H
inst✝⁴ : NormedSpace 𝕜 H
𝕝 : Type u_7
inst✝³ : NontriviallyNormedField 𝕝
inst✝² : NormedAlgebra 𝕜 𝕝
A : Type u_8
inst✝¹ : NormedRing A
inst✝ : NormedAlgebra 𝕜 A
p : FormalMultilinearSeries 𝕜 E F
q : FormalMultilinearSeries 𝕜 E G
r : ℝ≥0
hr : ↑r < radius (prod p q)
this : (fun n => ‖prod p q n‖ * ↑r ^ n) =o[atTop] fun x => 1
n : ℕ
⊢ ‖‖p n‖ * ↑r ^ n‖ ≤ ‖‖prod p q n‖ * ↑r ^ n‖

Next tactic:
rw [norm_mul, norm_norm, norm_mul, norm_norm]
/-- The radius of the Cartesian product of two formal series is the minimum of their radii. -/
lemma FormalMultilinearSeries.radius_prod_eq_min
    (p : FormalMultilinearSeries 𝕜 E F) (q : FormalMultilinearSeries 𝕜 E G) :
    (p.prod q).radius = min p.radius q.radius := by
  apply le_antisymm
  · refine ENNReal.le_of_forall_nnreal_lt fun r hr => ?_
    rw [le_min_iff]
    have := (p.prod q).isLittleO_one_of_lt_radius hr
    constructor
    all_goals { -- kludge, there is no "work_on_goal" in Lean 4?
      apply FormalMultilinearSeries.le_radius_of_isBigO
      refine (isBigO_of_le _ fun n ↦ ?_).trans this.isBigO
      rw [norm_mul, norm_norm, norm_mul, norm_norm]
      

Proof state:
case a.left.h
α : Type u_1
𝕜 : Type u_2
inst✝¹² : NontriviallyNormedField 𝕜
E : Type u_3
F : Type u_4
G : Type u_5
H : Type u_6
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace 𝕜 E
inst✝⁹ : NormedAddCommGroup F
inst✝⁸ : NormedSpace 𝕜 F
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedSpace 𝕜 G
inst✝⁵ : NormedAddCommGroup H
inst✝⁴ : NormedSpace 𝕜 H
𝕝 : Type u_7
inst✝³ : NontriviallyNormedField 𝕝
inst✝² : NormedAlgebra 𝕜 𝕝
A : Type u_8
inst✝¹ : NormedRing A
inst✝ : NormedAlgebra 𝕜 A
p : FormalMultilinearSeries 𝕜 E F
q : FormalMultilinearSeries 𝕜 E G
r : ℝ≥0
hr : ↑r < radius (prod p q)
this : (fun n => ‖prod p q n‖ * ↑r ^ n) =o[atTop] fun x => 1
n : ℕ
⊢ ‖p n‖ * ‖↑r ^ n‖ ≤ ‖prod p q n‖ * ‖↑r ^ n‖

Next tactic:
refine mul_le_mul_of_nonneg_right ?_ (norm_nonneg _)
/-- The radius of the Cartesian product of two formal series is the minimum of their radii. -/
lemma FormalMultilinearSeries.radius_prod_eq_min
    (p : FormalMultilinearSeries 𝕜 E F) (q : FormalMultilinearSeries 𝕜 E G) :
    (p.prod q).radius = min p.radius q.radius := by
  apply le_antisymm
  · refine ENNReal.le_of_forall_nnreal_lt fun r hr => ?_
    rw [le_min_iff]
    have := (p.prod q).isLittleO_one_of_lt_radius hr
    constructor
    all_goals { -- kludge, there is no "work_on_goal" in Lean 4?
      apply FormalMultilinearSeries.le_radius_of_isBigO
      refine (isBigO_of_le _ fun n ↦ ?_).trans this.isBigO
      rw [norm_mul, norm_norm, norm_mul, norm_norm]
      refine mul_le_mul_of_nonneg_right ?_ (norm_nonneg _)
      

Proof state:
case a.left.h
α : Type u_1
𝕜 : Type u_2
inst✝¹² : NontriviallyNormedField 𝕜
E : Type u_3
F : Type u_4
G : Type u_5
H : Type u_6
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace 𝕜 E
inst✝⁹ : NormedAddCommGroup F
inst✝⁸ : NormedSpace 𝕜 F
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedSpace 𝕜 G
inst✝⁵ : NormedAddCommGroup H
inst✝⁴ : NormedSpace 𝕜 H
𝕝 : Type u_7
inst✝³ : NontriviallyNormedField 𝕝
inst✝² : NormedAlgebra 𝕜 𝕝
A : Type u_8
inst✝¹ : NormedRing A
inst✝ : NormedAlgebra 𝕜 A
p : FormalMultilinearSeries 𝕜 E F
q : FormalMultilinearSeries 𝕜 E G
r : ℝ≥0
hr : ↑r < radius (prod p q)
this : (fun n => ‖prod p q n‖ * ↑r ^ n) =o[atTop] fun x => 1
n : ℕ
⊢ ‖p n‖ ≤ ‖prod p q n‖

Next tactic:
rw [FormalMultilinearSeries.prod, ContinuousMultilinearMap.op_norm_prod]
/-- The radius of the Cartesian product of two formal series is the minimum of their radii. -/
lemma FormalMultilinearSeries.radius_prod_eq_min
    (p : FormalMultilinearSeries 𝕜 E F) (q : FormalMultilinearSeries 𝕜 E G) :
    (p.prod q).radius = min p.radius q.radius := by
  apply le_antisymm
  · refine ENNReal.le_of_forall_nnreal_lt fun r hr => ?_
    rw [le_min_iff]
    have := (p.prod q).isLittleO_one_of_lt_radius hr
    constructor
    all_goals { -- kludge, there is no "work_on_goal" in Lean 4?
      apply FormalMultilinearSeries.le_radius_of_isBigO
      refine (isBigO_of_le _ fun n ↦ ?_).trans this.isBigO
      rw [norm_mul, norm_norm, norm_mul, norm_norm]
      refine mul_le_mul_of_nonneg_right ?_ (norm_nonneg _)
      rw [FormalMultilinearSeries.prod, ContinuousMultilinearMap.op_norm_prod]
      

Proof state:
case a.left.h
α : Type u_1
𝕜 : Type u_2
inst✝¹² : NontriviallyNormedField 𝕜
E : Type u_3
F : Type u_4
G : Type u_5
H : Type u_6
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace 𝕜 E
inst✝⁹ : NormedAddCommGroup F
inst✝⁸ : NormedSpace 𝕜 F
inst✝⁷ : NormedAddCommGroup G
inst✝⁶ : NormedSpace 𝕜 G
inst✝⁵ : NormedAddCommGroup H
inst✝⁴ : NormedSpace 𝕜 H
𝕝 : Type u_7
inst✝³ : NontriviallyNormedField 𝕝
inst✝² : NormedAlgebra 𝕜 𝕝
A : Type u_8
inst✝¹ : NormedRing A
inst✝ : NormedAlgebra 𝕜 A
p : FormalMultilinearSeries 𝕜 E F
q : FormalMultilinearSeries 𝕜 E G
r : ℝ≥0
hr : ↑r < radius (prod p q)
this : (fun n => ‖prod p q n‖ * ↑r ^ n) =o[atTop] fun x => 1
n : ℕ
⊢ ‖p n‖ ≤ max ‖p n‖ ‖q n‖

Next tactic:
try apply le_max_left