Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reflectors preserve coproducts and coequalizers #743

Merged
merged 2 commits into from
Apr 7, 2015

Conversation

mikeshulman
Copy link
Contributor

where "preserve" means "map them to colimits in the subuniverse, i.e reflected colimits". The proof for coequalizers was really hard; I kind of hope I am missing something obvious that would make it easier.

@spitters
Copy link
Member

LGTM

rewrite concat_pp_p in p.
apply moveR_Vp in p.
rewrite@A <- p; clear p.
(** for the next one, [rewrite@A] spins forever *)
Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds like a bug in rewrite@A. Any chance you can figure out what part it spins forever in? (Perhaps with Info 1 rewrite@A ...?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Info 1 rewrite@A also spins forever, and doesn't produce any output when I break it. Manually copy-pasting and stepping through suggests the problem is in left_associate_concat_in, which is a bit too much magic for me to understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

More specifically, here's some code that spins forever (where "forever" means "until I get bored and break it"):

  let lem' := preconcat_any @to_O_natural_compose in
  pose proof lem' as H.
  left_associate_concat_in H.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can get info to print something by doing, e.g., Info 1 try (timeout 2 <sometactic>). The timeout will make it not spin forever, and the try will cause the whole command to succeed, so Info should print things. I'll try to look into it when I get a chance, but I'm not sure when that will be.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That still doesn't print anything here.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's unfortunate. Assuming it is left_associate_concat_in that's being slow: there's a @?c that should be @ ?c, if the github display is right. Any chance adding a space there fixes it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Otherwise, you could stick let dummy := constr:($(idtac H ":" T)$) in after let T := type of H in, and seeing what try (timeout 2 ...) prints out. That will tell us if it's spinning on some unification problem (we get a few lines, and then it spins without printing anything) or because it keeps doing the same thing over and over (we get a continuous stream of lines until the time runs out). I don't have access to a computer right now, and am about to go to sleep, but I might get a chance to take a look at it this weekend, if these suggestions don't pan out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding a space doesn't change anything. let dummy results in Cannot infer an internal placeholder of type "Type" when compiling RewriteModuloAssociativity.

I opened a dedicated issue for this: #744.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, oops, make it constr:($(idtac H ":" T; exact tt)$). I'm out of practice with tactics in terms and forgot that the tactic actually has to build something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, that gets us somewhere. We have a continuous stream of lines which start like

(transport
   (fun _ : dst = to O C ((fun x : A => g0 (f x)) a) =>
    (fun _ : dst = to O C ((fun x : A => g0 (f x)) a) =>
     (fun _ : dst = to O C ((fun x : A => g0 (f x)) a) =>

so it does appear to be doing the same thing over and over (whatever that is).

@mikeshulman
Copy link
Contributor Author

I don't think this PR needs to wait on debugging rewrite@A, if it is otherwise ok.

JasonGross added a commit that referenced this pull request Apr 7, 2015
reflectors preserve coproducts and coequalizers
@JasonGross JasonGross merged commit 49e31e8 into HoTT:master Apr 7, 2015
@mikeshulman mikeshulman deleted the Ocolim branch April 7, 2015 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants