Theorem: NonemptyFinLinOrdCat.mono_iff_injective
File: Mathlib/Order/Category/NonemptyFinLinOrdCat.lean

tactic: refine' ⟨_, ConcreteCategory.mono_of_injective f⟩
state_before: A B : NonemptyFinLinOrdCat
f : A ⟶ B
⊢ Mono f ↔ Function.Injective ↑f

tactic: intro
state_before: A B : NonemptyFinLinOrdCat
f : A ⟶ B
⊢ Mono f → Function.Injective ↑f

tactic: intro a₁ a₂ h
state_before: A B : NonemptyFinLinOrdCat
f : A ⟶ B
a✝ : Mono f
⊢ Function.Injective ↑f

tactic: let X := NonemptyFinLinOrdCat.of (ULift (Fin 1))
state_before: A B : NonemptyFinLinOrdCat
f : A ⟶ B
a✝ : Mono f
a₁ a₂ : ↑A
h : ↑f a₁ = ↑f a₂
⊢ a₁ = a₂

tactic: let g₁ : X ⟶ A := ⟨fun _ => a₁, fun _ _  _ => by rfl⟩
state_before: A B : NonemptyFinLinOrdCat
f : A ⟶ B
a✝ : Mono f
a₁ a₂ : ↑A
h : ↑f a₁ = ↑f a₂
X : NonemptyFinLinOrdCat := of (ULift (Fin 1))
⊢ a₁ = a₂

tactic: let g₂ : X ⟶ A := ⟨fun _ => a₂, fun _ _  _ => by rfl⟩
state_before: A B : NonemptyFinLinOrdCat
f : A ⟶ B
a✝ : Mono f
a₁ a₂ : ↑A
h : ↑f a₁ = ↑f a₂
X : NonemptyFinLinOrdCat := of (ULift (Fin 1))
g₁ : X ⟶ A := { toFun := fun x => a₁, monotone' := (_ : ∀ (x x_1 : ↑X), x ≤ x_1 → (fun x => a₁) x ≤ (fun x => a₁) x) }
⊢ a₁ = a₂

tactic: change g₁ (ULift.up (0 : Fin 1)) = g₂ (ULift.up (0 : Fin 1))
state_before: A B : NonemptyFinLinOrdCat
f : A ⟶ B
a✝ : Mono f
a₁ a₂ : ↑A
h : ↑f a₁ = ↑f a₂
X : NonemptyFinLinOrdCat := of (ULift (Fin 1))
g₁ : X ⟶ A := { toFun := fun x => a₁, monotone' := (_ : ∀ (x x_1 : ↑X), x ≤ x_1 → (fun x => a₁) x ≤ (fun x => a₁) x) }
g₂ : X ⟶ A := { toFun := fun x => a₂, monotone' := (_ : ∀ (x x_1 : ↑X), x ≤ x_1 → (fun x => a₂) x ≤ (fun x => a₂) x) }
⊢ a₁ = a₂

tactic: have eq : g₁ ≫ f = g₂ ≫ f := by
  ext
  exact h
state_before: A B : NonemptyFinLinOrdCat
f : A ⟶ B
a✝ : Mono f
a₁ a₂ : ↑A
h : ↑f a₁ = ↑f a₂
X : NonemptyFinLinOrdCat := of (ULift (Fin 1))
g₁ : X ⟶ A := { toFun := fun x => a₁, monotone' := (_ : ∀ (x x_1 : ↑X), x ≤ x_1 → (fun x => a₁) x ≤ (fun x => a₁) x) }
g₂ : X ⟶ A := { toFun := fun x => a₂, monotone' := (_ : ∀ (x x_1 : ↑X), x ≤ x_1 → (fun x => a₂) x ≤ (fun x => a₂) x) }
⊢ ↑g₁ { down := 0 } = ↑g₂ { down := 0 }

tactic: rw [cancel_mono] at eq
state_before: A B : NonemptyFinLinOrdCat
f : A ⟶ B
a✝ : Mono f
a₁ a₂ : ↑A
h : ↑f a₁ = ↑f a₂
X : NonemptyFinLinOrdCat := of (ULift (Fin 1))
g₁ : X ⟶ A := { toFun := fun x => a₁, monotone' := (_ : ∀ (x x_1 : ↑X), x ≤ x_1 → (fun x => a₁) x ≤ (fun x => a₁) x) }
g₂ : X ⟶ A := { toFun := fun x => a₂, monotone' := (_ : ∀ (x x_1 : ↑X), x ≤ x_1 → (fun x => a₂) x ≤ (fun x => a₂) x) }
eq : g₁ ≫ f = g₂ ≫ f
⊢ ↑g₁ { down := 0 } = ↑g₂ { down := 0 }

tactic: rw [eq]
state_before: A B : NonemptyFinLinOrdCat
f : A ⟶ B
a✝ : Mono f
a₁ a₂ : ↑A
h : ↑f a₁ = ↑f a₂
X : NonemptyFinLinOrdCat := of (ULift (Fin 1))
g₁ : X ⟶ A := { toFun := fun x => a₁, monotone' := (_ : ∀ (x x_1 : ↑X), x ≤ x_1 → (fun x => a₁) x ≤ (fun x => a₁) x) }
g₂ : X ⟶ A := { toFun := fun x => a₂, monotone' := (_ : ∀ (x x_1 : ↑X), x ≤ x_1 → (fun x => a₂) x ≤ (fun x => a₂) x) }
eq : g₁ = g₂
⊢ ↑g₁ { down := 0 } = ↑g₂ { down := 0 }

tactic: rfl
state_before: A B : NonemptyFinLinOrdCat
f : A ⟶ B
a✝ : Mono f
a₁ a₂ : ↑A
h : ↑f a₁ = ↑f a₂
X : NonemptyFinLinOrdCat := of (ULift (Fin 1))
x✝² x✝¹ : ↑X
x✝ : x✝² ≤ x✝¹
⊢ (fun x => a₁) x✝² ≤ (fun x => a₁) x✝¹

tactic: rfl
state_before: A B : NonemptyFinLinOrdCat
f : A ⟶ B
a✝ : Mono f
a₁ a₂ : ↑A
h : ↑f a₁ = ↑f a₂
X : NonemptyFinLinOrdCat := of (ULift (Fin 1))
g₁ : X ⟶ A := { toFun := fun x => a₁, monotone' := (_ : ∀ (x x_1 : ↑X), x ≤ x_1 → (fun x => a₁) x ≤ (fun x => a₁) x) }
x✝² x✝¹ : ↑X
x✝ : x✝² ≤ x✝¹
⊢ (fun x => a₂) x✝² ≤ (fun x => a₂) x✝¹

tactic: ext
state_before: A B : NonemptyFinLinOrdCat
f : A ⟶ B
a✝ : Mono f
a₁ a₂ : ↑A
h : ↑f a₁ = ↑f a₂
X : NonemptyFinLinOrdCat := of (ULift (Fin 1))
g₁ : X ⟶ A := { toFun := fun x => a₁, monotone' := (_ : ∀ (x x_1 : ↑X), x ≤ x_1 → (fun x => a₁) x ≤ (fun x => a₁) x) }
g₂ : X ⟶ A := { toFun := fun x => a₂, monotone' := (_ : ∀ (x x_1 : ↑X), x ≤ x_1 → (fun x => a₂) x ≤ (fun x => a₂) x) }
⊢ g₁ ≫ f = g₂ ≫ f

tactic: exact h
state_before: case w
A B : NonemptyFinLinOrdCat
f : A ⟶ B
a✝ : Mono f
a₁ a₂ : ↑A
h : ↑f a₁ = ↑f a₂
X : NonemptyFinLinOrdCat := of (ULift (Fin 1))
g₁ : X ⟶ A := { toFun := fun x => a₁, monotone' := (_ : ∀ (x x_1 : ↑X), x ≤ x_1 → (fun x => a₁) x ≤ (fun x => a₁) x) }
g₂ : X ⟶ A := { toFun := fun x => a₂, monotone' := (_ : ∀ (x x_1 : ↑X), x ≤ x_1 → (fun x => a₂) x ≤ (fun x => a₂) x) }
x✝ : (forget NonemptyFinLinOrdCat).obj X
⊢ (forget NonemptyFinLinOrdCat).map (g₁ ≫ f) x✝ = (forget NonemptyFinLinOrdCat).map (g₂ ≫ f) x✝