combinatorics.quiver.connected_component
⟷
Mathlib.Combinatorics.Quiver.ConnectedComponent
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
Move
quiver.symmetrify
,quiver.has_reverse
,quiver.has_involutive_reverse
,quiver.reverse
,quiver.path.reverse
,quiver.symmetrify.of
,quiver.lift
,from combinatorics/quiver/connected_component.lean
to combinatorics/quiver/symmetrify.lean
.
Add
prefunctor.map_reverse
witnessing that a prefunctor maps reverses to reverses, and change the lemmas taking this property as an explicit argument.prefunctor.symmetrify
mapping a prefunctor to the prefunctor between symmetrifications,to combinatorics/quiver/symmetrify.lean
.
Move quiver.hom.to_pos
and quiver.hom.to_neg
from category_theory/groupoid/free_groupoid.lean
to combinatorics/quiver/symmetrify.lean
.
Add map_reverse
instance for functors between groupoids.
Co-authored-by: Rémi Bottinelli <bottine@users.noreply.github.com>
@@ -5,8 +5,7 @@ Authors: David Wärn
-/
import combinatorics.quiver.subquiver
import combinatorics.quiver.path
-import data.sum.basic
-
+import combinatorics.quiver.symmetric
/-!
## Weakly connected components
@@ -14,120 +13,18 @@ import data.sum.basic
> https://github.com/leanprover-community/mathlib4/pull/836
> Any changes to this file require a corresponding PR to mathlib4.
-For a quiver `V`, we build a quiver `symmetrify V` by adding a reversal of every edge.
-Informally, a path in `symmetrify V` corresponds to a 'zigzag' in `V`. This lets us
-define the type `weakly_connected_component V` as the quotient of `V` by the relation which
-identifies `a` with `b` if there is a path from `a` to `b` in `symmetrify V`. (These
-zigzags can be seen as a proof-relevant analogue of `eqv_gen`.)
+
+For a quiver `V`, we define the type `weakly_connected_component V` as the quotient of `V`
+by the relation which identifies `a` with `b` if there is a path from `a` to `b` in `symmetrify V`.
+(These zigzags can be seen as a proof-relevant analogue of `eqv_gen`.)
Strongly connected components have not yet been defined.
-/
-universes v u
+universes u
namespace quiver
-/-- A type synonym for the symmetrized quiver (with an arrow both ways for each original arrow).
- NB: this does not work for `Prop`-valued quivers. It requires `[quiver.{v+1} V]`. -/
-@[nolint has_nonempty_instance]
-def symmetrify (V) : Type u := V
-
-instance symmetrify_quiver (V : Type u) [quiver V] : quiver (symmetrify V) :=
-⟨λ a b : V, (a ⟶ b) ⊕ (b ⟶ a)⟩
-
-variables (V : Type u) [quiver.{v+1} V]
-
-/-- A quiver `has_reverse` if we can reverse an arrow `p` from `a` to `b` to get an arrow
- `p.reverse` from `b` to `a`.-/
-class has_reverse :=
-(reverse' : Π {a b : V}, (a ⟶ b) → (b ⟶ a))
-
-/-- Reverse the direction of an arrow. -/
-def reverse {V} [quiver.{v+1} V] [has_reverse V] {a b : V} : (a ⟶ b) → (b ⟶ a) :=
- has_reverse.reverse'
-
-/-- A quiver `has_involutive_reverse` if reversing twice is the identity.`-/
-class has_involutive_reverse extends has_reverse V :=
-(inv' : Π {a b : V} (f : a ⟶ b), reverse (reverse f) = f)
-
-@[simp] lemma reverse_reverse {V} [quiver.{v+1} V] [h : has_involutive_reverse V]
- {a b : V} (f : a ⟶ b) : reverse (reverse f) = f := by apply h.inv'
-
-variables {V}
-
-instance : has_reverse (symmetrify V) := ⟨λ a b e, e.swap⟩
-instance : has_involutive_reverse (symmetrify V) :=
-{ to_has_reverse := ⟨λ a b e, e.swap⟩,
- inv' := λ a b e, congr_fun sum.swap_swap_eq e }
-
-
-/-- Reverse the direction of a path. -/
-@[simp] def path.reverse [has_reverse V] {a : V} : Π {b}, path a b → path b a
-| a path.nil := path.nil
-| b (path.cons p e) := (reverse e).to_path.comp p.reverse
-
-@[simp] lemma path.reverse_to_path [has_reverse V] {a b : V} (f : a ⟶ b) :
- f.to_path.reverse = (reverse f).to_path := rfl
-
-@[simp] lemma path.reverse_comp [has_reverse V] {a b c : V} (p : path a b) (q : path b c) :
- (p.comp q).reverse = q.reverse.comp p.reverse := by
-{ induction q, { simp, }, { simp [q_ih], }, }
-
-@[simp] lemma path.reverse_reverse [h : has_involutive_reverse V] {a b : V} (p : path a b) :
- p.reverse.reverse = p := by
-{ induction p,
- { simp, },
- { simp only [path.reverse, path.reverse_comp, path.reverse_to_path, reverse_reverse, p_ih],
- refl, }, }
-
-/-- The inclusion of a quiver in its symmetrification -/
-def symmetrify.of : prefunctor V (symmetrify V) :=
-{ obj := id,
- map := λ X Y f, sum.inl f }
-
-/-- Given a quiver `V'` with reversible arrows, a prefunctor to `V'` can be lifted to one from
- `symmetrify V` to `V'` -/
-def symmetrify.lift {V' : Type*} [quiver V'] [has_reverse V'] (φ : prefunctor V V') :
- prefunctor (symmetrify V) V' :=
-{ obj := φ.obj,
- map := λ X Y f, sum.rec (λ fwd, φ.map fwd) (λ bwd, reverse (φ.map bwd)) f }
-
-lemma symmetrify.lift_spec (V' : Type*) [quiver V'] [has_reverse V'] (φ : prefunctor V V') :
- symmetrify.of.comp (symmetrify.lift φ) = φ :=
-begin
- fapply prefunctor.ext,
- { rintro X, refl, },
- { rintros X Y f, refl, },
-end
-
-lemma symmetrify.lift_reverse (V' : Type*) [quiver V'] [h : has_involutive_reverse V']
- (φ : prefunctor V V')
- {X Y : symmetrify V} (f : X ⟶ Y) :
- (symmetrify.lift φ).map (quiver.reverse f) = quiver.reverse ((symmetrify.lift φ).map f) :=
-begin
- dsimp [symmetrify.lift], cases f,
- { simp only, refl, },
- { simp only, rw h.inv', refl, }
-end
-
-/-- `lift φ` is the only prefunctor extending `φ` and preserving reverses. -/
-lemma symmetrify.lift_unique (V' : Type*) [quiver V'] [has_reverse V']
- (φ : prefunctor V V')
- (Φ : prefunctor (symmetrify V) V')
- (hΦ : symmetrify.of.comp Φ = φ)
- (hΦinv : ∀ {X Y : V} (f : X ⟶ Y), Φ.map (reverse f) = reverse (Φ.map f)) :
- Φ = symmetrify.lift φ :=
-begin
- subst_vars,
- fapply prefunctor.ext,
- { rintro X, refl, },
- { rintros X Y f,
- cases f,
- { refl, },
- { dsimp [symmetrify.lift,symmetrify.of],
- convert hΦinv (sum.inl f), }, },
-end
-
-variables (V)
+variables (V : Type*) [quiver.{u+1} V]
/-- Two vertices are related in the zigzag setoid if there is a
zigzag of arrows from one to the other. -/
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(first ported)
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,9 +3,9 @@ Copyright (c) 2021 David Wärn. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: David Wärn
-/
-import Mathbin.Combinatorics.Quiver.Subquiver
-import Mathbin.Combinatorics.Quiver.Path
-import Mathbin.Combinatorics.Quiver.Symmetric
+import Combinatorics.Quiver.Subquiver
+import Combinatorics.Quiver.Path
+import Combinatorics.Quiver.Symmetric
#align_import combinatorics.quiver.connected_component from "leanprover-community/mathlib"@"448144f7ae193a8990cb7473c9e9a01990f64ac7"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,16 +2,13 @@
Copyright (c) 2021 David Wärn. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: David Wärn
-
-! This file was ported from Lean 3 source module combinatorics.quiver.connected_component
-! leanprover-community/mathlib commit 448144f7ae193a8990cb7473c9e9a01990f64ac7
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Combinatorics.Quiver.Subquiver
import Mathbin.Combinatorics.Quiver.Path
import Mathbin.Combinatorics.Quiver.Symmetric
+#align_import combinatorics.quiver.connected_component from "leanprover-community/mathlib"@"448144f7ae193a8990cb7473c9e9a01990f64ac7"
+
/-!
## Weakly connected components
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -68,10 +68,12 @@ instance : CoeTC V (WeaklyConnectedComponent V) :=
instance [Inhabited V] : Inhabited (WeaklyConnectedComponent V) :=
⟨show V from default⟩
+#print Quiver.WeaklyConnectedComponent.eq /-
protected theorem eq (a b : V) :
(a : WeaklyConnectedComponent V) = b ↔ Nonempty (@Path (Symmetrify V) _ a b) :=
Quotient.eq''
#align quiver.weakly_connected_component.eq Quiver.WeaklyConnectedComponent.eq
+-/
end WeaklyConnectedComponent
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -83,7 +83,7 @@ variable {V}
/-- A wide subquiver `H` of `G.symmetrify` determines a wide subquiver of `G`, containing an
an arrow `e` if either `e` or its reversal is in `H`. -/
def wideSubquiverSymmetrify (H : WideSubquiver (Symmetrify V)) : WideSubquiver V := fun a b =>
- { e | Sum.inl e ∈ H a b ∨ Sum.inr e ∈ H b a }
+ {e | Sum.inl e ∈ H a b ∨ Sum.inr e ∈ H b a}
#align quiver.wide_subquiver_symmetrify Quiver.wideSubquiverSymmetrify
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -68,12 +68,6 @@ instance : CoeTC V (WeaklyConnectedComponent V) :=
instance [Inhabited V] : Inhabited (WeaklyConnectedComponent V) :=
⟨show V from default⟩
-/- warning: quiver.weakly_connected_component.eq -> Quiver.WeaklyConnectedComponent.eq is a dubious translation:
-lean 3 declaration is
- forall {V : Type.{u2}} [_inst_1 : Quiver.{succ u1, u2} V] (a : V) (b : V), Iff (Eq.{succ u2} (Quiver.WeaklyConnectedComponent.{u1, u2} V _inst_1) ((fun (a : Type.{u2}) (b : Type.{u2}) [self : HasLiftT.{succ u2, succ u2} a b] => self.0) V (Quiver.WeaklyConnectedComponent.{u1, u2} V _inst_1) (HasLiftT.mk.{succ u2, succ u2} V (Quiver.WeaklyConnectedComponent.{u1, u2} V _inst_1) (CoeTCₓ.coe.{succ u2, succ u2} V (Quiver.WeaklyConnectedComponent.{u1, u2} V _inst_1) (Quiver.WeaklyConnectedComponent.hasCoeT.{u1, u2} V _inst_1))) a) ((fun (a : Type.{u2}) (b : Type.{u2}) [self : HasLiftT.{succ u2, succ u2} a b] => self.0) V (Quiver.WeaklyConnectedComponent.{u1, u2} V _inst_1) (HasLiftT.mk.{succ u2, succ u2} V (Quiver.WeaklyConnectedComponent.{u1, u2} V _inst_1) (CoeTCₓ.coe.{succ u2, succ u2} V (Quiver.WeaklyConnectedComponent.{u1, u2} V _inst_1) (Quiver.WeaklyConnectedComponent.hasCoeT.{u1, u2} V _inst_1))) b)) (Nonempty.{max (succ u2) (succ u1)} (Quiver.Path.{succ u1, u2} (Quiver.Symmetrify.{u2} V) (Quiver.symmetrifyQuiver.{u2, u1} V _inst_1) a b))
-but is expected to have type
- forall {V : Type.{u1}} [_inst_1 : Quiver.{succ u2, u1} V] (a : V) (b : V), Iff (Eq.{succ u1} (Quiver.WeaklyConnectedComponent.{u2, u1} V _inst_1) (Quiver.WeaklyConnectedComponent.mk.{u2, u1} V _inst_1 a) (Quiver.WeaklyConnectedComponent.mk.{u2, u1} V _inst_1 b)) (Nonempty.{max (succ u1) (succ u2)} (Quiver.Path.{succ u2, u1} (Quiver.Symmetrify.{u1} V) (Quiver.symmetrifyQuiver.{u1, u2} V _inst_1) a b))
-Case conversion may be inaccurate. Consider using '#align quiver.weakly_connected_component.eq Quiver.WeaklyConnectedComponent.eqₓ'. -/
protected theorem eq (a b : V) :
(a : WeaklyConnectedComponent V) = b ↔ Nonempty (@Path (Symmetrify V) _ a b) :=
Quotient.eq''
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -23,7 +23,7 @@ universe v u
namespace Quiver
-variable (V : Type _) [Quiver.{u+1} V]
+variable (V : Type*) [Quiver.{u+1} V]
/-- Two vertices are related in the zigzag setoid if there is a
zigzag of arrows from one to the other. -/
@@ -66,7 +66,7 @@ variable {V}
-- Without the explicit universe level in `Quiver.{v+1}` Lean comes up with
-- `Quiver.{max u_2 u_3 + 1}`. This causes problems elsewhere, so we write `Quiver.{v+1}`.
/-- A wide subquiver `H` of `Symmetrify V` determines a wide subquiver of `V`, containing an
- an arrow `e` if either `e` or its reversal is in `H`. -/
+ arrow `e` if either `e` or its reversal is in `H`. -/
def wideSubquiverSymmetrify (H : WideSubquiver (Symmetrify V)) : WideSubquiver V :=
fun _ _ ↦ { e | H _ _ (Sum.inl e) ∨ H _ _ (Sum.inr e) }
#align quiver.wide_subquiver_symmetrify Quiver.wideSubquiverSymmetrify
Briefly during the port we were adding "Ported by" headers, but only ~60 / 3000 files ended up with such a header.
I propose deleting them.
We could consider adding these uniformly via a script, as part of the great history rewrite...?
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -2,7 +2,6 @@
Copyright (c) 2021 David Wärn. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: David Wärn
-Ported by: Joël Riou
-/
import Mathlib.Combinatorics.Quiver.Subquiver
import Mathlib.Combinatorics.Quiver.Path
@@ -3,16 +3,13 @@ Copyright (c) 2021 David Wärn. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: David Wärn
Ported by: Joël Riou
-
-! This file was ported from Lean 3 source module combinatorics.quiver.connected_component
-! leanprover-community/mathlib commit 18a5306c091183ac90884daa9373fa3b178e8607
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Combinatorics.Quiver.Subquiver
import Mathlib.Combinatorics.Quiver.Path
import Mathlib.Combinatorics.Quiver.Symmetric
+#align_import combinatorics.quiver.connected_component from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607"
+
/-!
## Weakly connected components
This PR is the result of a slight variant on the following "algorithm"
_
and make all uppercase letters into lowercase_
and make all uppercase letters into lowercase(original_lean3_name, OriginalLean4Name)
#align
statement just before the next empty line#align
statement to have been inserted too early)@@ -34,12 +34,14 @@ variable (V : Type _) [Quiver.{u+1} V]
def zigzagSetoid : Setoid V :=
⟨fun a b ↦ Nonempty (@Path (Symmetrify V) _ a b), fun _ ↦ ⟨Path.nil⟩, fun ⟨p⟩ ↦
⟨p.reverse⟩, fun ⟨p⟩ ⟨q⟩ ↦ ⟨p.comp q⟩⟩
+#align quiver.zigzag_setoid Quiver.zigzagSetoid
/-- The type of weakly connected components of a directed graph. Two vertices are
in the same weakly connected component if there is a zigzag of arrows from one
to the other. -/
def WeaklyConnectedComponent : Type _ :=
Quotient (zigzagSetoid V)
+#align quiver.weakly_connected_component Quiver.WeaklyConnectedComponent
namespace WeaklyConnectedComponent
@@ -48,6 +50,7 @@ variable {V}
/-- The weakly connected component corresponding to a vertex. -/
protected def mk : V → WeaklyConnectedComponent V :=
@Quotient.mk' _ (zigzagSetoid V)
+#align quiver.weakly_connected_component.mk Quiver.WeaklyConnectedComponent.mk
instance : CoeTC V (WeaklyConnectedComponent V) :=
⟨WeaklyConnectedComponent.mk⟩
@@ -58,6 +61,7 @@ instance [Inhabited V] : Inhabited (WeaklyConnectedComponent V) :=
protected theorem eq (a b : V) :
(a : WeaklyConnectedComponent V) = b ↔ Nonempty (@Path (Symmetrify V) _ a b) :=
Quotient.eq''
+#align quiver.weakly_connected_component.eq Quiver.WeaklyConnectedComponent.eq
end WeaklyConnectedComponent
@@ -69,5 +73,6 @@ variable {V}
an arrow `e` if either `e` or its reversal is in `H`. -/
def wideSubquiverSymmetrify (H : WideSubquiver (Symmetrify V)) : WideSubquiver V :=
fun _ _ ↦ { e | H _ _ (Sum.inl e) ∨ H _ _ (Sum.inr e) }
+#align quiver.wide_subquiver_symmetrify Quiver.wideSubquiverSymmetrify
end Quiver
@@ -57,7 +57,7 @@ instance [Inhabited V] : Inhabited (WeaklyConnectedComponent V) :=
protected theorem eq (a b : V) :
(a : WeaklyConnectedComponent V) = b ↔ Nonempty (@Path (Symmetrify V) _ a b) :=
- Quotient.eq'
+ Quotient.eq''
end WeaklyConnectedComponent
@@ -71,4 +71,3 @@ def wideSubquiverSymmetrify (H : WideSubquiver (Symmetrify V)) : WideSubquiver V
fun _ _ ↦ { e | H _ _ (Sum.inl e) ∨ H _ _ (Sum.inr e) }
end Quiver
-
Note that the SHA for Data.Set.Function
has not be bumped to HEAD
since some functions introduced in https://github.com/leanprover-community/mathlib/commit/d1723c047a091ae3fca0af8aeab1743e1a898611 are missing.
@@ -5,7 +5,7 @@ Authors: David Wärn
Ported by: Joël Riou
! This file was ported from Lean 3 source module combinatorics.quiver.connected_component
-! leanprover-community/mathlib commit 70d50ecfd4900dd6d328da39ab7ebd516abe4025
+! leanprover-community/mathlib commit 18a5306c091183ac90884daa9373fa3b178e8607
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
Fix a lot of wrong casing mostly in the docstrings but also sometimes in def/theorem names. E.g. fin 2 --> Fin 2
, add_monoid_hom --> AddMonoidHom
Remove \n
from to_additive
docstrings that were inserted by mathport.
Move files and directories with Gcd
and Smul
to GCD
and SMul
@@ -244,7 +244,7 @@ end Push
/-- A quiver is preconnected iff there exists a path between any pair of
vertices.
-Note that if `V` doesn't `has_reverse`, then the definition is stronger than
+Note that if `V` doesn't `HasReverse`, then the definition is stronger than
simply having a preconnected underlying `simple_graph`, since a path in one
direction doesn't induce one in the other.
-/
This file was refactored in this simultaneous Mathlib3 PR: https://github.com/leanprover-community/mathlib/commit/706d88f2b8fdfeb0b22796433d7a6c1a010af9f2 so I added the header which matches this PR's SHA.
@@ -3,6 +3,11 @@ Copyright (c) 2021 David Wärn. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: David Wärn, Antoine Labelle, Rémi Bottinelli
Ported by: Joël Riou, Rémi Bottinelli
+
+! This file was ported from Lean 3 source module combinatorics.quiver.connected_component
+! leanprover-community/mathlib commit 706d88f2b8fdfeb0b22796433d7a6c1a010af9f2
+! Please do not edit these lines, except to modify the commit id
+! if you have ported upstream changes.
-/
import Mathlib.Combinatorics.Quiver.Path
import Mathlib.Combinatorics.Quiver.Push
@@ -248,4 +253,3 @@ def IsPreconnected (V) [Quiver.{u + 1} V] :=
#align quiver.is_preconnected Quiver.IsPreconnected
end Quiver
-
The script used to do this is included. The yaml file was obtained from https://raw.githubusercontent.com/wiki/leanprover-community/mathlib/mathlib4-port-status.md
@@ -3,6 +3,11 @@ Copyright (c) 2021 David Wärn. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: David Wärn
Ported by: Joël Riou
+
+! This file was ported from Lean 3 source module combinatorics.quiver.connected_component
+! leanprover-community/mathlib commit 70d50ecfd4900dd6d328da39ab7ebd516abe4025
+! Please do not edit these lines, except to modify the commit id
+! if you have ported upstream changes.
-/
import Mathlib.Combinatorics.Quiver.Subquiver
import Mathlib.Combinatorics.Quiver.Path
All dependencies are ported!