Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

[Merged by Bors] - feat(combinatorics/quiver/covering): Definition of coverings and unique lifting of paths #17828

Closed
wants to merge 43 commits into from

Conversation

bottine
Copy link
Collaborator

@bottine bottine commented Dec 6, 2022

@bottine bottine requested a review from a team as a code owner December 6, 2022 06:56
begin
split,
{ rintro ⟨⟩, exact ⟨rfl, rfl⟩, },
{ induction x₀, induction x₁, rintro ⟨h, H⟩, cases h, cases H,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

untested

Suggested change
{ induction x₀, induction x₁, rintro ⟨h, H⟩, cases h, cases H,
{ induction x₀,
induction x₁,
rintro ⟨rfl, ⟨⟩⟩,

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't work, not sure why.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ induction x₀, induction x₁, rintro ⟨h, H⟩, cases h, cases H,
{ induction x₀,
induction x₁,
rintro ⟨rfl, rfl⟩,

maybe?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope :)

Copy link
Collaborator Author

@bottine bottine Feb 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm waiting for the CI to pass, but I can do

lemma ext_iff' {x₀ x₁ : sigma β} :
  x₀ = x₁ ↔ ∃ h : x₀.1 = x₁.1, h.rec_on x₀.2 = x₁.2 :=
begin
  split,
  { rintro ⟨⟩,
    exact ⟨rfl, rfl⟩, },
  { induction x₀,
    induction x₁,
    rintros ⟨h, H⟩,
    cases h,
    cases H,
    refl, }
end

if that's worth it? It's just one tactic per line, and refl instead of simp…

@bottine
Copy link
Collaborator Author

bottine commented Mar 2, 2023

@YaelDillies can you only "approve", or also put it on the maintainer queue? That would be nice

src/combinatorics/quiver/covering.lean Outdated Show resolved Hide resolved
src/combinatorics/quiver/covering.lean Outdated Show resolved Hide resolved
src/combinatorics/quiver/covering.lean Outdated Show resolved Hide resolved
src/combinatorics/quiver/covering.lean Outdated Show resolved Hide resolved
src/combinatorics/quiver/covering.lean Outdated Show resolved Hide resolved
Comment on lines 179 to 180
theorem prefunctor.path_star_bijective (hφ : φ.is_covering) (u : U) :
function.bijective (φ.path_star u) :=
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of assuming that there are inverses to the φ.star u and φ.costar u and showing that there's an inverse to the φ.path_star u, can you instead construct the inverses to the φ.path_star u from inverses for the φ.star u and φ.costar u?

Copy link
Collaborator Author

@bottine bottine Mar 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably can, but what's the gain? I guess it will make for a cleaner proof, let me see.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm hoping for a cleaner proof. But I don't know how much it will make you change your framework.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try for a bit and see if helps and is reasonably easy, and give up otherwise.

src/combinatorics/quiver/covering.lean Outdated Show resolved Hide resolved
@bottine
Copy link
Collaborator Author

bottine commented Mar 3, 2023

Edit. Got it down to this, and I think we won't get a shorter proof in the end, even though it might be a bit cleaner. I think I'll give that up, if it's not something crucial in your mind.

noncomputable! def prefunctor.path_star_bijective_aux
  {ψ : ∀ u, quiver.star (φ.obj u) → quiver.star u} (ψr : ∀ u, right_inverse (ψ u) (φ.star u)) :
  ∀ u (p : quiver.path_star (φ.obj u)), { q : quiver.path_star u // φ.path_star u q = p }
| u ⟨_, quiver.path.nil⟩ := ⟨⟨u, quiver.path.nil⟩, rfl⟩
| u ⟨v', @quiver.path.cons _ _ _ v v'' p e⟩ :=
  let
    hh := prefunctor.path_star_bijective_aux _ ⟨_, p⟩,
    f : quiver.star hh.val.1 := ψ _ ⟨v', e.cast (sigma.ext_iff'.mp hh.property).some.symm rfl⟩
  in
    ⟨ ⟨_, hh.val.2.cons f.2,⟩, by
      begin
        dsimp [f, hh], clear f hh,
        obtain ⟨⟨u', q⟩, h⟩ := prefunctor.path_star_bijective_aux _ ⟨_, p⟩,
        obtain ⟨rfl, rfl⟩ := h,
        let h := ψr u' ⟨_, e⟩,
        rw [sigma.ext_iff'] at h ⊢,
        obtain ⟨h', _⟩ := h,
        change ∃ (h : φ.obj _ = _), path.cast rfl h _ = _,
        refine ⟨h', _⟩,
        simpa only [path.cast_cons, path.cast_rfl_rfl, eq_self_iff_true, heq_iff_eq, true_and],
      end

@YaelDillies
Copy link
Collaborator

To me it looks like you could be creating the equivalence instead of proving bijectivity. What happens if you make is_covering data?

structure prefunctor.covering :=
(star_equiv : Π u, quiver.star u ≃ quiver.star (φ.obj u))
(costar_equiv : Π u, quiver.costar u ≃ quiver.costar (φ.obj u))

@bottine
Copy link
Collaborator Author

bottine commented Mar 4, 2023

Well, that specifically won't work, since you're just giving equivalences, and not proving that \phi.star and \phi.costar are part of equivalences.
But assuming we had a structure giving data for being a covering, I'm not sure we would get much shorter proofs, since most of it is about dealing with equalities of endpoints.

@YaelDillies
Copy link
Collaborator

My question was mostly whether you really wanted is_covering to be a Prop, rather than bundling the inverse as equiv does.

@bottine
Copy link
Collaborator Author

bottine commented Mar 4, 2023

Yeah. I don't really know but:

  • As I said, I feel like most of the length in proofs comes from having to deal with equalities of indices/vertices rather than the "prop instead of data" choice.
  • Inverses are unique, since the forward function is given, so I don't feel like bundling them would provide much.
    I've used this implementation a bit more here (see the bottom of the covering file) and it seems to work well enough as-is.

@YaelDillies
Copy link
Collaborator

Okay, but the inverse of an equiv is unique too, but we still give the inverse explicitly. Would you mind splitting is_covering to another PR? I'm happy with the rest.

@bottine
Copy link
Collaborator Author

bottine commented Mar 4, 2023

So, only keep the star/costar stuff?

@YaelDillies
Copy link
Collaborator

Let's ask for other people's opinions.
cc @kmill, @b-mehta

@kim-em kim-em added the modifies-synchronized-file This PR touches a files that has already been ported to mathlib4, and may need a synchronization PR. label Mar 28, 2023
@eric-wieser eric-wieser added the not-too-late This PR was ready at the point mathlib3 was frozen: we will try to merge it and port it to mathlib4 label Jul 15, 2023
@kim-em
Copy link
Collaborator

kim-em commented Jul 28, 2023

bors merge

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Jul 28, 2023
bors bot pushed a commit that referenced this pull request Jul 28, 2023
…ue lifting of paths (#17828)

Co-authored-by: Antoine Labelle <antoinelab01@gmail.com>



Co-authored-by: Rémi Bottinelli <bottine@users.noreply.github.com>
Co-authored-by: Kyle Miller <kmill31415@gmail.com>
Co-authored-by: antoinelab01 <66086247+antoinelab01@users.noreply.github.com>
Co-authored-by: Antoine Labelle <antoinelab01@gmail.com>
@bors
Copy link

bors bot commented Jul 28, 2023

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title feat(combinatorics/quiver/covering): Definition of coverings and unique lifting of paths [Merged by Bors] - feat(combinatorics/quiver/covering): Definition of coverings and unique lifting of paths Jul 28, 2023
@bors bors bot closed this Jul 28, 2023
@bors bors bot deleted the bottine/quiver_covering2 branch July 28, 2023 12:00
chenjulang added a commit to chenjulang/mathlib that referenced this pull request May 11, 2024
* commit '65a1391a0106c9204fe45bc73a039f056558cb83': (12443 commits)
  feat(data/{list,multiset,finset}/*): `attach` and `filter` lemmas (leanprover-community#18087)
  feat(combinatorics/simple_graph): More clique lemmas (leanprover-community#19203)
  feat(measure_theory/order/upper_lower): Order-connected sets in `ℝⁿ` are measurable (leanprover-community#16976)
  move old README.md to OLD_README.md
  doc: Add a warning mentioning Lean 4 to the readme (leanprover-community#19243)
  feat(topology/metric_space): diameter of pointwise zero and addition (leanprover-community#19028)
  feat(topology/algebra/order/liminf_limsup): Eventual boundedness of neighborhoods (leanprover-community#18629)
  feat(probability/independence): Independence of singletons (leanprover-community#18506)
  feat(combinatorics/set_family/ahlswede_zhang): Ahlswede-Zhang identity, part I (leanprover-community#18612)
  feat(data/finset/lattice): `sup'`/`inf'` lemmas (leanprover-community#18989)
  chore(order/liminf_limsup): Generalise and move lemmas (leanprover-community#18628)
  feat(algebraic_topology/dold_kan): The Dold-Kan equivalence for abelian categories (leanprover-community#17926)
  feat(data/sum/interval): The lexicographic sum of two locally finite orders is locally finite (leanprover-community#11352)
  feat(analysis/convex/proj_Icc): Extending convex functions (leanprover-community#18797)
  feat(algebraic_topology/dold_kan): The Dold-Kan equivalence for pseudoabelian categories (leanprover-community#17925)
  feat(measure_theory/measure/haar_quotient): the Unfolding Trick (leanprover-community#18863)
  feat(linear_algebra/orientation): add `orientation.reindex` (leanprover-community#19236)
  feat(combinatorics/quiver/covering): Definition of coverings and unique lifting of paths (leanprover-community#17828)
  feat(set_theory/game/pgame): small sets of pre-games / games / surreals are bounded (leanprover-community#15260)
  feat(tactic/positivity): Extension for `ite` (leanprover-community#17650)
  ...

# Conflicts:
#	README.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies-synchronized-file This PR touches a files that has already been ported to mathlib4, and may need a synchronization PR. not-too-late This PR was ready at the point mathlib3 was frozen: we will try to merge it and port it to mathlib4 ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) t-combinatorics Combinatorics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants