Theorem: Even.tsub
File: Mathlib/Algebra/Order/Sub/Canonical.lean

tactic: obtain ⟨a, rfl⟩ := hm
state_before: α : Type u_1
inst✝⁶ : CanonicallyLinearOrderedAddCommMonoid α
inst✝⁵ : Sub α
inst✝⁴ : OrderedSub α
a b c d : α
inst✝³ : CanonicallyLinearOrderedAddCommMonoid α
inst✝² : Sub α
inst✝¹ : OrderedSub α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
m n : α
hm : Even m
hn : Even n
⊢ Even (m - n)
state_after: case intro
α : Type u_1
inst✝⁶ : CanonicallyLinearOrderedAddCommMonoid α
inst✝⁵ : Sub α
inst✝⁴ : OrderedSub α
a✝ b c d : α
inst✝³ : CanonicallyLinearOrderedAddCommMonoid α
inst✝² : Sub α
inst✝¹ : OrderedSub α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
n : α
hn : Even n
a : α
⊢ Even (a + a - n)

tactic: obtain ⟨b, rfl⟩ := hn
state_before: case intro
α : Type u_1
inst✝⁶ : CanonicallyLinearOrderedAddCommMonoid α
inst✝⁵ : Sub α
inst✝⁴ : OrderedSub α
a✝ b c d : α
inst✝³ : CanonicallyLinearOrderedAddCommMonoid α
inst✝² : Sub α
inst✝¹ : OrderedSub α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
n : α
hn : Even n
a : α
⊢ Even (a + a - n)
state_after: case intro.intro
α : Type u_1
inst✝⁶ : CanonicallyLinearOrderedAddCommMonoid α
inst✝⁵ : Sub α
inst✝⁴ : OrderedSub α
a✝ b✝ c d : α
inst✝³ : CanonicallyLinearOrderedAddCommMonoid α
inst✝² : Sub α
inst✝¹ : OrderedSub α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a b : α
⊢ Even (a + a - (b + b))

tactic: refine ⟨a - b, ?_⟩
state_before: case intro.intro
α : Type u_1
inst✝⁶ : CanonicallyLinearOrderedAddCommMonoid α
inst✝⁵ : Sub α
inst✝⁴ : OrderedSub α
a✝ b✝ c d : α
inst✝³ : CanonicallyLinearOrderedAddCommMonoid α
inst✝² : Sub α
inst✝¹ : OrderedSub α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a b : α
⊢ Even (a + a - (b + b))
state_after: case intro.intro
α : Type u_1
inst✝⁶ : CanonicallyLinearOrderedAddCommMonoid α
inst✝⁵ : Sub α
inst✝⁴ : OrderedSub α
a✝ b✝ c d : α
inst✝³ : CanonicallyLinearOrderedAddCommMonoid α
inst✝² : Sub α
inst✝¹ : OrderedSub α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a b : α
⊢ a + a - (b + b) = a - b + (a - b)

tactic: obtain h | h := le_total a b
state_before: case intro.intro
α : Type u_1
inst✝⁶ : CanonicallyLinearOrderedAddCommMonoid α
inst✝⁵ : Sub α
inst✝⁴ : OrderedSub α
a✝ b✝ c d : α
inst✝³ : CanonicallyLinearOrderedAddCommMonoid α
inst✝² : Sub α
inst✝¹ : OrderedSub α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a b : α
⊢ a + a - (b + b) = a - b + (a - b)
state_after: case intro.intro.inl
α : Type u_1
inst✝⁶ : CanonicallyLinearOrderedAddCommMonoid α
inst✝⁵ : Sub α
inst✝⁴ : OrderedSub α
a✝ b✝ c d : α
inst✝³ : CanonicallyLinearOrderedAddCommMonoid α
inst✝² : Sub α
inst✝¹ : OrderedSub α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a b : α
h : a ≤ b
⊢ a + a - (b + b) = a - b + (a - b)

case intro.intro.inr
α : Type u_1
inst✝⁶ : CanonicallyLinearOrderedAddCommMonoid α
inst✝⁵ : Sub α
inst✝⁴ : OrderedSub α
a✝ b✝ c d : α
inst✝³ : CanonicallyLinearOrderedAddCommMonoid α
inst✝² : Sub α
inst✝¹ : OrderedSub α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a b : α
h : b ≤ a
⊢ a + a - (b + b) = a - b + (a - b)

tactic: rw [tsub_eq_zero_of_le h, tsub_eq_zero_of_le (add_le_add h h), add_zero]
state_before: case intro.intro.inl
α : Type u_1
inst✝⁶ : CanonicallyLinearOrderedAddCommMonoid α
inst✝⁵ : Sub α
inst✝⁴ : OrderedSub α
a✝ b✝ c d : α
inst✝³ : CanonicallyLinearOrderedAddCommMonoid α
inst✝² : Sub α
inst✝¹ : OrderedSub α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a b : α
h : a ≤ b
⊢ a + a - (b + b) = a - b + (a - b)
state_after: no goals

tactic: exact (tsub_add_tsub_comm h h).symm
state_before: case intro.intro.inr
α : Type u_1
inst✝⁶ : CanonicallyLinearOrderedAddCommMonoid α
inst✝⁵ : Sub α
inst✝⁴ : OrderedSub α
a✝ b✝ c d : α
inst✝³ : CanonicallyLinearOrderedAddCommMonoid α
inst✝² : Sub α
inst✝¹ : OrderedSub α
inst✝ : ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1
a b : α
h : b ≤ a
⊢ a + a - (b + b) = a - b + (a - b)
state_after: no goals