Skip to content

Commit d20fe0f

Browse files
committed
style(Combinatorics/SimpleGraph/Copy): proof style improvements
- IsContained.max_degree_le: have/exact → Nonempty.elim - free_bot: tactic → term mode via f.toHom.map_mem_edgeSet - subgraph_iso_bot: constructor/apply → exact ⟨..., ...⟩ term mode
1 parent 49d8074 commit d20fe0f

1 file changed

Lines changed: 11 additions & 17 deletions

File tree

Mathlib/Combinatorics/SimpleGraph/Copy.lean

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,8 @@ theorem Copy.max_degree_le [Fintype V] [Fintype W] [DecidableRel G.Adj] [Decidab
333333
grind [degree_le_maxDegree H (f v), f.degree_le v]
334334

335335
theorem IsContained.max_degree_le [Fintype V] [Fintype W] [DecidableRel G.Adj] [DecidableRel H.Adj]
336-
(h : G ⊑ H) : G.maxDegree ≤ H.maxDegree := by
337-
have ⟨f⟩ := h
338-
exact f.max_degree_le
336+
(h : G ⊑ H) : G.maxDegree ≤ H.maxDegree :=
337+
h.elim Copy.max_degree_le
339338

340339
@[gcongr]
341340
lemma maxDegree_mono {H : SimpleGraph V} [Fintype V] [DecidableRel G.Adj] [DecidableRel H.Adj]
@@ -375,12 +374,9 @@ lemma free_congr_right (e₂ : B ≃g C) : A.Free B ↔ A.Free C := free_congr .
375374

376375
alias ⟨_, Free.congr_right⟩ := free_congr_right
377376

378-
lemma free_bot (h : A ≠ ⊥) : A.Free (⊥ : SimpleGraph β) := by
379-
rw [← edgeSet_nonempty] at h
380-
intro ⟨f, hf⟩
381-
absurd f.map_mem_edgeSet h.choose_spec
382-
rw [edgeSet_bot]
383-
exact Set.notMem_empty (h.choose.map f)
377+
lemma free_bot (h : A ≠ ⊥) : A.Free (⊥ : SimpleGraph β) :=
378+
fun ⟨f⟩ ↦ absurd (f.toHom.map_mem_edgeSet (edgeSet_nonempty.mpr h).choose_spec)
379+
(edgeSet_bot ▸ Set.notMem_empty _)
384380

385381
end Free
386382

@@ -553,14 +549,12 @@ alias copyCount_le_labelledCopyCount := copyCount_le_labeledCopyCount
553549

554550
private lemma subgraph_iso_bot [Finite V] (Gx : G.Subgraph) (e : (⊥ : SimpleGraph V) ≃g Gx.coe) :
555551
Gx.verts = Set.univ ∧ Gx.Adj = ⊥ := by
556-
constructor
557-
· apply Set.eq_univ_of_forall
558-
intro v
559-
obtain ⟨w, hw⟩ := (Finite.injective_iff_surjective.mp
560-
(Subtype.val_injective.comp e.toEquiv.injective)) v
561-
exact hw ▸ (e.toEquiv w).prop
562-
· exact funext₂ fun a b => eq_false fun hadj =>
563-
absurd (e.symm.map_rel_iff.mpr hadj.coe) (by simp)
552+
exact ⟨Set.eq_univ_of_forall fun v ↦
553+
let ⟨w, hw⟩ := Finite.injective_iff_surjective.mp
554+
(Subtype.val_injective.comp e.toEquiv.injective) v
555+
hw ▸ (e.toEquiv w).prop,
556+
funext₂ fun a b => eq_false fun hadj =>
557+
absurd (e.symm.map_rel_iff.mpr hadj.coe) (by simp)⟩
564558

565559
private instance [Finite V] :
566560
Nonempty {G' : G.Subgraph // Nonempty ((⊥ : SimpleGraph V) ≃g G'.coe)} :=

0 commit comments

Comments
 (0)