Theorem: AddCircle.norm_coe_eq_abs_iff
File: Mathlib/Analysis/Normed/Group/AddCircle.lean

tactic: refine' ⟨fun hx => hx ▸ norm_le_half_period p hp, fun hx => _⟩
state_before: p x : ℝ
hp : p ≠ 0
⊢ ‖↑x‖ = abs x ↔ abs x ≤ abs p / 2

tactic: clear hx
state_before: p x : ℝ
hp : p ≠ 0
hx : abs x ≤ abs p / 2
⊢ ∀ (p : ℝ), 0 < p → abs x ≤ p / 2 → ‖↑x‖ = abs x

tactic: intro p hp hx
state_before: p x : ℝ
hp : p ≠ 0
⊢ ∀ (p : ℝ), 0 < p → abs x ≤ p / 2 → ‖↑x‖ = abs x

tactic: rcases eq_or_ne x (p / (2 : ℝ)) with (rfl | hx')
state_before: p✝ x : ℝ
hp✝ : p✝ ≠ 0
p : ℝ
hp : 0 < p
hx : abs x ≤ p / 2
⊢ ‖↑x‖ = abs x

tactic: suffices round (p⁻¹ * x) = 0 by simp [norm_eq, this]
state_before: case inr
p✝ x : ℝ
hp✝ : p✝ ≠ 0
p : ℝ
hp : 0 < p
hx : abs x ≤ p / 2
hx' : x ≠ p / 2
⊢ ‖↑x‖ = abs x

tactic: rw [round_eq_zero_iff]
state_before: case inr
p✝ x : ℝ
hp✝ : p✝ ≠ 0
p : ℝ
hp : 0 < p
hx : abs x ≤ p / 2
hx' : x ≠ p / 2
⊢ round (p⁻¹ * x) = 0

tactic: obtain ⟨hx₁, hx₂⟩ := abs_le.mp hx
state_before: case inr
p✝ x : ℝ
hp✝ : p✝ ≠ 0
p : ℝ
hp : 0 < p
hx : abs x ≤ p / 2
hx' : x ≠ p / 2
⊢ p⁻¹ * x ∈ Ico (-(1 / 2)) (1 / 2)

tactic: replace hx₂ := Ne.lt_of_le hx' hx₂
state_before: case inr.intro
p✝ x : ℝ
hp✝ : p✝ ≠ 0
p : ℝ
hp : 0 < p
hx : abs x ≤ p / 2
hx' : x ≠ p / 2
hx₁ : -(p / 2) ≤ x
hx₂ : x ≤ p / 2
⊢ p⁻¹ * x ∈ Ico (-(1 / 2)) (1 / 2)

tactic: constructor
state_before: case inr.intro
p✝ x : ℝ
hp✝ : p✝ ≠ 0
p : ℝ
hp : 0 < p
hx : abs x ≤ p / 2
hx' : x ≠ p / 2
hx₁ : -(p / 2) ≤ x
hx₂ : x < p / 2
⊢ p⁻¹ * x ∈ Ico (-(1 / 2)) (1 / 2)

tactic: rcases hp.symm.lt_or_lt with (hp | hp)
state_before: p x : ℝ
hp : p ≠ 0
hx : abs x ≤ abs p / 2
this : ∀ (p : ℝ), 0 < p → abs x ≤ p / 2 → ‖↑x‖ = abs x
⊢ ‖↑x‖ = abs x

tactic: rw [abs_eq_self.mpr hp.le] at hx
state_before: case inl
p x : ℝ
hp✝ : p ≠ 0
hx : abs x ≤ abs p / 2
this : ∀ (p : ℝ), 0 < p → abs x ≤ p / 2 → ‖↑x‖ = abs x
hp : 0 < p
⊢ ‖↑x‖ = abs x

tactic: exact this p hp hx
state_before: case inl
p x : ℝ
hp✝ : p ≠ 0
hx : abs x ≤ p / 2
this : ∀ (p : ℝ), 0 < p → abs x ≤ p / 2 → ‖↑x‖ = abs x
hp : 0 < p
⊢ ‖↑x‖ = abs x

tactic: rw [← norm_neg_period]
state_before: case inr
p x : ℝ
hp✝ : p ≠ 0
hx : abs x ≤ abs p / 2
this : ∀ (p : ℝ), 0 < p → abs x ≤ p / 2 → ‖↑x‖ = abs x
hp : p < 0
⊢ ‖↑x‖ = abs x

tactic: rw [abs_eq_neg_self.mpr hp.le] at hx
state_before: case inr
p x : ℝ
hp✝ : p ≠ 0
hx : abs x ≤ abs p / 2
this : ∀ (p : ℝ), 0 < p → abs x ≤ p / 2 → ‖↑x‖ = abs x
hp : p < 0
⊢ ‖↑x‖ = abs x

tactic: exact this (-p) (neg_pos.mpr hp) hx
state_before: case inr
p x : ℝ
hp✝ : p ≠ 0
hx : abs x ≤ -p / 2
this : ∀ (p : ℝ), 0 < p → abs x ≤ p / 2 → ‖↑x‖ = abs x
hp : p < 0
⊢ ‖↑x‖ = abs x

tactic: simp [abs_div, abs_two]
state_before: case inl
p✝ : ℝ
hp✝ : p✝ ≠ 0
p : ℝ
hp : 0 < p
hx : abs (p / 2) ≤ p / 2
⊢ ‖↑(p / 2)‖ = abs (p / 2)

tactic: simp [norm_eq, this]
state_before: p✝ x : ℝ
hp✝ : p✝ ≠ 0
p : ℝ
hp : 0 < p
hx : abs x ≤ p / 2
hx' : x ≠ p / 2
this : round (p⁻¹ * x) = 0
⊢ ‖↑x‖ = abs x

tactic: rwa [← mul_le_mul_left hp, ← mul_assoc, mul_inv_cancel hp.ne.symm, one_mul, mul_neg, ←
  mul_div_assoc, mul_one]
state_before: case inr.intro.left
p✝ x : ℝ
hp✝ : p✝ ≠ 0
p : ℝ
hp : 0 < p
hx : abs x ≤ p / 2
hx' : x ≠ p / 2
hx₁ : -(p / 2) ≤ x
hx₂ : x < p / 2
⊢ -(1 / 2) ≤ p⁻¹ * x

tactic: rwa [← mul_lt_mul_left hp, ← mul_assoc, mul_inv_cancel hp.ne.symm, one_mul, ← mul_div_assoc,
  mul_one]
state_before: case inr.intro.right
p✝ x : ℝ
hp✝ : p✝ ≠ 0
p : ℝ
hp : 0 < p
hx : abs x ≤ p / 2
hx' : x ≠ p / 2
hx₁ : -(p / 2) ≤ x
hx₂ : x < p / 2
⊢ p⁻¹ * x < 1 / 2