Theorem: compare_of_injective_eq_compareOfLessAndEq
File: Mathlib/Order/Basic.lean

tactic: have h := LinearOrder.compare_eq_compareOfLessAndEq (f a) (f b)
state_before: ι : Type ?u.93186
α : Type u
β : Type v
γ : Type w
π : ι → Type ?u.93197
r : α → α → Prop
a b : α
inst✝² : LinearOrder β
inst✝¹ : DecidableEq α
f : α → β
inj : Injective f
inst✝ : Decidable (a < b)
⊢ compare (f a) (f b) = compareOfLessAndEq a b

tactic: simp only [h, compareOfLessAndEq]
state_before: ι : Type ?u.93186
α : Type u
β : Type v
γ : Type w
π : ι → Type ?u.93197
r : α → α → Prop
a b : α
inst✝² : LinearOrder β
inst✝¹ : DecidableEq α
f : α → β
inj : Injective f
inst✝ : Decidable (a < b)
h : compare (f a) (f b) = compareOfLessAndEq (f a) (f b)
⊢ compare (f a) (f b) = compareOfLessAndEq a b

tactic: split_ifs <;> try (first | rfl | contradiction)
state_before: ι : Type ?u.93186
α : Type u
β : Type v
γ : Type w
π : ι → Type ?u.93197
r : α → α → Prop
a b : α
inst✝² : LinearOrder β
inst✝¹ : DecidableEq α
f : α → β
inj : Injective f
inst✝ : Decidable (a < b)
h : compare (f a) (f b) = compareOfLessAndEq (f a) (f b)
⊢ (if f a < f b then Ordering.lt else if f a = f b then Ordering.eq else Ordering.gt) =
    if a < b then Ordering.lt else if a = b then Ordering.eq else Ordering.gt

tactic: (first | rfl | contradiction)
state_before: case inr.inr.inr.inr
ι : Type ?u.93186
α : Type u
β : Type v
γ : Type w
π : ι → Type ?u.93197
r : α → α → Prop
a b : α
inst✝² : LinearOrder β
inst✝¹ : DecidableEq α
f : α → β
inj : Injective f
inst✝ : Decidable (a < b)
h : compare (f a) (f b) = compareOfLessAndEq (f a) (f b)
h✝³ : ¬f a < f b
h✝² : ¬f a = f b
h✝¹ : ¬a < b
h✝ : ¬a = b
⊢ Ordering.gt = Ordering.gt

tactic: first | rfl | contradiction
state_before: case inr.inr.inr.inr
ι : Type ?u.93186
α : Type u
β : Type v
γ : Type w
π : ι → Type ?u.93197
r : α → α → Prop
a b : α
inst✝² : LinearOrder β
inst✝¹ : DecidableEq α
f : α → β
inj : Injective f
inst✝ : Decidable (a < b)
h : compare (f a) (f b) = compareOfLessAndEq (f a) (f b)
h✝³ : ¬f a < f b
h✝² : ¬f a = f b
h✝¹ : ¬a < b
h✝ : ¬a = b
⊢ Ordering.gt = Ordering.gt

tactic: rfl
state_before: case inr.inr.inr.inr
ι : Type ?u.93186
α : Type u
β : Type v
γ : Type w
π : ι → Type ?u.93197
r : α → α → Prop
a b : α
inst✝² : LinearOrder β
inst✝¹ : DecidableEq α
f : α → β
inj : Injective f
inst✝ : Decidable (a < b)
h : compare (f a) (f b) = compareOfLessAndEq (f a) (f b)
h✝³ : ¬f a < f b
h✝² : ¬f a = f b
h✝¹ : ¬a < b
h✝ : ¬a = b
⊢ Ordering.gt = Ordering.gt

tactic: contradiction
state_before: case inr.inr.inr.inl
ι : Type ?u.93186
α : Type u
β : Type v
γ : Type w
π : ι → Type ?u.93197
r : α → α → Prop
a b : α
inst✝² : LinearOrder β
inst✝¹ : DecidableEq α
f : α → β
inj : Injective f
inst✝ : Decidable (a < b)
h : compare (f a) (f b) = compareOfLessAndEq (f a) (f b)
h✝³ : ¬f a < f b
h✝² : ¬f a = f b
h✝¹ : ¬a < b
h✝ : a = b
⊢ False

tactic: have : ¬ f a = f b := by rename_i h; exact inj.ne h
state_before: case inr.inl.inr.inr
ι : Type ?u.93186
α : Type u
β : Type v
γ : Type w
π : ι → Type ?u.93197
r : α → α → Prop
a b : α
inst✝² : LinearOrder β
inst✝¹ : DecidableEq α
f : α → β
inj : Injective f
inst✝ : Decidable (a < b)
h : compare (f a) (f b) = compareOfLessAndEq (f a) (f b)
h✝³ : ¬f a < f b
h✝² : f a = f b
h✝¹ : ¬a < b
h✝ : ¬a = b
⊢ False

tactic: contradiction
state_before: case inr.inl.inr.inr
ι : Type ?u.93186
α : Type u
β : Type v
γ : Type w
π : ι → Type ?u.93197
r : α → α → Prop
a b : α
inst✝² : LinearOrder β
inst✝¹ : DecidableEq α
f : α → β
inj : Injective f
inst✝ : Decidable (a < b)
h : compare (f a) (f b) = compareOfLessAndEq (f a) (f b)
h✝³ : ¬f a < f b
h✝² : f a = f b
h✝¹ : ¬a < b
h✝ : ¬a = b
this : ¬f a = f b
⊢ False

tactic: rename_i h
state_before: ι : Type ?u.93186
α : Type u
β : Type v
γ : Type w
π : ι → Type ?u.93197
r : α → α → Prop
a b : α
inst✝² : LinearOrder β
inst✝¹ : DecidableEq α
f : α → β
inj : Injective f
inst✝ : Decidable (a < b)
h : compare (f a) (f b) = compareOfLessAndEq (f a) (f b)
h✝³ : ¬f a < f b
h✝² : f a = f b
h✝¹ : ¬a < b
h✝ : ¬a = b
⊢ ¬f a = f b

tactic: exact inj.ne h
state_before: ι : Type ?u.93186
α : Type u
β : Type v
γ : Type w
π : ι → Type ?u.93197
r : α → α → Prop
a b : α
inst✝² : LinearOrder β
inst✝¹ : DecidableEq α
f : α → β
inj : Injective f
inst✝ : Decidable (a < b)
h✝³ : compare (f a) (f b) = compareOfLessAndEq (f a) (f b)
h✝² : ¬f a < f b
h✝¹ : f a = f b
h✝ : ¬a < b
h : ¬a = b
⊢ ¬f a = f b

tactic: have : f a = f b := by rename_i h; exact congrArg f h
state_before: case inr.inr.inr.inl
ι : Type ?u.93186
α : Type u
β : Type v
γ : Type w
π : ι → Type ?u.93197
r : α → α → Prop
a b : α
inst✝² : LinearOrder β
inst✝¹ : DecidableEq α
f : α → β
inj : Injective f
inst✝ : Decidable (a < b)
h : compare (f a) (f b) = compareOfLessAndEq (f a) (f b)
h✝³ : ¬f a < f b
h✝² : ¬f a = f b
h✝¹ : ¬a < b
h✝ : a = b
⊢ False

tactic: contradiction
state_before: case inr.inr.inr.inl
ι : Type ?u.93186
α : Type u
β : Type v
γ : Type w
π : ι → Type ?u.93197
r : α → α → Prop
a b : α
inst✝² : LinearOrder β
inst✝¹ : DecidableEq α
f : α → β
inj : Injective f
inst✝ : Decidable (a < b)
h : compare (f a) (f b) = compareOfLessAndEq (f a) (f b)
h✝³ : ¬f a < f b
h✝² : ¬f a = f b
h✝¹ : ¬a < b
h✝ : a = b
this : f a = f b
⊢ False

tactic: rename_i h
state_before: ι : Type ?u.93186
α : Type u
β : Type v
γ : Type w
π : ι → Type ?u.93197
r : α → α → Prop
a b : α
inst✝² : LinearOrder β
inst✝¹ : DecidableEq α
f : α → β
inj : Injective f
inst✝ : Decidable (a < b)
h : compare (f a) (f b) = compareOfLessAndEq (f a) (f b)
h✝³ : ¬f a < f b
h✝² : ¬f a = f b
h✝¹ : ¬a < b
h✝ : a = b
⊢ f a = f b

tactic: exact congrArg f h
state_before: ι : Type ?u.93186
α : Type u
β : Type v
γ : Type w
π : ι → Type ?u.93197
r : α → α → Prop
a b : α
inst✝² : LinearOrder β
inst✝¹ : DecidableEq α
f : α → β
inj : Injective f
inst✝ : Decidable (a < b)
h✝³ : compare (f a) (f b) = compareOfLessAndEq (f a) (f b)
h✝² : ¬f a < f b
h✝¹ : ¬f a = f b
h✝ : ¬a < b
h : a = b
⊢ f a = f b