Theorem: PiNat.cylinder_longestPrefix_eq_of_longestPrefix_lt_firstDiff
File: Mathlib/Topology/MetricSpace/PiNat.lean

tactic: rw [l_eq, ← mem_cylinder_iff_eq]
state_before: E : ℕ → Type u_1
inst✝¹ : (n : ℕ) → TopologicalSpace (E n)
inst✝ : ∀ (n : ℕ), DiscreteTopology (E n)
x y : (n : ℕ) → E n
s : Set ((n : ℕ) → E n)
hs : IsClosed s
hne : Set.Nonempty s
H : longestPrefix x s < firstDiff x y
xs : ¬x ∈ s
ys : ¬y ∈ s
l_eq : longestPrefix y s = longestPrefix x s
⊢ cylinder x (longestPrefix x s) = cylinder y (longestPrefix y s)

tactic: exact cylinder_anti y H.le (mem_cylinder_firstDiff x y)
state_before: E : ℕ → Type u_1
inst✝¹ : (n : ℕ) → TopologicalSpace (E n)
inst✝ : ∀ (n : ℕ), DiscreteTopology (E n)
x y : (n : ℕ) → E n
s : Set ((n : ℕ) → E n)
hs : IsClosed s
hne : Set.Nonempty s
H : longestPrefix x s < firstDiff x y
xs : ¬x ∈ s
ys : ¬y ∈ s
l_eq : longestPrefix y s = longestPrefix x s
⊢ x ∈ cylinder y (longestPrefix x s)

tactic: rcases lt_trichotomy (longestPrefix y s) (longestPrefix x s) with (L | L | L)
state_before: E : ℕ → Type u_1
inst✝¹ : (n : ℕ) → TopologicalSpace (E n)
inst✝ : ∀ (n : ℕ), DiscreteTopology (E n)
x y : (n : ℕ) → E n
s : Set ((n : ℕ) → E n)
hs : IsClosed s
hne : Set.Nonempty s
H : longestPrefix x s < firstDiff x y
xs : ¬x ∈ s
ys : ¬y ∈ s
⊢ longestPrefix y s = longestPrefix x s

tactic: have Ax : (s ∩ cylinder x (longestPrefix x s)).Nonempty :=
  inter_cylinder_longestPrefix_nonempty hs hne x
state_before: case inl
E : ℕ → Type u_1
inst✝¹ : (n : ℕ) → TopologicalSpace (E n)
inst✝ : ∀ (n : ℕ), DiscreteTopology (E n)
x y : (n : ℕ) → E n
s : Set ((n : ℕ) → E n)
hs : IsClosed s
hne : Set.Nonempty s
H : longestPrefix x s < firstDiff x y
xs : ¬x ∈ s
ys : ¬y ∈ s
L : longestPrefix y s < longestPrefix x s
⊢ longestPrefix y s = longestPrefix x s

tactic: have Z := disjoint_cylinder_of_longestPrefix_lt hs ys L
state_before: case inl
E : ℕ → Type u_1
inst✝¹ : (n : ℕ) → TopologicalSpace (E n)
inst✝ : ∀ (n : ℕ), DiscreteTopology (E n)
x y : (n : ℕ) → E n
s : Set ((n : ℕ) → E n)
hs : IsClosed s
hne : Set.Nonempty s
H : longestPrefix x s < firstDiff x y
xs : ¬x ∈ s
ys : ¬y ∈ s
L : longestPrefix y s < longestPrefix x s
Ax : Set.Nonempty (s ∩ cylinder x (longestPrefix x s))
⊢ longestPrefix y s = longestPrefix x s

tactic: rw [firstDiff_comm] at H
state_before: case inl
E : ℕ → Type u_1
inst✝¹ : (n : ℕ) → TopologicalSpace (E n)
inst✝ : ∀ (n : ℕ), DiscreteTopology (E n)
x y : (n : ℕ) → E n
s : Set ((n : ℕ) → E n)
hs : IsClosed s
hne : Set.Nonempty s
H : longestPrefix x s < firstDiff x y
xs : ¬x ∈ s
ys : ¬y ∈ s
L : longestPrefix y s < longestPrefix x s
Ax : Set.Nonempty (s ∩ cylinder x (longestPrefix x s))
Z : Disjoint s (cylinder y (longestPrefix x s))
⊢ longestPrefix y s = longestPrefix x s

tactic: rw [cylinder_eq_cylinder_of_le_firstDiff _ _ H.le] at Z
state_before: case inl
E : ℕ → Type u_1
inst✝¹ : (n : ℕ) → TopologicalSpace (E n)
inst✝ : ∀ (n : ℕ), DiscreteTopology (E n)
x y : (n : ℕ) → E n
s : Set ((n : ℕ) → E n)
hs : IsClosed s
hne : Set.Nonempty s
H : longestPrefix x s < firstDiff y x
xs : ¬x ∈ s
ys : ¬y ∈ s
L : longestPrefix y s < longestPrefix x s
Ax : Set.Nonempty (s ∩ cylinder x (longestPrefix x s))
Z : Disjoint s (cylinder y (longestPrefix x s))
⊢ longestPrefix y s = longestPrefix x s

tactic: exact (Ax.not_disjoint Z).elim
state_before: case inl
E : ℕ → Type u_1
inst✝¹ : (n : ℕ) → TopologicalSpace (E n)
inst✝ : ∀ (n : ℕ), DiscreteTopology (E n)
x y : (n : ℕ) → E n
s : Set ((n : ℕ) → E n)
hs : IsClosed s
hne : Set.Nonempty s
H : longestPrefix x s < firstDiff y x
xs : ¬x ∈ s
ys : ¬y ∈ s
L : longestPrefix y s < longestPrefix x s
Ax : Set.Nonempty (s ∩ cylinder x (longestPrefix x s))
Z : Disjoint s (cylinder x (longestPrefix x s))
⊢ longestPrefix y s = longestPrefix x s

tactic: exact L
state_before: case inr.inl
E : ℕ → Type u_1
inst✝¹ : (n : ℕ) → TopologicalSpace (E n)
inst✝ : ∀ (n : ℕ), DiscreteTopology (E n)
x y : (n : ℕ) → E n
s : Set ((n : ℕ) → E n)
hs : IsClosed s
hne : Set.Nonempty s
H : longestPrefix x s < firstDiff x y
xs : ¬x ∈ s
ys : ¬y ∈ s
L : longestPrefix y s = longestPrefix x s
⊢ longestPrefix y s = longestPrefix x s

tactic: have Ay : (s ∩ cylinder y (longestPrefix y s)).Nonempty :=
  inter_cylinder_longestPrefix_nonempty hs hne y
state_before: case inr.inr
E : ℕ → Type u_1
inst✝¹ : (n : ℕ) → TopologicalSpace (E n)
inst✝ : ∀ (n : ℕ), DiscreteTopology (E n)
x y : (n : ℕ) → E n
s : Set ((n : ℕ) → E n)
hs : IsClosed s
hne : Set.Nonempty s
H : longestPrefix x s < firstDiff x y
xs : ¬x ∈ s
ys : ¬y ∈ s
L : longestPrefix x s < longestPrefix y s
⊢ longestPrefix y s = longestPrefix x s

tactic: have A'y : (s ∩ cylinder y (longestPrefix x s).succ).Nonempty :=
  Ay.mono (inter_subset_inter_right s (cylinder_anti _ L))
state_before: case inr.inr
E : ℕ → Type u_1
inst✝¹ : (n : ℕ) → TopologicalSpace (E n)
inst✝ : ∀ (n : ℕ), DiscreteTopology (E n)
x y : (n : ℕ) → E n
s : Set ((n : ℕ) → E n)
hs : IsClosed s
hne : Set.Nonempty s
H : longestPrefix x s < firstDiff x y
xs : ¬x ∈ s
ys : ¬y ∈ s
L : longestPrefix x s < longestPrefix y s
Ay : Set.Nonempty (s ∩ cylinder y (longestPrefix y s))
⊢ longestPrefix y s = longestPrefix x s

tactic: have Z := disjoint_cylinder_of_longestPrefix_lt hs xs (Nat.lt_succ_self _)
state_before: case inr.inr
E : ℕ → Type u_1
inst✝¹ : (n : ℕ) → TopologicalSpace (E n)
inst✝ : ∀ (n : ℕ), DiscreteTopology (E n)
x y : (n : ℕ) → E n
s : Set ((n : ℕ) → E n)
hs : IsClosed s
hne : Set.Nonempty s
H : longestPrefix x s < firstDiff x y
xs : ¬x ∈ s
ys : ¬y ∈ s
L : longestPrefix x s < longestPrefix y s
Ay : Set.Nonempty (s ∩ cylinder y (longestPrefix y s))
A'y : Set.Nonempty (s ∩ cylinder y (Nat.succ (longestPrefix x s)))
⊢ longestPrefix y s = longestPrefix x s

tactic: rw [cylinder_eq_cylinder_of_le_firstDiff _ _ H] at Z
state_before: case inr.inr
E : ℕ → Type u_1
inst✝¹ : (n : ℕ) → TopologicalSpace (E n)
inst✝ : ∀ (n : ℕ), DiscreteTopology (E n)
x y : (n : ℕ) → E n
s : Set ((n : ℕ) → E n)
hs : IsClosed s
hne : Set.Nonempty s
H : longestPrefix x s < firstDiff x y
xs : ¬x ∈ s
ys : ¬y ∈ s
L : longestPrefix x s < longestPrefix y s
Ay : Set.Nonempty (s ∩ cylinder y (longestPrefix y s))
A'y : Set.Nonempty (s ∩ cylinder y (Nat.succ (longestPrefix x s)))
Z : Disjoint s (cylinder x (Nat.succ (longestPrefix x s)))
⊢ longestPrefix y s = longestPrefix x s

tactic: exact (A'y.not_disjoint Z).elim
state_before: case inr.inr
E : ℕ → Type u_1
inst✝¹ : (n : ℕ) → TopologicalSpace (E n)
inst✝ : ∀ (n : ℕ), DiscreteTopology (E n)
x y : (n : ℕ) → E n
s : Set ((n : ℕ) → E n)
hs : IsClosed s
hne : Set.Nonempty s
H : longestPrefix x s < firstDiff x y
xs : ¬x ∈ s
ys : ¬y ∈ s
L : longestPrefix x s < longestPrefix y s
Ay : Set.Nonempty (s ∩ cylinder y (longestPrefix y s))
A'y : Set.Nonempty (s ∩ cylinder y (Nat.succ (longestPrefix x s)))
Z : Disjoint s (cylinder y (Nat.succ (longestPrefix x s)))
⊢ longestPrefix y s = longestPrefix x s