Skip to content

Commit

Permalink
chore(Combinatorics): remove remaining use of autoImplicit (#14356)
Browse files Browse the repository at this point in the history
  • Loading branch information
grunweg committed Jul 3, 2024
1 parent e66c5a9 commit 11cb43e
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions Mathlib/Combinatorics/SimpleGraph/Prod.lean
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,20 @@ def boxProd (G : SimpleGraph α) (H : SimpleGraph β) : SimpleGraph (α × β) w
and `(a, b₁)` and `(a, b₂)` if `H` relates `b₁` and `b₂`. -/
infixl:70 " □ " => boxProd

set_option autoImplicit true in
@[simp]
theorem boxProd_adj : (G □ H).Adj x y ↔ G.Adj x.1 y.1 ∧ x.2 = y.2 ∨ H.Adj x.2 y.2 ∧ x.1 = y.1 :=
theorem boxProd_adj {x y : α × β} :
(G □ H).Adj x y ↔ G.Adj x.1 y.1 ∧ x.2 = y.2 ∨ H.Adj x.2 y.2 ∧ x.1 = y.1 :=
Iff.rfl
#align simple_graph.box_prod_adj SimpleGraph.boxProd_adj

set_option autoImplicit true in
--@[simp] Porting note (#10618): `simp` can prove
theorem boxProd_adj_left : (G □ H).Adj (a₁, b) (a₂, b) ↔ G.Adj a₁ a₂ := by
theorem boxProd_adj_left {a₁ : α} {b : β} {a₂ : α} :
(G □ H).Adj (a₁, b) (a₂, b) ↔ G.Adj a₁ a₂ := by
simp only [boxProd_adj, and_true, SimpleGraph.irrefl, false_and, or_false]
#align simple_graph.box_prod_adj_left SimpleGraph.boxProd_adj_left

set_option autoImplicit true in
--@[simp] Porting note (#10618): `simp` can prove
theorem boxProd_adj_right : (G □ H).Adj (a, b₁) (a, b₂) ↔ H.Adj b₁ b₂ := by
theorem boxProd_adj_right {a : α} {b₁ b₂ : β} : (G □ H).Adj (a, b₁) (a, b₂) ↔ H.Adj b₁ b₂ := by
simp only [boxProd_adj, SimpleGraph.irrefl, false_and, and_true, false_or]
#align simple_graph.box_prod_adj_right SimpleGraph.boxProd_adj_right

Expand Down Expand Up @@ -108,17 +107,15 @@ namespace Walk

variable {G}

set_option autoImplicit true in
/-- Turn a walk on `G` into a walk on `G □ H`. -/
protected def boxProdLeft (b : β) : G.Walk a₁ a₂ → (G □ H).Walk (a₁, b) (a₂, b) :=
protected def boxProdLeft {a₁ a₂ : α} (b : β) : G.Walk a₁ a₂ → (G □ H).Walk (a₁, b) (a₂, b) :=
Walk.map (G.boxProdLeft H b).toHom
#align simple_graph.walk.box_prod_left SimpleGraph.Walk.boxProdLeft

variable (G) {H}

set_option autoImplicit true in
/-- Turn a walk on `H` into a walk on `G □ H`. -/
protected def boxProdRight (a : α) : H.Walk b₁ b₂ → (G □ H).Walk (a, b₁) (a, b₂) :=
protected def boxProdRight {b₁ b₂ : β} (a : α) : H.Walk b₁ b₂ → (G □ H).Walk (a, b₁) (a, b₂) :=
Walk.map (G.boxProdRight H a).toHom
#align simple_graph.walk.box_prod_right SimpleGraph.Walk.boxProdRight

Expand All @@ -144,9 +141,8 @@ def ofBoxProdRight [DecidableEq α] [DecidableRel H.Adj] {x y : α × β} :
(fun hG => hG.2 ▸ w.ofBoxProdRight)
#align simple_graph.walk.of_box_prod_right SimpleGraph.Walk.ofBoxProdRight

set_option autoImplicit true in
@[simp]
theorem ofBoxProdLeft_boxProdLeft [DecidableEq β] [DecidableRel G.Adj] {a₁ a₂ : α} :
theorem ofBoxProdLeft_boxProdLeft [DecidableEq β] [DecidableRel G.Adj] {a₁ a₂ : α} {b : β} :
∀ (w : G.Walk a₁ a₂), (w.boxProdLeft H b).ofBoxProdLeft = w
| nil => rfl
| cons' x y z h w => by
Expand All @@ -155,9 +151,8 @@ theorem ofBoxProdLeft_boxProdLeft [DecidableEq β] [DecidableRel G.Adj] {a₁ a
· exact ⟨h, rfl⟩
#align simple_graph.walk.of_box_prod_left_box_prod_left SimpleGraph.Walk.ofBoxProdLeft_boxProdLeft

set_option autoImplicit true in
@[simp]
theorem ofBoxProdLeft_boxProdRight [DecidableEq α] [DecidableRel G.Adj] {b₁ b₂ : α} :
theorem ofBoxProdLeft_boxProdRight [DecidableEq α] [DecidableRel G.Adj] {a b₁ b₂ : α} :
∀ (w : G.Walk b₁ b₂), (w.boxProdRight G a).ofBoxProdRight = w
| nil => rfl
| cons' x y z h w => by
Expand Down

0 comments on commit 11cb43e

Please sign in to comment.