Theorem: GromovHausdorff.HD_candidatesBDist_le
File: Mathlib/Topology/MetricSpace/GromovHausdorffRealized.lean

tactic: refine' max_le (ciSup_le fun x => _) (ciSup_le fun y => _)
state_before: X : Type u
Y : Type v
inst✝⁵ : MetricSpace X
inst✝⁴ : CompactSpace X
inst✝³ : Nonempty X
inst✝² : MetricSpace Y
inst✝¹ : CompactSpace Y
inst✝ : Nonempty Y
f : GromovHausdorff.ProdSpaceFun X Y
x y z t : X ⊕ Y
⊢ HD (candidatesBDist X Y) ≤ diam univ + 1 + diam univ

tactic: have A : (⨅ y, candidatesBDist X Y (inl x, inr y)) ≤ candidatesBDist X Y (inl x, inr default) :=
  ciInf_le (by simpa using HD_below_aux1 0) default
state_before: case refine'_1
X : Type u
Y : Type v
inst✝⁵ : MetricSpace X
inst✝⁴ : CompactSpace X
inst✝³ : Nonempty X
inst✝² : MetricSpace Y
inst✝¹ : CompactSpace Y
inst✝ : Nonempty Y
f : GromovHausdorff.ProdSpaceFun X Y
x✝ y z t : X ⊕ Y
x : X
⊢ (⨅ (y : Y), ↑(candidatesBDist X Y) (inl x, inr y)) ≤ diam univ + 1 + diam univ

tactic: have B : dist (inl x) (inr default) ≤ diam (univ : Set X) + 1 + diam (univ : Set Y) :=
  calc
    dist (inl x) (inr (default : Y)) = dist x (default : X) + 1 + dist default default := rfl
    _ ≤ diam (univ : Set X) + 1 + diam (univ : Set Y) := by
      gcongr <;>
        exact dist_le_diam_of_mem bounded_of_compactSpace (mem_univ _) (mem_univ _)
state_before: case refine'_1
X : Type u
Y : Type v
inst✝⁵ : MetricSpace X
inst✝⁴ : CompactSpace X
inst✝³ : Nonempty X
inst✝² : MetricSpace Y
inst✝¹ : CompactSpace Y
inst✝ : Nonempty Y
f : GromovHausdorff.ProdSpaceFun X Y
x✝ y z t : X ⊕ Y
x : X
A : (⨅ (y : Y), ↑(candidatesBDist X Y) (inl x, inr y)) ≤ ↑(candidatesBDist X Y) (inl x, inr default)
⊢ (⨅ (y : Y), ↑(candidatesBDist X Y) (inl x, inr y)) ≤ diam univ + 1 + diam univ

tactic: exact le_trans A B
state_before: case refine'_1
X : Type u
Y : Type v
inst✝⁵ : MetricSpace X
inst✝⁴ : CompactSpace X
inst✝³ : Nonempty X
inst✝² : MetricSpace Y
inst✝¹ : CompactSpace Y
inst✝ : Nonempty Y
f : GromovHausdorff.ProdSpaceFun X Y
x✝ y z t : X ⊕ Y
x : X
A : (⨅ (y : Y), ↑(candidatesBDist X Y) (inl x, inr y)) ≤ ↑(candidatesBDist X Y) (inl x, inr default)
B : dist (inl x) (inr default) ≤ diam univ + 1 + diam univ
⊢ (⨅ (y : Y), ↑(candidatesBDist X Y) (inl x, inr y)) ≤ diam univ + 1 + diam univ

tactic: simpa using HD_below_aux1 0
state_before: X : Type u
Y : Type v
inst✝⁵ : MetricSpace X
inst✝⁴ : CompactSpace X
inst✝³ : Nonempty X
inst✝² : MetricSpace Y
inst✝¹ : CompactSpace Y
inst✝ : Nonempty Y
f : GromovHausdorff.ProdSpaceFun X Y
x✝ y z t : X ⊕ Y
x : X
⊢ BddBelow (range fun y => ↑(candidatesBDist X Y) (inl x, inr y))

tactic: gcongr <;>
  exact dist_le_diam_of_mem bounded_of_compactSpace (mem_univ _) (mem_univ _)
state_before: X : Type u
Y : Type v
inst✝⁵ : MetricSpace X
inst✝⁴ : CompactSpace X
inst✝³ : Nonempty X
inst✝² : MetricSpace Y
inst✝¹ : CompactSpace Y
inst✝ : Nonempty Y
f : GromovHausdorff.ProdSpaceFun X Y
x✝ y z t : X ⊕ Y
x : X
A : (⨅ (y : Y), ↑(candidatesBDist X Y) (inl x, inr y)) ≤ ↑(candidatesBDist X Y) (inl x, inr default)
⊢ dist x default + 1 + dist default default ≤ diam univ + 1 + diam univ

tactic: have A : (⨅ x, candidatesBDist X Y (inl x, inr y)) ≤ candidatesBDist X Y (inl default, inr y) :=
  ciInf_le (by simpa using HD_below_aux2 0) default
state_before: case refine'_2
X : Type u
Y : Type v
inst✝⁵ : MetricSpace X
inst✝⁴ : CompactSpace X
inst✝³ : Nonempty X
inst✝² : MetricSpace Y
inst✝¹ : CompactSpace Y
inst✝ : Nonempty Y
f : GromovHausdorff.ProdSpaceFun X Y
x y✝ z t : X ⊕ Y
y : Y
⊢ (⨅ (x : X), ↑(candidatesBDist X Y) (inl x, inr y)) ≤ diam univ + 1 + diam univ

tactic: have B : dist (inl default) (inr y) ≤ diam (univ : Set X) + 1 + diam (univ : Set Y) :=
  calc
    dist (inl (default : X)) (inr y) = dist default default + 1 + dist default y := rfl
    _ ≤ diam (univ : Set X) + 1 + diam (univ : Set Y) := by
      gcongr <;>
        exact dist_le_diam_of_mem bounded_of_compactSpace (mem_univ _) (mem_univ _)
state_before: case refine'_2
X : Type u
Y : Type v
inst✝⁵ : MetricSpace X
inst✝⁴ : CompactSpace X
inst✝³ : Nonempty X
inst✝² : MetricSpace Y
inst✝¹ : CompactSpace Y
inst✝ : Nonempty Y
f : GromovHausdorff.ProdSpaceFun X Y
x y✝ z t : X ⊕ Y
y : Y
A : (⨅ (x : X), ↑(candidatesBDist X Y) (inl x, inr y)) ≤ ↑(candidatesBDist X Y) (inl default, inr y)
⊢ (⨅ (x : X), ↑(candidatesBDist X Y) (inl x, inr y)) ≤ diam univ + 1 + diam univ

tactic: exact le_trans A B
state_before: case refine'_2
X : Type u
Y : Type v
inst✝⁵ : MetricSpace X
inst✝⁴ : CompactSpace X
inst✝³ : Nonempty X
inst✝² : MetricSpace Y
inst✝¹ : CompactSpace Y
inst✝ : Nonempty Y
f : GromovHausdorff.ProdSpaceFun X Y
x y✝ z t : X ⊕ Y
y : Y
A : (⨅ (x : X), ↑(candidatesBDist X Y) (inl x, inr y)) ≤ ↑(candidatesBDist X Y) (inl default, inr y)
B : dist (inl default) (inr y) ≤ diam univ + 1 + diam univ
⊢ (⨅ (x : X), ↑(candidatesBDist X Y) (inl x, inr y)) ≤ diam univ + 1 + diam univ

tactic: simpa using HD_below_aux2 0
state_before: X : Type u
Y : Type v
inst✝⁵ : MetricSpace X
inst✝⁴ : CompactSpace X
inst✝³ : Nonempty X
inst✝² : MetricSpace Y
inst✝¹ : CompactSpace Y
inst✝ : Nonempty Y
f : GromovHausdorff.ProdSpaceFun X Y
x y✝ z t : X ⊕ Y
y : Y
⊢ BddBelow (range fun x => ↑(candidatesBDist X Y) (inl x, inr y))

tactic: gcongr <;>
  exact dist_le_diam_of_mem bounded_of_compactSpace (mem_univ _) (mem_univ _)
state_before: X : Type u
Y : Type v
inst✝⁵ : MetricSpace X
inst✝⁴ : CompactSpace X
inst✝³ : Nonempty X
inst✝² : MetricSpace Y
inst✝¹ : CompactSpace Y
inst✝ : Nonempty Y
f : GromovHausdorff.ProdSpaceFun X Y
x y✝ z t : X ⊕ Y
y : Y
A : (⨅ (x : X), ↑(candidatesBDist X Y) (inl x, inr y)) ≤ ↑(candidatesBDist X Y) (inl default, inr y)
⊢ dist default default + 1 + dist default y ≤ diam univ + 1 + diam univ