ZAIDX11 commited on
Commit
70f18dc
·
verified ·
1 Parent(s): 7a1fb1a

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +80 -0
  2. backend/core/.rustup/downloads/371a98be3e239f760a7f0e87793ad0a871cdc2e607590cc47514d91fd8d1383c +3 -0
  3. backend/core/.rustup/downloads/8c0a40a5411746ff6600d93acd16652fef56702196bb25b940ff399d7e107f40 +3 -0
  4. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Crypto/Rewriter/Passes/NoSelect.vo +3 -0
  5. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Crypto/Rewriter/Passes/RelaxBitwidthAdcSbb.vo +3 -0
  6. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Crypto/Util/ZUtil/Modulo.vo +3 -0
  7. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Crypto/Util/ZUtil/Morphisms.vo +3 -0
  8. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Crypto/Util/ZUtil/Shift.vo +3 -0
  9. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Colimits/Colimit_Pushout.vo +3 -0
  10. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Colimits/Colimit_Pushout_Flattening.vo +3 -0
  11. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Colimits/Colimit_Sigma.vo +3 -0
  12. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Diagrams/Sequence.v +52 -0
  13. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Diagrams/Sequence.vo +0 -0
  14. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Diagrams/Span.v +36 -0
  15. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Diagrams/Span.vo +0 -0
  16. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Equiv/BiInv.v +55 -0
  17. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Equiv/BiInv.vo +0 -0
  18. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Equiv/PathSplit.v +126 -0
  19. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Equiv/PathSplit.vo +0 -0
  20. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Equiv/Relational.v +68 -0
  21. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Equiv/Relational.vo +0 -0
  22. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/Flattening.v +209 -0
  23. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/FreeIntQuotient.v +102 -0
  24. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/FreeIntQuotient.vo +0 -0
  25. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/Interval.v +52 -0
  26. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/Interval.vo +0 -0
  27. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/SetCone.v +16 -0
  28. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/SetCone.vo +0 -0
  29. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/epi.v +182 -0
  30. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/epi.vo +0 -0
  31. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/iso.v +41 -0
  32. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/iso.vo +0 -0
  33. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/quotient.v +328 -0
  34. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/surjective_factor.v +37 -0
  35. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/surjective_factor.vo +0 -0
  36. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/unique_choice.v +31 -0
  37. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/unique_choice.vo +0 -0
  38. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Pointed/pFiber.vo +3 -0
  39. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Pointed/pMap.vo +3 -0
  40. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Spaces/BAut/Bool.v +445 -0
  41. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Spaces/BAut/Bool.vo +3 -0
  42. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Spaces/BAut/Cantor.vo +3 -0
  43. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Spaces/Card.vo +3 -0
  44. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Spaces/No/Addition.vo +3 -0
  45. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Spaces/Universe.v +217 -0
  46. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Types/Paths.vo +3 -0
  47. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Types/Prod.vo +3 -0
  48. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Types/Sigma.vo +3 -0
  49. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/WildCat/Bifunctor.vo +3 -0
  50. backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/WildCat/Displayed.vo +3 -0
.gitattributes CHANGED
@@ -1483,3 +1483,83 @@ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/iris/proofmode/class
1483
  backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/mathcomp/real_closed/complex.vo filter=lfs diff=lfs merge=lfs -text
1484
  backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Spaces/TwoSphere.vo filter=lfs diff=lfs merge=lfs -text
1485
  backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/iris/bi/monpred.vo filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1483
  backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/mathcomp/real_closed/complex.vo filter=lfs diff=lfs merge=lfs -text
1484
  backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Spaces/TwoSphere.vo filter=lfs diff=lfs merge=lfs -text
1485
  backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/iris/bi/monpred.vo filter=lfs diff=lfs merge=lfs -text
1486
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/WildCat/Bifunctor.vo filter=lfs diff=lfs merge=lfs -text
1487
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MenhirLib/Interpreter_complete.vo filter=lfs diff=lfs merge=lfs -text
1488
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MenhirLib/Interpreter_correct.vo filter=lfs diff=lfs merge=lfs -text
1489
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MenhirLib/Main.vo filter=lfs diff=lfs merge=lfs -text
1490
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MenhirLib/Validator_complete.vo filter=lfs diff=lfs merge=lfs -text
1491
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MenhirLib/Validator_safe.vo filter=lfs diff=lfs merge=lfs -text
1492
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Common/BasicAst.vo filter=lfs diff=lfs merge=lfs -text
1493
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Common/config.vo filter=lfs diff=lfs merge=lfs -text
1494
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Common/Environment.vo filter=lfs diff=lfs merge=lfs -text
1495
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Common/EnvironmentReflect.vo filter=lfs diff=lfs merge=lfs -text
1496
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Common/EnvironmentTyping.vo filter=lfs diff=lfs merge=lfs -text
1497
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Common/Kernames.vo filter=lfs diff=lfs merge=lfs -text
1498
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Common/MonadBasicAst.vo filter=lfs diff=lfs merge=lfs -text
1499
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Common/Reflect.vo filter=lfs diff=lfs merge=lfs -text
1500
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Common/uGraph.vo filter=lfs diff=lfs merge=lfs -text
1501
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Common/Universes.vo filter=lfs diff=lfs merge=lfs -text
1502
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Common/UniversesDec.vo filter=lfs diff=lfs merge=lfs -text
1503
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Erasure/EArities.vo filter=lfs diff=lfs merge=lfs -text
1504
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Erasure/EAst.vo filter=lfs diff=lfs merge=lfs -text
1505
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Erasure/EAstUtils.vo filter=lfs diff=lfs merge=lfs -text
1506
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Erasure/ECoInductiveToInductive.vo filter=lfs diff=lfs merge=lfs -text
1507
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Erasure/EConstructorsAsBlocks.vo filter=lfs diff=lfs merge=lfs -text
1508
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Erasure/EDeps.vo filter=lfs diff=lfs merge=lfs -text
1509
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Erasure/EEtaExpanded.vo filter=lfs diff=lfs merge=lfs -text
1510
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Erasure/EEtaExpandedFix.vo filter=lfs diff=lfs merge=lfs -text
1511
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Erasure/EGenericGlobalMap.vo filter=lfs diff=lfs merge=lfs -text
1512
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Erasure/EGenericMapEnv.vo filter=lfs diff=lfs merge=lfs -text
1513
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Erasure/EImplementBox.vo filter=lfs diff=lfs merge=lfs -text
1514
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MetaCoq/Erasure/EInduction.vo filter=lfs diff=lfs merge=lfs -text
1515
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/mathcomp/solvable/gfunctor.vo filter=lfs diff=lfs merge=lfs -text
1516
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/mathcomp/algebra/qpoly.vo filter=lfs diff=lfs merge=lfs -text
1517
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/iris/algebra/view.vo filter=lfs diff=lfs merge=lfs -text
1518
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/iris/heap_lang/lib/spin_lock.vo filter=lfs diff=lfs merge=lfs -text
1519
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Types/Paths.vo filter=lfs diff=lfs merge=lfs -text
1520
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/mathcomp/fingroup/automorphism.vo filter=lfs diff=lfs merge=lfs -text
1521
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MathClasses/implementations/semiring_pairs.vo filter=lfs diff=lfs merge=lfs -text
1522
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Interval/Interval/Transcend.vo filter=lfs diff=lfs merge=lfs -text
1523
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Pointed/pFiber.vo filter=lfs diff=lfs merge=lfs -text
1524
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/mathcomp/solvable/gseries.vo filter=lfs diff=lfs merge=lfs -text
1525
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/WildCat/Displayed.vo filter=lfs diff=lfs merge=lfs -text
1526
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Spaces/BAut/Bool.vo filter=lfs diff=lfs merge=lfs -text
1527
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/iris/heap_lang/lib/ticket_lock.vo filter=lfs diff=lfs merge=lfs -text
1528
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/WildCat/TwoOneCat.vo filter=lfs diff=lfs merge=lfs -text
1529
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MathClasses/theory/rationals.vo filter=lfs diff=lfs merge=lfs -text
1530
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Types/Prod.vo filter=lfs diff=lfs merge=lfs -text
1531
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Interval/Tactics/Integral_helper.vo filter=lfs diff=lfs merge=lfs -text
1532
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Spaces/Card.vo filter=lfs diff=lfs merge=lfs -text
1533
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Interval/Float/Specific_ops.vo filter=lfs diff=lfs merge=lfs -text
1534
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/mathcomp/algebra/rat.vo filter=lfs diff=lfs merge=lfs -text
1535
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Colimits/Colimit_Pushout.vo filter=lfs diff=lfs merge=lfs -text
1536
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Colimits/Colimit_Pushout_Flattening.vo filter=lfs diff=lfs merge=lfs -text
1537
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Colimits/Colimit_Sigma.vo filter=lfs diff=lfs merge=lfs -text
1538
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/deriving/base.vo filter=lfs diff=lfs merge=lfs -text
1539
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/mathcomp/fingroup/fingroup.vo filter=lfs diff=lfs merge=lfs -text
1540
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/deriving/ind.vo filter=lfs diff=lfs merge=lfs -text
1541
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/deriving/instances.vo filter=lfs diff=lfs merge=lfs -text
1542
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/iris/algebra/lib/gmap_view.vo filter=lfs diff=lfs merge=lfs -text
1543
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/deriving/instances/order.vo filter=lfs diff=lfs merge=lfs -text
1544
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Crypto/Util/ZUtil/Modulo.vo filter=lfs diff=lfs merge=lfs -text
1545
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Spaces/BAut/Cantor.vo filter=lfs diff=lfs merge=lfs -text
1546
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Crypto/Util/ZUtil/Morphisms.vo filter=lfs diff=lfs merge=lfs -text
1547
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Crypto/Util/ZUtil/Shift.vo filter=lfs diff=lfs merge=lfs -text
1548
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Interval/Language/Lang_expr.vo filter=lfs diff=lfs merge=lfs -text
1549
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/iris/bi/lib/fixpoint.vo filter=lfs diff=lfs merge=lfs -text
1550
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/WildCat/Yoneda.vo filter=lfs diff=lfs merge=lfs -text
1551
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/mathcomp/solvable/hall.vo filter=lfs diff=lfs merge=lfs -text
1552
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Crypto/Rewriter/Passes/NoSelect.vo filter=lfs diff=lfs merge=lfs -text
1553
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Interval/Tactics/Interval_helper.vo filter=lfs diff=lfs merge=lfs -text
1554
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Crypto/Rewriter/Passes/RelaxBitwidthAdcSbb.vo filter=lfs diff=lfs merge=lfs -text
1555
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Types/Sigma.vo filter=lfs diff=lfs merge=lfs -text
1556
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Spaces/No/Addition.vo filter=lfs diff=lfs merge=lfs -text
1557
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Interval/Float/Specific_stdz.vo filter=lfs diff=lfs merge=lfs -text
1558
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/iris/program_logic/adequacy.vo filter=lfs diff=lfs merge=lfs -text
1559
+ backend/core/.rustup/downloads/371a98be3e239f760a7f0e87793ad0a871cdc2e607590cc47514d91fd8d1383c filter=lfs diff=lfs merge=lfs -text
1560
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/MathClasses/theory/rings.vo filter=lfs diff=lfs merge=lfs -text
1561
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Pointed/pMap.vo filter=lfs diff=lfs merge=lfs -text
1562
+ backend/core/alphageometry/meliad_lib/meliad/transformer/vocabs/pg19train_bpe_32000.model filter=lfs diff=lfs merge=lfs -text
1563
+ backend/core/.rustup/downloads/8c0a40a5411746ff6600d93acd16652fef56702196bb25b940ff399d7e107f40 filter=lfs diff=lfs merge=lfs -text
1564
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/WildCat/DisplayedEquiv.vo filter=lfs diff=lfs merge=lfs -text
1565
+ backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/mathcomp/solvable/jordanholder.vo filter=lfs diff=lfs merge=lfs -text
backend/core/.rustup/downloads/371a98be3e239f760a7f0e87793ad0a871cdc2e607590cc47514d91fd8d1383c ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:371a98be3e239f760a7f0e87793ad0a871cdc2e607590cc47514d91fd8d1383c
3
+ size 3805000
backend/core/.rustup/downloads/8c0a40a5411746ff6600d93acd16652fef56702196bb25b940ff399d7e107f40 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8c0a40a5411746ff6600d93acd16652fef56702196bb25b940ff399d7e107f40
3
+ size 9163172
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Crypto/Rewriter/Passes/NoSelect.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9f997e28fe542a0840c686b61edce8af6fa4a4a388c7eba24bc9c34cd15acf08
3
+ size 369181
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Crypto/Rewriter/Passes/RelaxBitwidthAdcSbb.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff1b7ced14aedd5c31c212ce24c392981b2d7b53923131968daa8455e4242702
3
+ size 522748
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Crypto/Util/ZUtil/Modulo.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:32cba916ed4a7ba98c795207dbc59e6f6ae9f2daad94881930238dcbea70e6dd
3
+ size 273119
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Crypto/Util/ZUtil/Morphisms.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:af5cb481d146c5672bd4647a1a12116978ac2a74cf32c1e9bc669ab242155490
3
+ size 159937
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/Crypto/Util/ZUtil/Shift.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0a962a0ce6eb50553bf702355d1e3d1b06e0d2092bce08db3f259a27c4a812d1
3
+ size 114642
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Colimits/Colimit_Pushout.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:28322028ba1d17fd8bf3250a915a1ac6399ce227878c06cab3fa2fd7b67dde11
3
+ size 1539801
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Colimits/Colimit_Pushout_Flattening.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6adb8d3bb8a10d07bbf0e69a75f639da0c029685adfc44b32685e181392964b9
3
+ size 1271043
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Colimits/Colimit_Sigma.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24c7899a221d5106d59cad716070d89155d3069afe39b16d4b07f80f90c4d055
3
+ size 220502
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Diagrams/Sequence.v ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Require Import Basics.
2
+ Require Import Diagrams.Graph.
3
+ Require Import Diagrams.Diagram.
4
+
5
+ Local Open Scope nat_scope.
6
+ Local Open Scope path_scope.
7
+
8
+ (** * Sequence *)
9
+
10
+ (** A Sequence is a sequence of maps from [X(n)] to [X(n+1)]. *)
11
+
12
+ Definition sequence_graph : Graph.
13
+ Proof.
14
+ srapply (Build_Graph nat).
15
+ intros n m; exact (S n = m).
16
+ Defined.
17
+
18
+ Definition Sequence := Diagram sequence_graph.
19
+
20
+ Definition Build_Sequence
21
+ (X : nat -> Type)
22
+ (f : forall n, X n -> X n.+1)
23
+ : Sequence.
24
+ Proof.
25
+ srapply Build_Diagram.
26
+ 1: exact X.
27
+ intros ? ? p.
28
+ destruct p.
29
+ apply f.
30
+ Defined.
31
+
32
+ (** A useful lemma to show than two sequences are equivalent. *)
33
+
34
+ Definition equiv_sequence (D1 D2 : Sequence)
35
+ (H0 : (D1 0) <~> (D2 0))
36
+ (Hn: forall n (e: (D1 n) <~> (D2 n)),
37
+ {e' : (D1 n.+1) <~> (D2 n.+1) & (D2 _f 1) o e == e' o (D1 _f 1)})
38
+ : D1 ~d~ D2.
39
+ Proof.
40
+ srapply (Build_diagram_equiv (Build_DiagramMap _ _)); intro n; simpl.
41
+ - apply equiv_fun.
42
+ induction n.
43
+ + apply H0.
44
+ + exact (Hn n IHn).1.
45
+ - intros m q; destruct q.
46
+ induction n; simpl.
47
+ + exact (Hn 0 H0).2.
48
+ + simple refine (Hn n.+1 _).2.
49
+ - induction n; simpl.
50
+ + apply H0.
51
+ + apply (Hn n _ ).1.
52
+ Defined.
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Diagrams/Sequence.vo ADDED
Binary file (13.1 kB). View file
 
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Diagrams/Span.v ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Require Import Basics.
2
+ Require Import Types.
3
+ Require Import Diagrams.Graph.
4
+ Require Import Diagrams.Diagram.
5
+
6
+ (** The underlying graph of a span. *)
7
+
8
+ Definition span_graph : Graph.
9
+ Proof.
10
+ srapply (Build_Graph (Unit + Bool)).
11
+ intros [i|i] [j|j].
12
+ 2: exact Unit.
13
+ all: exact Empty.
14
+ Defined.
15
+
16
+ Section Span.
17
+
18
+ Context {A B C : Type}.
19
+
20
+ (** A span is a diagram:
21
+ f g
22
+ B <-- A --> C *)
23
+
24
+ Definition span (f : A -> B) (g : A -> C) : Diagram span_graph.
25
+ Proof.
26
+ srapply Build_Diagram.
27
+ - intros [i|i].
28
+ + exact A.
29
+ + exact (if i then B else C).
30
+ - intros [i|i] [j|j] u; cbn; try contradiction.
31
+ destruct j.
32
+ + exact f.
33
+ + exact g.
34
+ Defined.
35
+
36
+ End Span.
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Diagrams/Span.vo ADDED
Binary file (11.1 kB). View file
 
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Equiv/BiInv.v ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (* -*- mode: coq; mode: visual-line -*- *)
2
+
3
+ Require Import HoTT.Basics HoTT.Types.
4
+
5
+ Local Open Scope path_scope.
6
+ Generalizable Variables A B f.
7
+
8
+ (** * Bi-invertible maps *)
9
+
10
+ (** A map is "bi-invertible" if it has both a section and a retraction, not necessarily the same. This definition of equivalence was proposed by Andre Joyal. *)
11
+
12
+ Definition BiInv `(f : A -> B) : Type
13
+ := {g : B -> A & g o f == idmap} * {h : B -> A & f o h == idmap}.
14
+
15
+ (** It seems that the easiest way to show that bi-invertibility is equivalent to being an equivalence is also to show that both are h-props and that they are logically equivalent. *)
16
+
17
+ Definition isequiv_biinv `(f : A -> B)
18
+ : BiInv f -> IsEquiv f.
19
+ Proof.
20
+ intros [[g s] [h r]].
21
+ exact (isequiv_adjointify f g
22
+ (fun x => ap f (ap g (r x)^ @ s (h x)) @ r x)
23
+ s).
24
+ Defined.
25
+
26
+ Definition biinv_isequiv `(f : A -> B)
27
+ : IsEquiv f -> BiInv f.
28
+ Proof.
29
+ intros [g s r adj].
30
+ exact ((g; r), (g; s)).
31
+ Defined.
32
+
33
+ Definition iff_biinv_isequiv `(f : A -> B)
34
+ : BiInv f <-> IsEquiv f.
35
+ Proof.
36
+ split.
37
+ - apply isequiv_biinv.
38
+ - apply biinv_isequiv.
39
+ Defined.
40
+
41
+ Global Instance ishprop_biinv `{Funext} `(f : A -> B) : IsHProp (BiInv f) | 0.
42
+ Proof.
43
+ apply hprop_inhabited_contr.
44
+ intros bif; pose (fe := isequiv_biinv f bif).
45
+ apply @contr_prod.
46
+ (* For this, we've done all the work already. *)
47
+ - by apply contr_retr_equiv.
48
+ - by apply contr_sect_equiv.
49
+ Defined.
50
+
51
+ Definition equiv_biinv_isequiv `{Funext} `(f : A -> B)
52
+ : BiInv f <~> IsEquiv f.
53
+ Proof.
54
+ apply equiv_iff_hprop_uncurried, iff_biinv_isequiv.
55
+ Defined.
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Equiv/BiInv.vo ADDED
Binary file (11.4 kB). View file
 
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Equiv/PathSplit.v ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (* -*- mode: coq; mode: visual-line -*- *)
2
+
3
+ Require Import HoTT.Basics HoTT.Types.
4
+
5
+ Local Open Scope nat_scope.
6
+ Local Open Scope path_scope.
7
+
8
+ Generalizable Variables A B f.
9
+
10
+ Section AssumeFunext.
11
+ Context `{Funext}.
12
+
13
+ (** * n-Path-split maps.
14
+
15
+ A map is n-path-split if its induced maps on the first n iterated path-spaces are split surjections. Thus every map is 0-path-split, the 1-path-split maps are the split surjections, and so on. It turns out that for n>1, being n-path-split is the same as being an equivalence. *)
16
+
17
+ Fixpoint PathSplit (n : nat) `(f : A -> B) : Type
18
+ := match n with
19
+ | 0 => Unit
20
+ | S n => (forall a, hfiber f a) *
21
+ forall (x y : A), PathSplit n (@ap _ _ f x y)
22
+ end.
23
+
24
+ Definition isequiv_pathsplit (n : nat) `{f : A -> B}
25
+ : PathSplit n.+2 f -> IsEquiv f.
26
+ Proof.
27
+ intros [g k].
28
+ pose (h := fun x y p => (fst (k x y) p).1).
29
+ pose (hs := fun x y => (fun p => (fst (k x y) p).2)
30
+ : (ap f) o (h x y) == idmap).
31
+ clearbody hs; clearbody h; clear k.
32
+ apply isequiv_contr_map; intros b.
33
+ apply contr_inhabited_hprop.
34
+ 2:exact (g b).
35
+ apply hprop_allpath; intros [a p] [a' p'].
36
+ refine (path_sigma' _ (h a a' (p @ p'^)) _).
37
+ refine (transport_paths_Fl _ _ @ _).
38
+ refine ((inverse2 (hs a a' (p @ p'^)) @@ 1) @ _).
39
+ refine ((inv_pp p p'^ @@ 1) @ _).
40
+ refine (concat_pp_p _ _ _ @ _).
41
+ refine ((1 @@ concat_Vp _) @ _).
42
+ exact ((inv_V p' @@ 1) @ concat_p1 _).
43
+ Defined.
44
+
45
+ Global Instance contr_pathsplit_isequiv
46
+ (n : nat) `(f : A -> B) `{IsEquiv _ _ f}
47
+ : Contr (PathSplit n f).
48
+ Proof.
49
+ generalize dependent B; revert A.
50
+ simple_induction n n IHn; intros A B f ?.
51
+ - exact _.
52
+ - apply contr_prod.
53
+ Defined.
54
+
55
+ Global Instance ishprop_pathsplit (n : nat) `(f : A -> B)
56
+ : IsHProp (PathSplit n.+2 f).
57
+ Proof.
58
+ apply hprop_inhabited_contr; intros ps.
59
+ pose (isequiv_pathsplit n ps).
60
+ exact _.
61
+ Defined.
62
+
63
+ Definition equiv_pathsplit_isequiv (n : nat) `(f : A -> B)
64
+ : PathSplit n.+2 f <~> IsEquiv f.
65
+ Proof.
66
+ refine (equiv_iff_hprop _ _).
67
+ - apply isequiv_pathsplit.
68
+ - intros ?; refine (center _).
69
+ Defined.
70
+
71
+ (** Path-splitness transfers across commutative squares of equivalences. *)
72
+ Lemma equiv_functor_pathsplit (n : nat) {A B C D}
73
+ (f : A -> B) (g : C -> D) (h : A <~> C) (k : B <~> D)
74
+ (p : g o h == k o f)
75
+ : PathSplit n f <~> PathSplit n g.
76
+ Proof.
77
+ destruct n as [|n].
78
+ 1:apply equiv_idmap.
79
+ destruct n as [|n].
80
+ - simpl.
81
+ refine (_ *E equiv_contr_contr).
82
+ refine (equiv_functor_forall' k^-1 _); intros d.
83
+ unfold hfiber.
84
+ refine (equiv_functor_sigma' h _); intros a.
85
+ refine (equiv_concat_l (p a) d oE _).
86
+ simpl; apply equiv_moveR_equiv_M.
87
+ - refine (_ oE equiv_pathsplit_isequiv n f).
88
+ refine ((equiv_pathsplit_isequiv n g)^-1 oE _).
89
+ apply equiv_iff_hprop; intros e.
90
+ + refine (isequiv_commsq f g h k (fun a => (p a)^)).
91
+ + refine (isequiv_commsq' f g h k p).
92
+ Defined.
93
+
94
+ (** A map is oo-path-split if it is n-path-split for all n. This is also equivalent to being an equivalence. *)
95
+
96
+ Definition ooPathSplit `(f : A -> B) : Type
97
+ := forall n, PathSplit n f.
98
+
99
+ Definition isequiv_oopathsplit `{f : A -> B}
100
+ : ooPathSplit f -> IsEquiv f
101
+ := fun ps => isequiv_pathsplit 0 (ps 2).
102
+
103
+ Global Instance contr_oopathsplit_isequiv
104
+ `(f : A -> B) `{IsEquiv _ _ f}
105
+ : Contr (ooPathSplit f).
106
+ Proof.
107
+ apply contr_forall.
108
+ Defined.
109
+
110
+ Global Instance ishprop_oopathsplit `(f : A -> B)
111
+ : IsHProp (ooPathSplit f).
112
+ Proof.
113
+ apply hprop_inhabited_contr; intros ps.
114
+ pose (isequiv_oopathsplit ps).
115
+ exact _.
116
+ Defined.
117
+
118
+ Definition equiv_oopathsplit_isequiv `(f : A -> B)
119
+ : ooPathSplit f <~> IsEquiv f.
120
+ Proof.
121
+ refine (equiv_iff_hprop _ _).
122
+ - apply isequiv_oopathsplit.
123
+ - intros ?; refine (center _).
124
+ Defined.
125
+
126
+ End AssumeFunext.
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Equiv/PathSplit.vo ADDED
Binary file (50.3 kB). View file
 
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Equiv/Relational.v ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (* -*- mode: coq; mode: visual-line -*- *)
2
+
3
+ Require Import HoTT.Basics HoTT.Types.
4
+
5
+ Local Open Scope nat_scope.
6
+ Local Open Scope path_scope.
7
+
8
+ Generalizable Variables A B f.
9
+
10
+ (** * Relational equivalences *)
11
+
12
+ (** This definition is due to Peter LeFanu Lumsdaine on the HoTT mailing list. This definition gives more judgmental properties, though has the downside of jumping universe levels. *)
13
+
14
+ Record RelEquiv A B :=
15
+ { equiv_rel : A -> B -> Type;
16
+ relequiv_contr_f : forall a, Contr { b : B & equiv_rel a b };
17
+ relequiv_contr_g : forall b, Contr { a : A & equiv_rel a b } }.
18
+
19
+ Arguments equiv_rel {A B} _ _ _.
20
+ Global Existing Instance relequiv_contr_f.
21
+ Global Existing Instance relequiv_contr_g.
22
+
23
+ Definition issig_relequiv {A B}
24
+ : { equiv_rel : A -> B -> Type
25
+ | { f : forall a, Contr { b : B & equiv_rel a b }
26
+ | forall b, Contr { a : A & equiv_rel a b } } }
27
+ <~> RelEquiv A B.
28
+ Proof.
29
+ issig.
30
+ Defined.
31
+
32
+ Definition relequiv_of_equiv {A B} (e : A <~> B) : RelEquiv A B.
33
+ Proof.
34
+ refine {| equiv_rel a b := e a = b |}.
35
+ (** The rest is found by typeclass inference! *)
36
+ Defined.
37
+
38
+ Definition equiv_of_relequiv {A B} (e : RelEquiv A B) : A <~> B.
39
+ Proof.
40
+ refine (equiv_adjointify
41
+ (fun a => (center { b : B & equiv_rel e a b}).1)
42
+ (fun b => (center { a : A & equiv_rel e a b}).1)
43
+ _ _);
44
+ intro x; cbn.
45
+ { refine (ap pr1 (contr _) : _.1 = (x; _).1).
46
+ exact (center {a : A & equiv_rel e a x}).2. }
47
+ { refine (ap pr1 (contr _) : _.1 = (x; _).1).
48
+ exact (center {b : B & equiv_rel e x b}).2. }
49
+ Defined.
50
+
51
+ Definition RelIsEquiv {A B} (f : A -> B)
52
+ := { r : RelEquiv A B | forall x, (center { b : B & equiv_rel r x b }).1 = f x }.
53
+
54
+ (** TODO: Prove [ishprop_relisequiv `{Funext} {A B} f : IsHProp (@RelIsEquiv A B f)] *)
55
+
56
+ (** * Judgmental property *)
57
+ Definition inverse_relequiv {A B} (e : RelEquiv A B) : RelEquiv B A
58
+ := {| equiv_rel a b := equiv_rel e b a |}.
59
+
60
+ Definition reinv_V {A B} (e : RelEquiv A B)
61
+ : inverse_relequiv (inverse_relequiv e) = e
62
+ := 1.
63
+
64
+ (** TODO: Is there a definition of this that makes [inverse_relequiv (relequiv_idmap A)] be [relequiv_idmap A], judgmentally? *)
65
+ Definition relequiv_idmap A : RelEquiv A A
66
+ := {| equiv_rel a b := a = b |}.
67
+
68
+ (** TODO: Define composition; we probably need truncation to do this? *)
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Equiv/Relational.vo ADDED
Binary file (20.7 kB). View file
 
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/Flattening.v ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (* -*- mode: coq; mode: visual-line -*- *)
2
+
3
+ (** * The flattening lemma. *)
4
+
5
+ Require Import HoTT.Basics.
6
+ Require Import Types.Paths Types.Forall Types.Sigma Types.Arrow Types.Universe.
7
+ Local Open Scope path_scope.
8
+ Require Import HoTT.Colimits.Coeq.
9
+
10
+ (** The base HIT [W] is just a homotopy coequalizer [Coeq]. *)
11
+
12
+ (** TODO: Make the names in this file more usable, move it into [Coeq.v], and use it to derive corresponding flattening lemmas for [pushout], etc. *)
13
+
14
+ (** Now we define the flattened HIT which will be equivalent to the total space of a fibration over [W]. *)
15
+
16
+ Module Export FlattenedHIT.
17
+
18
+ Private Inductive Wtil (A B : Type) (f g : B -> A)
19
+ (C : A -> Type) (D : forall b, C (f b) <~> C (g b))
20
+ : Type :=
21
+ | cct : forall a, C a -> Wtil A B f g C D.
22
+
23
+ Arguments cct {A B f g C D} a c.
24
+
25
+ Axiom ppt : forall {A B f g C D} (b:B) (y:C (f b)),
26
+ @cct A B f g C D (f b) y = cct (g b) (D b y).
27
+
28
+ Definition Wtil_ind {A B f g C D} (Q : Wtil A B f g C D -> Type)
29
+ (cct' : forall a x, Q (cct a x))
30
+ (ppt' : forall b y, (ppt b y) # (cct' (f b) y) = cct' (g b) (D b y))
31
+ : forall w, Q w
32
+ := fun w => match w with cct a x => fun _ => cct' a x end ppt'.
33
+
34
+ Axiom Wtil_ind_beta_ppt
35
+ : forall {A B f g C D} (Q : Wtil A B f g C D -> Type)
36
+ (cct' : forall a x, Q (cct a x))
37
+ (ppt' : forall b y, (ppt b y) # (cct' (f b) y) = cct' (g b) (D b y))
38
+ (b:B) (y : C (f b)),
39
+ apD (Wtil_ind Q cct' ppt') (ppt b y) = ppt' b y.
40
+
41
+ End FlattenedHIT.
42
+
43
+ Definition Wtil_rec {A B f g C} {D : forall b, C (f b) <~> C (g b)}
44
+ (Q : Type) (cct' : forall a (x : C a), Q)
45
+ (ppt' : forall b (y : C (f b)), cct' (f b) y = cct' (g b) (D b y))
46
+ : Wtil A B f g C D -> Q
47
+ := Wtil_ind (fun _ => Q) cct' (fun b y => transport_const _ _ @ ppt' b y).
48
+
49
+ Definition Wtil_rec_beta_ppt
50
+ {A B f g C} {D : forall b, C (f b) <~> C (g b)}
51
+ (Q : Type) (cct' : forall a (x : C a), Q)
52
+ (ppt' : forall (b:B) (y : C (f b)), cct' (f b) y = cct' (g b) (D b y))
53
+ (b:B) (y: C (f b))
54
+ : ap (@Wtil_rec A B f g C D Q cct' ppt') (ppt b y) = ppt' b y.
55
+ Proof.
56
+ unfold Wtil_rec.
57
+ eapply (cancelL (transport_const (ppt (C:=C) b y) _)).
58
+ refine ((apD_const
59
+ (@Wtil_ind A B f g C D (fun _ => Q) cct' _) (ppt b y))^ @ _).
60
+ refine (Wtil_ind_beta_ppt (fun _ => Q) _ _ _ _).
61
+ Defined.
62
+
63
+
64
+
65
+ (** Now we define the fibration over it that we will be considering the total space of. *)
66
+
67
+ Section AssumeAxioms.
68
+ Context `{Univalence}.
69
+
70
+ Context {B A : Type} {f g : B -> A}.
71
+ Context {C : A -> Type} {D : forall b, C (f b) <~> C (g b)}.
72
+
73
+ Let W' := Coeq f g.
74
+
75
+ Let P : W' -> Type
76
+ := Coeq_rec Type C (fun b => path_universe (D b)).
77
+
78
+
79
+
80
+ (** Now we give the total space the same structure as [Wtil]. *)
81
+
82
+ Let sWtil := { w:W' & P w }.
83
+
84
+ Let scct (a:A) (x:C a) : sWtil := (exist P (coeq a) x).
85
+
86
+ Let sppt (b:B) (y:C (f b)) : scct (f b) y = scct (g b) (D b y)
87
+ := path_sigma' P (cglue b)
88
+ (transport_path_universe' P (cglue b) (D b)
89
+ (Coeq_rec_beta_cglue Type C (fun b0 => path_universe (D b0)) b) y).
90
+
91
+ (** Here is the dependent eliminator *)
92
+ Definition sWtil_ind (Q : sWtil -> Type)
93
+ (scct' : forall a x, Q (scct a x))
94
+ (sppt' : forall b y, (sppt b y) # (scct' (f b) y) = scct' (g b) (D b y))
95
+ : forall w, Q w.
96
+ Proof.
97
+ apply sig_ind.
98
+ refine (Coeq_ind (fun w => forall x:P w, Q (w;x))
99
+ (fun a x => scct' a x) _).
100
+ intros b.
101
+ apply (dpath_forall P (fun a b => Q (a;b)) _ _ (cglue b)
102
+ (scct' (f b)) (scct' (g b))).
103
+ intros y.
104
+ set (q := transport_path_universe' P (cglue b) (D b)
105
+ (Coeq_rec_beta_cglue Type C (fun b0 : B => path_universe (D b0)) b) y).
106
+ rewrite transportD_is_transport.
107
+ refine (_ @ apD (scct' (g b)) q^).
108
+ refine (moveL_transport_V (fun x => Q (scct (g b) x)) q _ _ _).
109
+ rewrite transport_compose, <- transport_pp.
110
+ refine (_ @ sppt' b y).
111
+ apply ap10, ap.
112
+ refine (whiskerL _ (ap_exist P (coeq (g b)) _ _ q) @ _).
113
+ exact ((path_sigma_p1_1p' _ _ _)^).
114
+ Defined.
115
+
116
+ (** The eliminator computes on the point constructor. *)
117
+ Definition sWtil_ind_beta_cct (Q : sWtil -> Type)
118
+ (scct' : forall a x, Q (scct a x))
119
+ (sppt' : forall b y, (sppt b y) # (scct' (f b) y) = scct' (g b) (D b y))
120
+ (a:A) (x:C a)
121
+ : sWtil_ind Q scct' sppt' (scct a x) = scct' a x
122
+ := 1.
123
+
124
+ (** This would be its propositional computation rule on the path constructor... *)
125
+ (**
126
+ <<
127
+ Definition sWtil_ind_beta_ppt (Q : sWtil -> Type)
128
+ (scct' : forall a x, Q (scct a x))
129
+ (sppt' : forall b y, (sppt b y) # (scct' (f b) y) = scct' (g b) (D b y))
130
+ (b:B) (y:C (f b))
131
+ : apD (sWtil_ind Q scct' sppt') (sppt b y) = sppt' b y.
132
+ Proof.
133
+ unfold sWtil_ind.
134
+ (** ... but it's a doozy! *)
135
+ Abort.
136
+ >>
137
+ *)
138
+
139
+ (** Fortunately, it turns out to be enough to have the computation rule for the *non-dependent* eliminator! *)
140
+
141
+ (** We could define that in terms of the dependent one, as usual...
142
+ <<
143
+ Definition sWtil_rec (P : Type)
144
+ (scct' : forall a (x : C a), P)
145
+ (sppt' : forall b (y : C (f b)), scct' (f b) y = scct' (g b) (D b y))
146
+ : sWtil -> P
147
+ := sWtil_ind (fun _ => P) scct' (fun b y => transport_const _ _ @ sppt' b y).
148
+ >>
149
+ *)
150
+
151
+ (** ...but if we define it diindly, then it's easier to reason about. *)
152
+ Definition sWtil_rec (Q : Type)
153
+ (scct' : forall a (x : C a), Q)
154
+ (sppt' : forall b (y : C (f b)), scct' (f b) y = scct' (g b) (D b y))
155
+ : sWtil -> Q.
156
+ Proof.
157
+ apply sig_ind.
158
+ refine (Coeq_ind (fun w => P w -> Q) (fun a x => scct' a x) _).
159
+ intros b.
160
+ refine (dpath_arrow P (fun _ => Q) _ _ _ _).
161
+ intros y.
162
+ refine (transport_const _ _ @ _).
163
+ refine (sppt' b _ @ ap _ _).
164
+ refine ((transport_path_universe' P (cglue b) (D b) _ _)^).
165
+ exact (Coeq_rec_beta_cglue _ _ _ _).
166
+ Defined.
167
+
168
+ Open Scope long_path_scope.
169
+
170
+ Definition sWtil_rec_beta_ppt (Q : Type)
171
+ (scct' : forall a (x : C a), Q)
172
+ (sppt' : forall b (y : C (f b)), scct' (f b) y = scct' (g b) (D b y))
173
+ (b:B) (y: C (f b))
174
+ : ap (sWtil_rec Q scct' sppt') (sppt b y) = sppt' b y.
175
+ Proof.
176
+ unfold sWtil_rec, sppt.
177
+ refine (@ap_sig_rec_path_sigma W' P Q _ _ (cglue b) _ _ _ _ @ _); simpl.
178
+ rewrite (@Coeq_ind_beta_cglue B A f g).
179
+ rewrite (ap10_dpath_arrow P (fun _ => Q) (cglue b) _ _ _ y).
180
+ repeat rewrite concat_p_pp.
181
+ (** Now everything cancels! *)
182
+ rewrite ap_V, concat_pV_p, concat_pV_p, concat_pV_p, concat_Vp.
183
+ by apply concat_1p.
184
+ Qed.
185
+
186
+ Close Scope long_path_scope.
187
+
188
+ (** Woot! *)
189
+ Definition equiv_flattening : Wtil A B f g C D <~> sWtil.
190
+ Proof.
191
+ (** The maps back and forth are obtained easily from the non-dependent eliminators. *)
192
+ refine (equiv_adjointify
193
+ (Wtil_rec _ scct sppt)
194
+ (sWtil_rec _ cct ppt)
195
+ _ _).
196
+ (** The two homotopies are completely symmetrical, using the *dependent* eliminators, but only the computation rules for the non-dependent ones. *)
197
+ - refine (sWtil_ind _ (fun a x => 1) _). intros b y.
198
+ apply dpath_path_FFlr.
199
+ rewrite concat_1p, concat_p1.
200
+ rewrite sWtil_rec_beta_ppt.
201
+ by symmetry; apply (@Wtil_rec_beta_ppt A B f g C D).
202
+ - refine (Wtil_ind _ (fun a x => 1) _). intros b y.
203
+ apply dpath_path_FFlr.
204
+ rewrite concat_1p, concat_p1.
205
+ rewrite Wtil_rec_beta_ppt.
206
+ by symmetry; apply sWtil_rec_beta_ppt.
207
+ Defined.
208
+
209
+ End AssumeAxioms.
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/FreeIntQuotient.v ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (* -*- mode: coq; mode: visual-line -*- *)
2
+ Require Import HoTT.Basics HoTT.Types.
3
+ Require Import Spaces.Int Spaces.Circle.
4
+ Require Import Colimits.Coeq HIT.Flattening Truncations.Core Truncations.Connectedness.
5
+
6
+ Local Open Scope path_scope.
7
+
8
+ (** * Quotients by free actions of [Int] *)
9
+
10
+ (** We will show that if [Int] acts freely on a set, then the set-quotient of that action can be defined without a 0-truncation, giving it a universal property for mapping into all types. *)
11
+
12
+ Section FreeIntAction.
13
+
14
+ Context `{Univalence}.
15
+ Context (R : Type) `{IsHSet R}.
16
+
17
+ (** A free action by [Int] is the same as a single autoequivalence [f] (the action of [1]) whose iterates are all pointwise distinct. *)
18
+ Context (f : R <~> R)
19
+ (f_free : forall (r : R) (n m : Int),
20
+ (int_iter f n r = int_iter f m r) -> (n = m)).
21
+
22
+ (** We can then define the quotient to be the coequalizer of [f] and the identity map. This gives it the desired universal property for all types; it remains to show that this definition gives a set. *)
23
+ Let RmodZ := Coeq f idmap.
24
+
25
+ (** Together, [R] and [f] define a fibration over [Circle]. By the flattening lemma, its total space is equivalent to the quotient. *)
26
+ Global Instance isset_RmodZ : IsHSet RmodZ.
27
+ Proof.
28
+ nrefine (istrunc_equiv_istrunc
29
+ { z : Circle & Circle_rec Type R (path_universe f) z}
30
+ (_ oE (@equiv_flattening _ Unit Unit idmap idmap
31
+ (fun _ => R) (fun _ => f))^-1
32
+ oE _));
33
+ try exact _.
34
+ - unshelve rapply equiv_adjointify.
35
+ + simple refine (Wtil_rec _ _ _).
36
+ * intros u r; exact (coeq r).
37
+ * intros u r; cbn. exact ((cglue r)^).
38
+ + simple refine (Coeq_rec _ _ _).
39
+ * exact (cct tt).
40
+ * intros r; exact ((ppt tt r)^).
41
+ + refine (Coeq_ind _ (fun a => 1) _); cbn; intros b.
42
+ rewrite transport_paths_FlFr, concat_p1, ap_idmap.
43
+ apply moveR_Vp; rewrite concat_p1.
44
+ rewrite ap_compose.
45
+ rewrite (Coeq_rec_beta_cglue
46
+ (Wtil Unit Unit idmap idmap (unit_name R) (unit_name f))
47
+ (cct tt) (fun r => (ppt tt r)^) b).
48
+ rewrite ap_V; symmetry.
49
+ refine (inverse2
50
+ (Wtil_rec_beta_ppt
51
+ RmodZ (unit_name (fun r => coeq r))
52
+ (unit_name (fun r => (cglue r)^)) tt b) @ inv_V _).
53
+ + simple refine (Wtil_ind _ _ _); cbn.
54
+ { intros [] ?; reflexivity. }
55
+ intros [] r; cbn.
56
+ rewrite transport_paths_FlFr, concat_p1, ap_idmap.
57
+ apply moveR_Vp; rewrite concat_p1.
58
+ rewrite ap_compose.
59
+ refine (_ @ ap (ap _) (Wtil_rec_beta_ppt
60
+ RmodZ (unit_name (fun r => coeq r))
61
+ (unit_name (fun r => (cglue r)^)) tt r)^).
62
+ rewrite ap_V.
63
+ rewrite (Coeq_rec_beta_cglue
64
+ (Wtil Unit Unit idmap idmap (unit_name R) (unit_name f))
65
+ (cct tt) (fun r0 : R => (ppt tt r0)^) r).
66
+ symmetry; apply inv_V.
67
+ - apply equiv_functor_sigma_id; intros x.
68
+ apply equiv_path.
69
+ revert x; refine (Circle_ind _ 1 _); cbn.
70
+ rewrite transport_paths_FlFr, concat_p1.
71
+ apply moveR_Vp; rewrite concat_p1.
72
+ rewrite Circle_rec_beta_loop.
73
+ unfold loop.
74
+ exact (Coeq_rec_beta_cglue _ _ _ _).
75
+ - apply istrunc_S.
76
+ intros xu yv.
77
+ nrefine (istrunc_equiv_istrunc (n := -1) _ (equiv_path_sigma _ xu yv)).
78
+ destruct xu as [x u], yv as [y v]; cbn.
79
+ apply hprop_allpath.
80
+ intros [p r] [q s].
81
+ set (P := Circle_rec Type R (path_universe f)) in *.
82
+ assert (forall z, IsHSet (P z)).
83
+ { simple refine (Circle_ind _ _ _); cbn beta.
84
+ - exact _.
85
+ - apply path_ishprop. }
86
+ apply path_sigma_hprop; cbn.
87
+ assert (t := r @ s^); clear r s.
88
+ assert (xb := merely_path_is0connected Circle base x).
89
+ assert (yb := merely_path_is0connected Circle base y).
90
+ strip_truncations. destruct xb, yb.
91
+ revert p q t.
92
+ equiv_intro (equiv_loopCircle_int^-1) n.
93
+ equiv_intro (equiv_loopCircle_int^-1) m.
94
+ subst P.
95
+ rewrite !Circle_action_is_iter.
96
+ intros p. apply ap.
97
+ exact (f_free u n m p).
98
+ Qed.
99
+
100
+ (** TODO: Prove that this [RmodZ] is equivalent to the set-quotient of [R] by a suitably defined equivalence relation. *)
101
+
102
+ End FreeIntAction.
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/FreeIntQuotient.vo ADDED
Binary file (24.4 kB). View file
 
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/Interval.v ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (* -*- mode: coq; mode: visual-line -*- *)
2
+
3
+ (** * Theorems about the homotopical interval. *)
4
+
5
+ Require Import Basics.Overture Basics.PathGroupoids.
6
+ Require Import Types.Paths.
7
+
8
+ Local Open Scope path_scope.
9
+
10
+
11
+ Module Export Interval.
12
+
13
+ Private Inductive interval : Type0 :=
14
+ | zero : interval
15
+ | one : interval.
16
+
17
+ Axiom seg : zero = one.
18
+
19
+ Definition interval_ind (P : interval -> Type)
20
+ (a : P zero) (b : P one) (p : seg # a = b)
21
+ : forall x:interval, P x
22
+ := fun x => (match x return _ -> P x with
23
+ | zero => fun _ => a
24
+ | one => fun _ => b
25
+ end) p.
26
+
27
+ Axiom interval_ind_beta_seg : forall (P : interval -> Type)
28
+ (a : P zero) (b : P one) (p : seg # a = b),
29
+ apD (interval_ind P a b p) seg = p.
30
+
31
+ End Interval.
32
+
33
+ Definition interval_rec (P : Type) (a b : P) (p : a = b)
34
+ : interval -> P
35
+ := interval_ind (fun _ => P) a b (transport_const _ _ @ p).
36
+
37
+ Definition interval_rec_beta_seg (P : Type) (a b : P) (p : a = b)
38
+ : ap (interval_rec P a b p) seg = p.
39
+ Proof.
40
+ refine (cancelL (transport_const seg a) _ _ _).
41
+ refine ((apD_const (interval_ind (fun _ => P) a b _) seg)^ @ _).
42
+ refine (interval_ind_beta_seg (fun _ => P) _ _ _).
43
+ Defined.
44
+
45
+ (** ** The interval is contractible. *)
46
+
47
+ Global Instance contr_interval : Contr interval | 0.
48
+ Proof.
49
+ apply (Build_Contr _ zero).
50
+ refine (interval_ind _ 1 seg _).
51
+ refine (transport_paths_r _ _ @ concat_1p _).
52
+ Defined.
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/Interval.vo ADDED
Binary file (21.9 kB). View file
 
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/SetCone.v ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (* -*- mode: coq; mode: visual-line -*- *)
2
+ Require Import HoTT.Basics Types.Unit.
3
+ Require Import Colimits.Pushout.
4
+ Require Import Truncations.Core.
5
+
6
+ (** * Cones of HSets *)
7
+
8
+ Section SetCone.
9
+ Context {A B : HSet} (f : A -> B).
10
+
11
+ Definition setcone := Trunc 0 (Pushout@{_ _ Set _} f (const_tt A)).
12
+
13
+ Global Instance istrunc_setcone : IsHSet setcone := _.
14
+
15
+ Definition setcone_point : setcone := tr (push (inr tt)).
16
+ End SetCone.
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/SetCone.vo ADDED
Binary file (8.68 kB). View file
 
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/epi.v ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Require Import Basics.
2
+ Require Import Types.
3
+ Require Import TruncType.
4
+ Require Import ReflectiveSubuniverse.
5
+ Require Import Colimits.Pushout Truncations.Core HIT.SetCone.
6
+
7
+ Local Open Scope path_scope.
8
+
9
+ Section AssumingUA.
10
+ Context `{ua:Univalence}.
11
+
12
+ (** We will now prove that for sets, epis and surjections are equivalent.*)
13
+ Definition isepi {X Y} `(f:X->Y) := forall Z: HSet,
14
+ forall g h: Y -> Z, g o f = h o f -> g = h.
15
+
16
+ Definition isepi_funext {X Y : Type} (f : X -> Y)
17
+ := forall Z : HSet, forall g0 g1 : Y -> Z, g0 o f == g1 o f -> g0 == g1.
18
+
19
+ Definition isepi' {X Y} `(f : X -> Y) :=
20
+ forall (Z : HSet) (g : Y -> Z), Contr { h : Y -> Z | g o f = h o f }.
21
+
22
+ Lemma equiv_isepi_isepi' {X Y} f : @isepi X Y f <~> @isepi' X Y f.
23
+ Proof.
24
+ unfold isepi, isepi'.
25
+ apply (@equiv_functor_forall' _ _ _ _ _ (equiv_idmap _)); intro Z.
26
+ apply (@equiv_functor_forall' _ _ _ _ _ (equiv_idmap _)); intro g.
27
+ unfold equiv_idmap; simpl.
28
+ refine (transitivity (@equiv_sig_ind _ (fun h : Y -> Z => g o f = h o f) (fun h => g = h.1)) _).
29
+ (** TODO(JasonGross): Can we do this entirely by chaining equivalences? *)
30
+ apply equiv_iff_hprop.
31
+ { intro hepi.
32
+ nrapply (Build_Contr _ (g; idpath)).
33
+ intro xy; specialize (hepi xy).
34
+ apply path_sigma_uncurried.
35
+ exists hepi.
36
+ apply path_ishprop. }
37
+ { intros hepi xy.
38
+ exact (ap pr1 ((contr (g; 1))^ @ contr xy)). }
39
+ Defined.
40
+
41
+ Definition equiv_isepi_isepi_funext {X Y : Type} (f : X -> Y)
42
+ : isepi f <~> isepi_funext f.
43
+ Proof.
44
+ apply equiv_iff_hprop.
45
+ - intros e ? g0 g1 h.
46
+ apply equiv_path_arrow.
47
+ apply e.
48
+ by apply path_arrow.
49
+ - intros e ? g0 g1 p.
50
+ apply path_arrow.
51
+ apply e.
52
+ by apply equiv_path_arrow.
53
+ Defined.
54
+
55
+ Section cones.
56
+ Lemma isepi'_contr_cone `{Funext} {A B : HSet} (f : A -> B) : isepi' f -> Contr (setcone f).
57
+ Proof.
58
+ intros hepi.
59
+ apply (Build_Contr _ (setcone_point _)).
60
+ pose (alpha1 := @pglue A B Unit f (const_tt _)).
61
+ pose (tot:= { h : B -> setcone f & tr o push o inl o f = h o f }).
62
+ transparent assert (l : tot).
63
+ { simple refine (tr o _ o inl; _).
64
+ { refine push. }
65
+ { refine idpath. } }
66
+ pose (r := (@const B (setcone f) (setcone_point _); (ap (fun f => @tr 0 _ o f) (path_forall _ _ alpha1))) : tot).
67
+ subst tot.
68
+ assert (X : l = r).
69
+ { let lem := constr:(fun X push' => hepi (Build_HSet (setcone f)) (tr o push' o @inl _ X)) in
70
+ pose (lem _ push).
71
+ refine (path_contr l r). }
72
+ subst l r.
73
+
74
+ pose (I0 b := ap10 (X ..1) b).
75
+ refine (Trunc_ind _ _).
76
+ pose (fun a : B + Unit => (match a as a return setcone_point _ = tr (push a) with
77
+ | inl a' => (I0 a')^
78
+ | inr tt => idpath
79
+ end)) as I0f.
80
+ refine (Pushout_ind _ (fun a' => I0f (inl a')) (fun u => (I0f (inr u))) _).
81
+
82
+ simpl. subst alpha1. intros.
83
+ unfold setcone_point.
84
+ subst I0. simpl.
85
+ pose (X..2) as p. simpl in p.
86
+ rewrite (transport_precompose f _ _ X..1) in p.
87
+ assert (H':=concat (ap (fun x => ap10 x a) p) (ap10_ap_postcompose tr (path_arrow (pushl o f) (pushr o const_tt _) pglue) _)).
88
+ rewrite ap10_path_arrow in H'.
89
+ clear p.
90
+ (** Apparently [pose; clearbody] is only ~.8 seconds, while [pose proof] is ~4 seconds? *)
91
+ pose (concat (ap10_ap_precompose f (X ..1) a)^ H') as p.
92
+ clearbody p.
93
+ simpl in p.
94
+ rewrite p.
95
+ rewrite transport_paths_Fr.
96
+ apply concat_Vp.
97
+ Qed.
98
+ End cones.
99
+
100
+ Lemma issurj_isepi {X Y} (f:X->Y): IsSurjection f -> isepi f.
101
+ Proof.
102
+ intros sur ? ? ? ep. apply path_forall. intro y.
103
+ specialize (sur y). pose (center (merely (hfiber f y))).
104
+ apply (Trunc_rec (n:=-1) (A:=(sig (fun x : X => f x = y))));
105
+ try assumption.
106
+ intros [x p]. set (p0:=apD10 ep x).
107
+ transitivity (g (f x)).
108
+ - by apply ap.
109
+ - transitivity (h (f x));auto with path_hints. by apply ap.
110
+ Qed.
111
+
112
+ Corollary issurj_isepi_funext {X Y} (f:X->Y) : IsSurjection f -> isepi_funext f.
113
+ Proof.
114
+ intro s.
115
+ apply equiv_isepi_isepi_funext.
116
+ by apply issurj_isepi.
117
+ Defined.
118
+
119
+ (** Old-style proof using polymorphic Omega. Needs resizing for the isepi proof to live in the
120
+ same universe as X and Y (the Z quantifier is instantiated with an HSet at a level higher)
121
+ <<
122
+ Lemma isepi_issurj {X Y} (f:X->Y): isepi f -> issurj f.
123
+ Proof.
124
+ intros epif y.
125
+ set (g :=fun _:Y => Unit_hp).
126
+ set (h:=(fun y:Y => (hp (hexists (fun _ : Unit => {x:X & y = (f x)})) _ ))).
127
+ assert (X1: g o f = h o f ).
128
+ - apply path_forall. intro x. apply path_equiv_biimp_rec;[|done].
129
+ intros _ . apply min1. exists tt. by (exists x).
130
+ - specialize (epif _ g h).
131
+ specialize (epif X1). clear X1.
132
+ set (p:=apD10 epif y).
133
+ apply (@minus1Trunc_map (sig (fun _ : Unit => sig (fun x : X => y = f x)))).
134
+ + intros [ _ [x eq]].
135
+ exists x.
136
+ by symmetry.
137
+ + apply (transport hproptype p tt).
138
+ Defined.
139
+ >>
140
+ *)
141
+
142
+ Section isepi_issurj.
143
+ Context {X Y : HSet} (f : X -> Y) (Hisepi : isepi f).
144
+ Definition epif := equiv_isepi_isepi' _ Hisepi.
145
+ Definition fam (c : setcone f) : HProp.
146
+ Proof.
147
+ pose (fib y := hexists (fun x : X => f x = y)).
148
+ apply (fun f => @Trunc_rec _ _ HProp _ f c).
149
+ refine (Pushout_rec HProp fib (fun _ => Unit_hp) (fun x => _)).
150
+ (** Prove that the truncated sigma is equivalent to Unit *)
151
+ pose (contr_inhabited_hprop (fib (f x)) (tr (x; idpath))) as i.
152
+ apply path_hprop. simpl. simpl in i.
153
+ apply (equiv_contr_unit).
154
+ Defined.
155
+
156
+ Lemma isepi_issurj : IsSurjection f.
157
+ Proof.
158
+ intros y.
159
+ pose (i := isepi'_contr_cone _ epif).
160
+
161
+ assert (X0 : forall x : setcone f, fam x = fam (setcone_point f)).
162
+ { intros. apply contr_dom_equiv. apply i. }
163
+ specialize (X0 (tr (push (inl y)))). simpl in X0.
164
+ unfold IsConnected.
165
+ refine (transport (fun A => Contr A) (ap trunctype_type X0)^ _); exact _.
166
+ Defined.
167
+ End isepi_issurj.
168
+
169
+ Lemma isepi_isequiv X Y (f : X -> Y) `{IsEquiv _ _ f}
170
+ : isepi f.
171
+ Proof.
172
+ intros ? g h H'.
173
+ apply ap10 in H'.
174
+ apply path_forall.
175
+ intro x.
176
+ transitivity (g (f (f^-1 x))).
177
+ - by rewrite eisretr.
178
+ - transitivity (h (f (f^-1 x))).
179
+ * apply H'.
180
+ * by rewrite eisretr.
181
+ Qed.
182
+ End AssumingUA.
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/epi.vo ADDED
Binary file (70.2 kB). View file
 
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/iso.v ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Require Import HoTT.Basics.
2
+ Require Import Types.Universe.
3
+ Require Import HSet.
4
+ Require Import HIT.epi HIT.unique_choice.
5
+
6
+ Local Open Scope path_scope.
7
+
8
+ (** We prove that [epi + mono <-> IsEquiv] *)
9
+ Section iso.
10
+ Context `{Univalence}.
11
+ Variables X Y : HSet.
12
+ Variable f : X -> Y.
13
+
14
+ Lemma atmost1P_isinj (injf : isinj f)
15
+ : forall y : Y, atmost1P (fun x => f x = y).
16
+ Proof.
17
+ unfold isinj, atmost1P in *.
18
+ intros.
19
+ apply injf.
20
+ path_induction.
21
+ reflexivity.
22
+ Defined.
23
+
24
+ Definition isequiv_isepi_ismono (epif : isepi f) (monof : ismono f)
25
+ : IsEquiv f.
26
+ Proof.
27
+ pose proof (@isepi_issurj _ _ _ f epif) as surjf.
28
+ pose proof (isinj_ismono _ monof) as injf.
29
+ pose proof (unique_choice
30
+ (fun y x => f x = y)
31
+ _
32
+ (fun y => (@center _ (surjf y), atmost1P_isinj injf y)))
33
+ as H_unique_choice.
34
+ apply (isequiv_adjointify _ H_unique_choice.1).
35
+ - intro.
36
+ apply H_unique_choice.2.
37
+ - intro.
38
+ apply injf.
39
+ apply H_unique_choice.2.
40
+ Defined.
41
+ End iso.
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/iso.vo ADDED
Binary file (11.7 kB). View file
 
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/quotient.v ADDED
@@ -0,0 +1,328 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (* -*- mode: coq; mode: visual-line -*- *)
2
+ Require Import HoTT.Basics HoTT.Types.
3
+ Require Import HSet TruncType.
4
+ Require Import Truncations.Core.
5
+
6
+ Local Open Scope path_scope.
7
+
8
+ (** * The set-quotient of a type by an hprop-valued relation
9
+
10
+ We aim to model:
11
+ <<
12
+ Inductive quotient : Type :=
13
+ | class_of : A -> quotient
14
+ | related_classes_eq : forall x y, (R x y), class_of x = class_of y
15
+ | quotient_set : IsHSet quotient
16
+ >>
17
+ *)
18
+
19
+ (** TODO: This development should be further connected with the sections in the book; see below. And it should be merged with Colimits.Quotient. Currently this file is only used in Classes/implementations/natpair_integers.v and Classes/implementations/field_of_fractions.v, so it shouldn't be too hard to switch to Colimits.Quotient. *)
20
+
21
+ Module Export Quotient.
22
+
23
+ Section Domain.
24
+
25
+ Universes i j u.
26
+ Constraint i <= u, j <= u.
27
+
28
+ Context {A : Type@{i}} (R : Relation@{i j} A) {sR: is_mere_relation _ R}.
29
+
30
+ (** We choose to let the definition of quotient depend on the proof that [R] is a set-relations. Alternatively, we could have defined it for all relations and only develop the theory for set-relations. The former seems more natural.
31
+
32
+ We do not require [R] to be an equivalence relation, but implicitly consider its transitive-reflexive closure. *)
33
+
34
+ (** This definition has a parameter [sR] that shadows the ambient one in the Context in order to ensure that it actually ends up depending on everything in the Context when the section is closed, since its definition doesn't actually refer to any of them. *)
35
+ Private Inductive quotient {sR: is_mere_relation _ R} : Type@{u} :=
36
+ | class_of : A -> quotient.
37
+
38
+ (** The path constructors. *)
39
+ Axiom related_classes_eq
40
+ : forall {x y : A}, R x y ->
41
+ class_of x = class_of y.
42
+
43
+ Axiom quotient_set : IsHSet (@quotient sR).
44
+ Global Existing Instance quotient_set.
45
+
46
+ Definition quotient_ind (P : (@quotient sR) -> Type) {sP : forall x, IsHSet (P x)}
47
+ (dclass : forall x, P (class_of x))
48
+ (dequiv : (forall x y (H : R x y), (related_classes_eq H) # (dclass x) = dclass y))
49
+ : forall q, P q
50
+ := fun q => match q with class_of a => fun _ _ => dclass a end sP dequiv.
51
+
52
+ Definition quotient_ind_compute {P sP} dclass dequiv x
53
+ : @quotient_ind P sP dclass dequiv (class_of x) = dclass x.
54
+ Proof.
55
+ reflexivity.
56
+ Defined.
57
+
58
+ (** Again equality of paths needs to be postulated *)
59
+ Axiom quotient_ind_compute_path
60
+ : forall P sP dclass dequiv,
61
+ forall x y (H : R x y),
62
+ apD (@quotient_ind P sP dclass dequiv) (related_classes_eq H)
63
+ = dequiv x y H.
64
+
65
+ End Domain.
66
+
67
+ End Quotient.
68
+
69
+ Section Equiv.
70
+
71
+ Context `{Univalence}.
72
+
73
+ Context {A : Type} (R : Relation A) {sR: is_mere_relation _ R}
74
+ {Htrans : Transitive R} {Hsymm : Symmetric R}.
75
+
76
+ Lemma quotient_path2 : forall {x y : quotient R} (p q : x=y), p=q.
77
+ Proof.
78
+ apply @hset_path2. apply _.
79
+ Defined.
80
+
81
+ Definition in_class : quotient R -> A -> HProp.
82
+ Proof.
83
+ refine (quotient_ind R (fun _ => A -> HProp) (fun a b => Build_HProp (R a b)) _).
84
+ intros. eapply concat;[apply transport_const|].
85
+ apply path_forall. intro z. apply path_hprop; simpl.
86
+ apply @equiv_iff_hprop; eauto.
87
+ Defined.
88
+
89
+ Context {Hrefl : Reflexive R}.
90
+
91
+ Lemma in_class_pr : forall x y, (in_class (class_of R x) y : Type) = R x y.
92
+ Proof.
93
+ reflexivity.
94
+ Defined.
95
+
96
+ Lemma quotient_ind_prop (P : quotient R -> Type)
97
+ `{forall x, IsHProp (P x)} :
98
+ forall dclass : forall x, P (class_of R x),
99
+ forall q, P q.
100
+ Proof.
101
+ intros. apply (quotient_ind R P dclass).
102
+ intros. apply path_ishprop.
103
+ Defined.
104
+
105
+ Global Instance decidable_in_class `{forall x y, Decidable (R x y)}
106
+ : forall x a, Decidable (in_class x a).
107
+ Proof.
108
+ refine (quotient_ind_prop _ _).
109
+ intros a b; exact (transport Decidable (in_class_pr a b) _).
110
+ Defined.
111
+
112
+ Lemma class_of_repr : forall q x, in_class q x -> q = class_of R x.
113
+ Proof.
114
+ apply (quotient_ind R
115
+ (fun q : quotient R => forall x, in_class q x -> q = class_of _ x)
116
+ (fun x y H => related_classes_eq R H)).
117
+ intros.
118
+ apply path_forall. intro z.
119
+ apply path_forall;intro H'.
120
+ apply quotient_path2.
121
+ Defined.
122
+
123
+ Lemma classes_eq_related : forall x y,
124
+ class_of R x = class_of R y -> R x y.
125
+ Proof.
126
+ intros x y H'.
127
+ pattern (R x y).
128
+ eapply transport.
129
+ - apply in_class_pr.
130
+ - pattern (class_of R x). apply (transport _ (H'^)).
131
+ apply Hrefl.
132
+ Defined.
133
+
134
+ (** Thm 10.1.8 *)
135
+ Theorem sets_exact : forall x y, (class_of R x = class_of R y) <~> R x y.
136
+ intros ??. apply equiv_iff_hprop.
137
+ - apply classes_eq_related.
138
+ - apply related_classes_eq.
139
+ Defined.
140
+
141
+ Definition quotient_rec {B : Type} {sB : IsHSet B}
142
+ (dclass : (forall x : A, B))
143
+ (dequiv : (forall x y, R x y -> dclass x = dclass y))
144
+ : quotient R -> B.
145
+ Proof.
146
+ apply (quotient_ind R (fun _ : quotient _ => B)) with dclass.
147
+ intros ?? H'. destruct (related_classes_eq R H'). by apply dequiv.
148
+ Defined.
149
+
150
+ Definition quotient_rec2 {B : HSet} {dclass : (A -> A -> B)}:
151
+ forall dequiv : (forall x x', R x x' -> forall y y', R y y' ->
152
+ dclass x y = dclass x' y'),
153
+ quotient R -> quotient R -> B.
154
+ Proof.
155
+ intro.
156
+ assert (dequiv0 : forall x x0 y : A, R x0 y -> dclass x x0 = dclass x y)
157
+ by (intros ? ? ? Hx; apply dequiv;[apply Hrefl|done]).
158
+ refine (quotient_rec
159
+ (fun x => quotient_rec (dclass x) (dequiv0 x)) _).
160
+ intros x x' Hx.
161
+ apply path_forall. red.
162
+ assert (dequiv1 : forall y : A,
163
+ quotient_rec (dclass x) (dequiv0 x) (class_of _ y) =
164
+ quotient_rec (dclass x') (dequiv0 x') (class_of _ y))
165
+ by (intros; by apply dequiv).
166
+ refine (quotient_ind R (fun q =>
167
+ quotient_rec (dclass x) (dequiv0 x) q =
168
+ quotient_rec (dclass x') (dequiv0 x') q) dequiv1 _).
169
+ intros. apply path_ishprop.
170
+ Defined.
171
+
172
+ Definition quotient_ind_prop' : forall P : quotient R -> Type,
173
+ forall (Hprop' : forall x, IsHProp (P (class_of _ x))),
174
+ (forall x, P (class_of _ x)) -> forall y, P y.
175
+ Proof.
176
+ intros ? ? dclass. apply quotient_ind with dclass.
177
+ - simple refine (quotient_ind R (fun x => IsHSet (P x)) _ _); cbn beta; try exact _.
178
+ intros; apply path_ishprop.
179
+ - intros. apply path_ishprop.
180
+ Defined.
181
+
182
+ (** From Ch6 *)
183
+ Theorem quotient_surjective: IsSurjection (class_of R).
184
+ Proof.
185
+ apply BuildIsSurjection.
186
+ apply (quotient_ind_prop (fun y => merely (hfiber (class_of R) y))); try exact _.
187
+ intro x. apply tr. by exists x.
188
+ Defined.
189
+
190
+ (** From Ch10 *)
191
+ Definition quotient_ump' (B:HSet): (quotient R -> B) ->
192
+ (sig (fun f : A-> B => (forall a a0:A, R a a0 -> f a =f a0))).
193
+ intro f. exists (compose f (class_of R) ).
194
+ intros. f_ap. by apply related_classes_eq.
195
+ Defined.
196
+
197
+ Definition quotient_ump'' (B:HSet): (sig (fun f : A-> B => (forall a a0:A, R a a0 -> f a =f a0)))
198
+ -> quotient R -> B.
199
+ intros [f H'].
200
+ apply (quotient_rec _ H').
201
+ Defined.
202
+
203
+ Theorem quotient_ump (B:HSet): (quotient R -> B) <~>
204
+ (sig (fun f : A-> B => (forall a a0:A, R a a0 -> f a =f a0))).
205
+ Proof.
206
+ refine (equiv_adjointify (quotient_ump' B) (quotient_ump'' B) _ _).
207
+ - intros [f Hf].
208
+ by apply equiv_path_sigma_hprop.
209
+ - intros f.
210
+ apply path_forall.
211
+ red. apply quotient_ind_prop';[apply _|reflexivity].
212
+ Defined.
213
+
214
+ (** Missing
215
+
216
+ The equivalence with VVquotient [A//R].
217
+
218
+ This should lead to the unnamed theorem:
219
+
220
+ 10.1.10. Equivalence relations are effective and there is an equivalence [A/R<~>A//R]. *)
221
+
222
+ (**
223
+ The theory of canonical quotients is developed by C.Cohen:
224
+ http://perso.crans.org/cohen/work/quotients/
225
+ *)
226
+
227
+ End Equiv.
228
+
229
+ Section Functoriality.
230
+
231
+ Definition quotient_functor
232
+ {A : Type} (R : Relation A) {sR: is_mere_relation _ R}
233
+ {B : Type} (S : Relation B) {sS: is_mere_relation _ S}
234
+ (f : A -> B) (fresp : forall x y, R x y -> S (f x) (f y))
235
+ : quotient R -> quotient S.
236
+ Proof.
237
+ refine (quotient_rec R (class_of S o f) _).
238
+ intros x y r.
239
+ apply related_classes_eq, fresp, r.
240
+ Defined.
241
+
242
+ Context {A : Type} (R : Relation A) {sR: is_mere_relation _ R}
243
+ {B : Type} (S : Relation B) {sS: is_mere_relation _ S}.
244
+
245
+ Global Instance quotient_functor_isequiv
246
+ (f : A -> B) (fresp : forall x y, R x y <-> S (f x) (f y))
247
+ `{IsEquiv _ _ f}
248
+ : IsEquiv (quotient_functor R S f (fun x y => fst (fresp x y))).
249
+ Proof.
250
+ simple refine (isequiv_adjointify _ (quotient_functor S R f^-1 _)
251
+ _ _).
252
+ - intros u v s.
253
+ apply (snd (fresp _ _)).
254
+ abstract (do 2 rewrite eisretr; apply s).
255
+ - intros x; revert x; simple refine (quotient_ind S _ _ _).
256
+ + intros b; simpl. apply ap, eisretr.
257
+ + intros; apply path_ishprop.
258
+ - intros x; revert x; simple refine (quotient_ind R _ _ _).
259
+ + intros a; simpl. apply ap, eissect.
260
+ + intros; apply path_ishprop.
261
+ Defined.
262
+
263
+ Definition quotient_functor_equiv
264
+ (f : A -> B) (fresp : forall x y, R x y <-> S (f x) (f y))
265
+ `{IsEquiv _ _ f}
266
+ : quotient R <~> quotient S
267
+ := Build_Equiv _ _
268
+ (quotient_functor R S f (fun x y => fst (fresp x y))) _.
269
+
270
+ Definition quotient_functor_equiv'
271
+ (f : A <~> B) (fresp : forall x y, R x y <-> S (f x) (f y))
272
+ : quotient R <~> quotient S
273
+ := quotient_functor_equiv f fresp.
274
+
275
+ End Functoriality.
276
+
277
+ Section Kernel.
278
+
279
+ (** ** Quotients of kernels of maps to sets give a surjection/mono factorization. *)
280
+
281
+ Context {fs : Funext}.
282
+
283
+ (** A function we want to factor. *)
284
+ Context {A B : Type} `{IsHSet B} (f : A -> B).
285
+
286
+ (** A mere relation equivalent to its kernel. *)
287
+ Context (R : Relation A) {sR : is_mere_relation _ R}.
288
+ Context (is_ker : forall x y, f x = f y <~> R x y).
289
+
290
+ Theorem quotient_kernel_factor
291
+ : exists (C : Type) (e : A -> C) (m : C -> B),
292
+ IsHSet C * IsSurjection e * IsEmbedding m * (f = m o e).
293
+ Proof.
294
+ pose (C := quotient R).
295
+ (* We put this explicitly in the context so that typeclass resolution will pick it up. *)
296
+ assert (IsHSet C) by (unfold C; apply _).
297
+ exists C.
298
+ pose (e := class_of R).
299
+ exists e.
300
+ transparent assert (m : (C -> B)).
301
+ { apply quotient_ind with f; try exact _.
302
+ intros x y H. transitivity (f x).
303
+ - apply transport_const.
304
+ - exact ((is_ker x y) ^-1 H). }
305
+ exists m.
306
+ split;[split;[split|]|].
307
+ - assumption.
308
+ - apply quotient_surjective.
309
+ - intro u.
310
+ apply hprop_allpath.
311
+ assert (H : forall (x y : C) (p : m x = u) (p' : m y = u), x = y).
312
+ { simple refine (quotient_ind R _ _ _).
313
+ - intro a.
314
+ simple refine (quotient_ind R _ _ _).
315
+ + intros a' p p'; fold e in p, p'.
316
+ * apply related_classes_eq.
317
+ refine (is_ker a a' _).
318
+ change (m (e a) = m (e a')).
319
+ exact (p @ p'^).
320
+ + intros; apply path_ishprop.
321
+ - intros; apply path_ishprop. }
322
+ intros [x p] [y p'].
323
+ apply path_sigma_hprop; simpl.
324
+ exact (H x y p p').
325
+ - reflexivity.
326
+ Defined.
327
+
328
+ End Kernel.
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/surjective_factor.v ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Require Import
2
+ HoTT.Types
3
+ HoTT.Basics
4
+ HoTT.Truncations.Core Modalities.Modality.
5
+
6
+ (** Definition by factoring through a surjection. *)
7
+
8
+ Section surjective_factor.
9
+ Context `{Funext}.
10
+ Context {A B C} `{IsHSet C} `(f : A -> C) `(g : A -> B) {Esurj : IsSurjection g}.
11
+ Variable (Eg : forall x y, g x = g y -> f x = f y).
12
+
13
+ Lemma ishprop_surjective_factor_aux : forall b, IsHProp (exists c : C, forall a, g a = b -> f a = c).
14
+ Proof.
15
+ intros. apply Sigma.ishprop_sigma_disjoint.
16
+ intros c1 c2 E1 E2.
17
+ generalize (@center _ (Esurj b)); apply (Trunc_ind _).
18
+ intros [a p];destruct p.
19
+ path_via (f a).
20
+ Qed.
21
+
22
+ Definition surjective_factor_aux :=
23
+ @conn_map_elim
24
+ _ _ _ _ Esurj (fun b => exists c : C, forall a, g a = b -> f a = c)
25
+ ishprop_surjective_factor_aux
26
+ (fun a => exist (fun c => forall a, _ -> _ = c) (f a) (fun a' => Eg a' a)).
27
+
28
+ Definition surjective_factor : B -> C
29
+ := fun b => (surjective_factor_aux b).1.
30
+
31
+ Lemma surjective_factor_pr : f == compose surjective_factor g.
32
+ Proof.
33
+ intros a.
34
+ apply (surjective_factor_aux (g a)).2. trivial.
35
+ Qed.
36
+
37
+ End surjective_factor.
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/surjective_factor.vo ADDED
Binary file (12.6 kB). View file
 
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/unique_choice.v ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Require Import HoTT.Basics HoTT.Truncations.Core.
2
+
3
+ Definition atmost1 X:=(forall x1 x2:X, (x1 = x2)).
4
+ Definition atmost1P {X} (P:X->Type):=
5
+ (forall x1 x2:X, P x1 -> P x2 -> (x1 = x2)).
6
+ Definition hunique {X} (P:X->Type):=(hexists P) * (atmost1P P).
7
+
8
+ Lemma atmost {X} {P : X -> Type}:
9
+ (forall x, IsHProp (P x)) -> (atmost1P P) -> atmost1 (sig P).
10
+ intros H H0 [x p] [y q].
11
+ specialize (H0 x y p q).
12
+ induction H0.
13
+ assert (H0: (p =q)) by apply path_ishprop.
14
+ now induction H0.
15
+ Qed.
16
+
17
+ Lemma iota {X} (P:X-> Type):
18
+ (forall x, IsHProp (P x)) -> (hunique P) -> sig P.
19
+ Proof.
20
+ intros H1 [H H0].
21
+ apply (@Trunc_rec (-1) (sig P) );auto.
22
+ by apply hprop_allpath, atmost.
23
+ Qed.
24
+
25
+ Lemma unique_choice {X Y} (R:X->Y->Type) :
26
+ (forall x y, IsHProp (R x y)) -> (forall x, (hunique (R x)))
27
+ -> {f : X -> Y & forall x, (R x (f x))}.
28
+ intros X0 X1.
29
+ exists (fun x:X => (pr1 (iota _ (X0 x) (X1 x)))).
30
+ intro x. apply (pr2 (iota _ (X0 x) (X1 x))).
31
+ Qed.
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/HIT/unique_choice.vo ADDED
Binary file (9.77 kB). View file
 
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Pointed/pFiber.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f24569b0e96de2846b8733568c9546aed28b23136c49dfc7e0abf14fbc7c4af2
3
+ size 199966
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Pointed/pMap.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c1d5a4c5f776b9c8bce55f80839cbe0fa73869130a2c443e987ea1a7f89646a9
3
+ size 391923
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Spaces/BAut/Bool.v ADDED
@@ -0,0 +1,445 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (* -*- mode: coq; mode: visual-line -*- *)
2
+ Require Import HoTT.Basics HoTT.Types.
3
+ Require Import Constant.
4
+ Require Import HoTT.Truncations.Core HoTT.Truncations.Connectedness.
5
+ Require Import Spaces.BAut.
6
+ Require Import Pointed.Core.
7
+
8
+ Local Open Scope trunc_scope.
9
+ Local Open Scope path_scope.
10
+ Local Open Scope pointed_scope.
11
+
12
+ (** * BAut(Bool) *)
13
+
14
+ Section AssumeUnivalence.
15
+ Context `{Univalence}.
16
+
17
+ (** ** Nontrivial central homotopy *)
18
+
19
+ (** The equivalence [Bool <~> (Bool <~> Bool)], and particularly its consequence [abelian_aut_bool], implies that [BAut Bool] has a nontrivial center. *)
20
+
21
+ Definition negb_center_baut_bool
22
+ : forall (Z:BAut Bool), Z = Z.
23
+ Proof.
24
+ apply center_baut; try exact _.
25
+ exists equiv_negb.
26
+ intros g; apply abelian_aut_bool.
27
+ Defined.
28
+
29
+ Definition nontrivial_negb_center_baut_bool
30
+ : negb_center_baut_bool <> (fun Z => idpath Z).
31
+ Proof.
32
+ intros oops.
33
+ pose (p := ap10_equiv
34
+ ((ap (center_baut Bool))^-1
35
+ (oops @ (id_center_baut Bool)^))..1 true).
36
+ exact (false_ne_true p).
37
+ Defined.
38
+
39
+ (** In particular, every element of [BAut Bool] has a canonical flip automorphism. *)
40
+ Definition negb_baut_bool (Z : BAut Bool) : Z <~> Z
41
+ := equiv_path Z Z (negb_center_baut_bool Z)..1.
42
+
43
+ Definition negb_baut_bool_ne_idmap (Z : BAut Bool)
44
+ : negb_baut_bool Z <> equiv_idmap Z.
45
+ Proof.
46
+ intros oops.
47
+ apply nontrivial_negb_center_baut_bool.
48
+ apply path_forall; intros Z'.
49
+ pose (p := merely_path_component Z Z').
50
+ clearbody p. strip_truncations.
51
+ destruct p.
52
+ unfold negb_baut_bool in oops.
53
+ apply moveL_equiv_V in oops.
54
+ refine (_ @ ap (equiv_path_sigma_hprop _ _)
55
+ (oops @ path_universe_1) @ _).
56
+ - symmetry.
57
+ refine (eisretr (equiv_path_sigma_hprop Z Z) _).
58
+ - apply moveR_equiv_M; reflexivity.
59
+ Defined.
60
+
61
+ (** If [Z] is [Bool], then the flip is the usual one. *)
62
+ Definition negb_baut_bool_bool_negb
63
+ : negb_baut_bool pt = equiv_negb.
64
+ Proof.
65
+ pose (c := aut_bool_idmap_or_negb (negb_baut_bool pt)).
66
+ destruct c.
67
+ - pose (negb_baut_bool_ne_idmap pt p).
68
+ contradiction.
69
+ - assumption.
70
+ Defined.
71
+
72
+ Definition ap_pr1_negb_baut_bool_bool
73
+ : (negb_center_baut_bool pt)..1 = path_universe negb.
74
+ Proof.
75
+ apply moveL_equiv_V.
76
+ apply negb_baut_bool_bool_negb.
77
+ Defined.
78
+
79
+ (** Moreover, we can show that every automorphism of a [Z : BAut Bool] must be either the flip or the identity. *)
80
+ Definition aut_baut_bool_idmap_or_negb (Z : BAut Bool) (e : Z <~> Z)
81
+ : (e = equiv_idmap Z) + (e = negb_baut_bool Z).
82
+ Proof.
83
+ assert (IsHProp ((e = equiv_idmap Z) + (e = negb_baut_bool Z))).
84
+ { apply ishprop_sum; try exact _.
85
+ intros p q; exact (negb_baut_bool_ne_idmap Z (q^ @ p)). }
86
+ baut_reduce.
87
+ case (aut_bool_idmap_or_negb e).
88
+ - intros p; exact (inl p).
89
+ - intros q; apply inr.
90
+ exact (q @ negb_baut_bool_bool_negb^).
91
+ Defined.
92
+
93
+ (** ** Connectedness *)
94
+
95
+ Global Instance isminusoneconnected_baut_bool `{Funext} (Z : BAut Bool)
96
+ : IsConnected (-1) Z.
97
+ Proof.
98
+ baut_reduce.
99
+ apply contr_inhabited_hprop; try exact _.
100
+ exact (tr true).
101
+ Defined.
102
+
103
+ Definition merely_inhab_baut_bool `{Funext} (Z : BAut Bool)
104
+ : merely Z
105
+ := center (merely Z).
106
+
107
+ (** ** Equivalence types *)
108
+
109
+ (** As soon as an element of [BAut Bool] is inhabited, it is (purely) equivalent to [Bool]. (Of course, every element of [BAut Bool] is *merely* inhabited, since [Bool] is.) In fact, it is equivalent in two canonical ways.
110
+
111
+ First we define the function that will be the equivalence. *)
112
+ Definition inhab_baut_bool_from_bool (t : Bool)
113
+ (Z : BAut Bool) (z : Z)
114
+ : Bool -> Z
115
+ := fun b => if t then
116
+ if b then z else negb_baut_bool Z z
117
+ else
118
+ if b then negb_baut_bool Z z else z.
119
+
120
+ (** We compute this in the case when [Z] is [Bool]. *)
121
+ Definition inhab_baut_bool_from_bool_bool (t : Bool)
122
+ : inhab_baut_bool_from_bool t pt =
123
+ fun (z : point (BAut Bool)) (b : Bool) =>
124
+ if t then
125
+ if b then z else negb z
126
+ else
127
+ if b then negb z else z.
128
+ Proof.
129
+ apply path_forall; intros z'; simpl in z'.
130
+ apply path_forall; intros b.
131
+ destruct z', b, t; simpl;
132
+ try reflexivity;
133
+ try apply (ap10_equiv negb_baut_bool_bool_negb).
134
+ Defined.
135
+
136
+ (** Now we show that it is an equivalence. *)
137
+ Global Instance isequiv_inhab_baut_bool_from_bool (t : Bool)
138
+ (Z : BAut Bool) (z : Z)
139
+ : IsEquiv (inhab_baut_bool_from_bool t Z z).
140
+ Proof.
141
+ baut_reduce.
142
+ refine (transport IsEquiv (ap10 (inhab_baut_bool_from_bool_bool t)^ z) _).
143
+ simpl in z; destruct z, t; simpl.
144
+ - refine (isequiv_homotopic idmap _); intros []; reflexivity.
145
+ - apply isequiv_negb.
146
+ - apply isequiv_negb.
147
+ - refine (isequiv_homotopic idmap _); intros []; reflexivity.
148
+ Defined.
149
+
150
+ Definition equiv_inhab_baut_bool_bool (t : Bool)
151
+ (Z : BAut Bool) (z : Z)
152
+ : Bool <~> Z
153
+ := Build_Equiv _ _ (inhab_baut_bool_from_bool t Z z) _.
154
+
155
+ Definition path_baut_bool_inhab (Z : BAut Bool) (z : Z)
156
+ : (point (BAut Bool)) = Z.
157
+ Proof.
158
+ apply path_baut.
159
+ exact (equiv_inhab_baut_bool_bool true Z z). (** [true] is a choice! *)
160
+ Defined.
161
+
162
+ (** In fact, the map sending [z:Z] to this equivalence [Bool <~> Z] is also an equivalence. To assist with computing the result when [Z] is [Bool], we prove it with an extra parameter first. *)
163
+ Definition isequiv_equiv_inhab_baut_bool_bool_lemma
164
+ (t : Bool) (Z : BAut Bool) (m : merely (pt = Z))
165
+ : IsEquiv (equiv_inhab_baut_bool_bool t Z).
166
+ Proof.
167
+ strip_truncations. destruct m.
168
+ refine (isequiv_adjointify _ (fun (e : Bool <~> Bool) => e t) _ _).
169
+ + intros e.
170
+ apply path_equiv.
171
+ refine (ap10 (inhab_baut_bool_from_bool_bool t) (e t) @ _).
172
+ apply path_arrow; intros []; destruct t.
173
+ * reflexivity.
174
+ * refine (abelian_aut_bool equiv_negb e false).
175
+ * refine (abelian_aut_bool equiv_negb e true).
176
+ * reflexivity.
177
+ + intros z.
178
+ refine (ap10 (ap10 (inhab_baut_bool_from_bool_bool t) z) t @ _).
179
+ destruct t; reflexivity.
180
+ Defined.
181
+
182
+ Global Instance isequiv_equiv_inhab_baut_bool_bool
183
+ (t : Bool) (Z : BAut Bool)
184
+ : IsEquiv (equiv_inhab_baut_bool_bool t Z).
185
+ Proof.
186
+ exact (isequiv_equiv_inhab_baut_bool_bool_lemma t Z
187
+ (merely_path_component _ _)).
188
+ Defined.
189
+
190
+ (** The names are getting pretty ridiculous; below we suggest a better name for this. *)
191
+ Definition equiv_equiv_inhab_baut_bool_bool (t : Bool)
192
+ (Z : BAut Bool)
193
+ : Z <~> (Bool <~> Z)
194
+ := Build_Equiv _ _ (equiv_inhab_baut_bool_bool t Z) _.
195
+
196
+ (** We compute its inverse in the case of [Bool]. *)
197
+ Definition equiv_equiv_inhab_baut_bool_bool_bool_inv (t : Bool)
198
+ (e : Bool <~> Bool)
199
+ : equiv_inverse (equiv_equiv_inhab_baut_bool_bool t pt) e = e t.
200
+ Proof.
201
+ pose (alt := Build_Equiv _ _ (equiv_inhab_baut_bool_bool t pt)
202
+ (isequiv_equiv_inhab_baut_bool_bool_lemma
203
+ t pt (tr 1))).
204
+ assert (p : equiv_equiv_inhab_baut_bool_bool t pt = alt).
205
+ { apply (ap (fun i => Build_Equiv _ _ _ i)).
206
+ apply (ap (isequiv_equiv_inhab_baut_bool_bool_lemma t pt)).
207
+ apply path_ishprop. }
208
+ exact (ap10_equiv (ap equiv_inverse p) e).
209
+ Defined.
210
+
211
+ (** ** Group structure *)
212
+
213
+ (** Homotopically, [BAut Bool] is a [K(Z/2,1)]. In particular, it has a (coherent) abelian group structure induced from that of [Z/2]. With our definition of [BAut Bool], we can construct this operation as follows. *)
214
+
215
+ Definition baut_bool_pairing : BAut Bool -> BAut Bool -> BAut Bool.
216
+ Proof.
217
+ intros Z W.
218
+ exists (Z <~> W).
219
+ baut_reduce; simpl.
220
+ apply tr, symmetry.
221
+ exact (path_universe equiv_bool_aut_bool).
222
+ Defined.
223
+
224
+ Declare Scope baut_bool_scope.
225
+ Notation "Z ** W" := (baut_bool_pairing Z W) : baut_bool_scope.
226
+ Local Open Scope baut_bool_scope.
227
+
228
+ (** Now [equiv_equiv_inhab_baut_bool_bool] is revealed as simply the left unit law of this pairing. *)
229
+ Definition baut_bool_pairing_1Z Z : pt ** Z = Z.
230
+ Proof.
231
+ apply path_baut, equiv_inverse, equiv_equiv_inhab_baut_bool_bool.
232
+ exact true. (** This is a choice! *)
233
+ Defined.
234
+
235
+ (** The pairing is obviously symmetric. *)
236
+ Definition baut_bool_pairing_symm Z W : Z ** W = W ** Z.
237
+ Proof.
238
+ apply path_baut, equiv_equiv_inverse.
239
+ Defined.
240
+
241
+ (** Whence we get the right unit law as well. *)
242
+ Definition baut_bool_pairing_Z1 Z : Z ** pt = Z
243
+ := baut_bool_pairing_symm Z pt @ baut_bool_pairing_1Z Z.
244
+
245
+ (** Every element is its own inverse. *)
246
+ Definition baut_bool_pairing_ZZ Z : Z ** Z = pt.
247
+ Proof.
248
+ apply symmetry, path_baut_bool_inhab.
249
+ apply equiv_idmap. (** A choice! Could be the flip. *)
250
+ Defined.
251
+
252
+ (** Associativity is easiest to think about in terms of "curried 2-variable equivalences". We start with some auxiliary lemmas. *)
253
+ Definition baut_bool_pairing_ZZ_Z_symm_part1 {Y Z W}
254
+ (e : Y ** (Z ** W)) (z : Z)
255
+ : Y ** W.
256
+ Proof.
257
+ simple refine (equiv_adjointify _ _ _ _).
258
+ + exact (fun y => e y z).
259
+ + intros w.
260
+ destruct (path_baut_bool_inhab W w).
261
+ destruct (path_baut_bool_inhab Z z).
262
+ (** It might be tempting to just say [e^-1 (equiv_idmap _)] here, but for the rest of the proof to work, we actually need to choose between [idmap] and [negb] based on whether [z] and [w] are equal or not. *)
263
+ destruct (dec (z=w)).
264
+ * exact (e^-1 (equiv_idmap _)).
265
+ * exact (e^-1 equiv_negb).
266
+ + intros w.
267
+ destruct (path_baut_bool_inhab W w).
268
+ destruct (path_baut_bool_inhab Z z).
269
+ simpl.
270
+ destruct z,w; simpl; refine (ap10_equiv (eisretr e _) _).
271
+ + intros y.
272
+ destruct (path_baut_bool_inhab Y y).
273
+ destruct (path_baut_bool_inhab Z z).
274
+ destruct (path_baut_bool_inhab W (e y z)).
275
+ simpl.
276
+ case (dec (z = e y z)); intros p; apply moveR_equiv_V;
277
+ destruct (aut_bool_idmap_or_negb (e y)) as [q|q].
278
+ * symmetry; assumption.
279
+ * case (not_fixed_negb z (p @ ap10_equiv q z)^).
280
+ * case (p (ap10_equiv q z)^).
281
+ * symmetry; assumption.
282
+ Defined.
283
+
284
+ Definition baut_bool_pairing_ZZ_Z_symm_lemma {Y Z W}
285
+ (e : Y ** (Z ** W)) (f : Y ** W)
286
+ : merely Y -> Z.
287
+ Proof.
288
+ pose (k := (fun y => (e y)^-1 (f y))).
289
+ refine (merely_rec_hset k); intros y1 y2.
290
+ destruct (path_baut_bool_inhab Y y1).
291
+ destruct (path_baut_bool_inhab W (f y1)).
292
+ destruct (path_baut_bool_inhab Z (k y1)).
293
+ destruct (aut_bool_idmap_or_negb f) as [p|p];
294
+ refine (ap (e y1)^-1 (ap10_equiv p y1) @ _);
295
+ refine (_ @ (ap (e y2)^-1 (ap10_equiv p y2))^);
296
+ clear p f k; simpl.
297
+ + destruct (dec (y1=y2)) as [p|p].
298
+ { exact (ap (fun y => (e y)^-1 y) p). }
299
+ destruct (aut_bool_idmap_or_negb (e y1)) as [q1|q1];
300
+ destruct (aut_bool_idmap_or_negb (e y2)) as [q2|q2].
301
+ * case (p ((ap e)^-1 (q1 @ q2^))).
302
+ * rewrite q1, q2. exact (negb_ne p).
303
+ * rewrite q1, q2. symmetry. exact (negb_ne (fun r => p r^)).
304
+ * case (p ((ap e)^-1 (q1 @ q2^))).
305
+ + destruct (dec (y1=y2)) as [p|p].
306
+ { exact (ap (fun y => (e y)^-1 (negb y)) p). }
307
+ destruct (aut_bool_idmap_or_negb (e y1)) as [q1|q1];
308
+ destruct (aut_bool_idmap_or_negb (e y2)) as [q2|q2].
309
+ * case (p ((ap e)^-1 (q1 @ q2^))).
310
+ * rewrite q1, q2.
311
+ exact (negb_ne (fun r => p ((ap negb)^-1 r))).
312
+ * rewrite q1, q2. symmetry.
313
+ exact (negb_ne (fun r => p ((ap negb)^-1 r)^)).
314
+ * case (p ((ap e)^-1 (q1 @ q2^))).
315
+ Defined.
316
+
317
+ Definition baut_bool_pairing_ZZ_Z_symm_map Y Z W
318
+ : Y ** (Z ** W) -> Z ** (Y ** W).
319
+ Proof.
320
+ intros e.
321
+ simple refine (equiv_adjointify (baut_bool_pairing_ZZ_Z_symm_part1 e)
322
+ _ _ _).
323
+ - intros f.
324
+ exact (baut_bool_pairing_ZZ_Z_symm_lemma e f
325
+ (merely_inhab_baut_bool Y)).
326
+ - intros f.
327
+ apply path_equiv, path_arrow; intros y.
328
+ change ((e y)
329
+ (baut_bool_pairing_ZZ_Z_symm_lemma e f
330
+ (merely_inhab_baut_bool Y)) = f y).
331
+ refine (ap (e y o baut_bool_pairing_ZZ_Z_symm_lemma e f)
332
+ (path_ishprop _ (tr y)) @ _).
333
+ simpl. apply eisretr.
334
+ - intros z.
335
+ assert (IsHSet Z) by exact _.
336
+ refine (Trunc_rec _ (merely_inhab_baut_bool Y)); intros y.
337
+ refine (ap (baut_bool_pairing_ZZ_Z_symm_lemma e _)
338
+ (path_ishprop _ (tr y)) @ _).
339
+ simpl. refine (eissect _ _).
340
+ Defined.
341
+
342
+ Definition baut_bool_pairing_ZZ_Z_symm_inv Y Z W
343
+ : baut_bool_pairing_ZZ_Z_symm_map Y Z W
344
+ o baut_bool_pairing_ZZ_Z_symm_map Z Y W
345
+ == idmap.
346
+ Proof.
347
+ intros e.
348
+ apply path_equiv, path_arrow; intros z.
349
+ apply path_equiv, path_arrow; intros y.
350
+ reflexivity.
351
+ Defined.
352
+
353
+ Definition baut_bool_pairing_ZZ_Z_symm Y Z W
354
+ : Y ** (Z ** W) <~> Z ** (Y ** W).
355
+ Proof.
356
+ refine (equiv_adjointify
357
+ (baut_bool_pairing_ZZ_Z_symm_map Y Z W)
358
+ (baut_bool_pairing_ZZ_Z_symm_map Z Y W)
359
+ (baut_bool_pairing_ZZ_Z_symm_inv Y Z W)
360
+ (baut_bool_pairing_ZZ_Z_symm_inv Z Y W)).
361
+ Defined.
362
+
363
+ (** Finally, we can prove associativity. *)
364
+ Definition baut_bool_pairing_ZZ_Z Z W Y
365
+ : (Z ** W) ** Y = Z ** (W ** Y).
366
+ Proof.
367
+ refine (baut_bool_pairing_symm (Z ** W) Y @ _).
368
+ refine (_ @ ap (fun X => Z ** X) (baut_bool_pairing_symm Y W)).
369
+ apply path_baut, baut_bool_pairing_ZZ_Z_symm.
370
+ Defined.
371
+
372
+ (** Since [BAut Bool] is not a set, we ought to have some coherence for these operations too, but we'll leave that for another time. *)
373
+
374
+ (** ** Automorphisms of [BAut Bool] *)
375
+
376
+ (** Interestingly, like [Bool] itself, [BAut Bool] is equivalent to its own automorphism group. *)
377
+
378
+ (** An initial lemma: every automorphism of [BAut Bool] and its inverse are "adjoint" with respect to the pairing. *)
379
+ Definition aut_baut_bool_moveR_pairing_V
380
+ (e : BAut Bool <~> BAut Bool) (Z W : BAut Bool)
381
+ : (e^-1 Z ** W) = (Z ** e W).
382
+ Proof.
383
+ apply path_baut; simpl.
384
+ refine ((equiv_equiv_path _ _) oE _ oE (equiv_equiv_path _ _)^-1).
385
+ refine (_ oE (@equiv_moveL_equiv_M _ _ e _ W Z) oE _).
386
+ - apply equiv_inverse, equiv_path_sigma_hprop.
387
+ - apply equiv_path_sigma_hprop.
388
+ Defined.
389
+
390
+ Definition equiv_baut_bool_aut_baut_bool
391
+ : BAut Bool <~> (BAut Bool <~> BAut Bool).
392
+ Proof.
393
+ simple refine (equiv_adjointify _ _ _ _).
394
+ - intros Z.
395
+ refine (equiv_involution (fun W => Z ** W) _).
396
+ intros W.
397
+ refine ((baut_bool_pairing_ZZ_Z Z Z W)^ @ _).
398
+ refine (_ @ baut_bool_pairing_1Z W).
399
+ apply (ap (fun Y => Y ** W)).
400
+ apply baut_bool_pairing_ZZ.
401
+ - intros e.
402
+ exact (e^-1 pt).
403
+ - intros e.
404
+ apply path_equiv, path_arrow; intros Z; simpl.
405
+ refine (aut_baut_bool_moveR_pairing_V e pt Z @ _).
406
+ apply baut_bool_pairing_1Z.
407
+ - intros Z.
408
+ apply baut_bool_pairing_Z1.
409
+ Defined.
410
+
411
+ (** ** [BAut (BAut Bool)] *)
412
+
413
+ (** Putting all of this together, we can construct a nontrivial 2-central element of [BAut (BAut Bool)]. *)
414
+
415
+ Definition center_baut_bool_central
416
+ (g : BAut Bool <~> BAut Bool) (W : BAut Bool)
417
+ : ap g (negb_center_baut_bool W) = negb_center_baut_bool (g W).
418
+ Proof.
419
+ revert g; equiv_intro equiv_baut_bool_aut_baut_bool Z.
420
+ simpl.
421
+ baut_reduce.
422
+ refine (_ @ apD negb_center_baut_bool (baut_bool_pairing_1Z pt)^).
423
+ rewrite transport_paths_lr, inv_V.
424
+ apply moveL_pV.
425
+ exact (concat_A1p baut_bool_pairing_1Z (negb_center_baut_bool pt)).
426
+ Qed.
427
+
428
+ Definition negb_center2_baut_baut_bool
429
+ : forall B : BAut (BAut Bool), (idpath B) = (idpath B).
430
+ Proof.
431
+ refine (center2_baut (BAut Bool) _).
432
+ exists negb_center_baut_bool.
433
+ apply center_baut_bool_central.
434
+ Defined.
435
+
436
+ Definition nontrivial_negb_center_baut_baut_bool
437
+ : negb_center2_baut_baut_bool <> (fun Z => idpath (idpath Z)).
438
+ Proof.
439
+ intros oops.
440
+ exact (nontrivial_negb_center_baut_bool
441
+ (((ap (center2_baut (BAut Bool)))^-1
442
+ (oops @ (id_center2_baut (BAut Bool))^))..1)).
443
+ Defined.
444
+
445
+ End AssumeUnivalence.
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Spaces/BAut/Bool.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c7c607cb704205feab678f03d1834a68d2fa1172391fb4a6dc92859aae452894
3
+ size 774082
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Spaces/BAut/Cantor.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:198b31d1593267436f37848c33810d3ebcce5546564ee533e6116870a6c5db06
3
+ size 218157
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Spaces/Card.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2c14871cc113b0348353e9439588f0b43043538ce26b0fa0ccb4b875538323b
3
+ size 679382
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Spaces/No/Addition.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9266083f75cc26c616b1d2ca86b7152613302544130103a34b7221ce4f4e8bba
3
+ size 1189062
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Spaces/Universe.v ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (* -*- mode: coq; mode: visual-line -*- *)
2
+ Require Import Basics Types.
3
+ Require Import HoTT.Truncations.
4
+ Require Import Spaces.BAut Spaces.BAut.Rigid.
5
+ Require Import ExcludedMiddle.
6
+
7
+ Local Open Scope trunc_scope.
8
+ Local Open Scope path_scope.
9
+
10
+ (** * The universe *)
11
+
12
+ (** ** Automorphisms of the universe *)
13
+
14
+ (** See "Parametricity, automorphisms of the universe, and excluded middle" by Booij, Escardo, Lumsdaine, Shulman. *)
15
+
16
+ (** If two inequivalent types have equivalent automorphism oo-groups, then assuming LEM we can swap them and leave the rest of the universe untouched. *)
17
+ Section SwapTypes.
18
+ (** Amusingly, this does not actually require univalence! But of course, to verify [BAut A <~> BAut B] in any particular example does require univalence. *)
19
+ Context `{Funext} `{ExcludedMiddle}.
20
+ Context (A B : Type) (ne : ~(A <~> B)) (e : BAut A <~> BAut B).
21
+
22
+ Definition equiv_swap_types : Type <~> Type.
23
+ Proof.
24
+ refine (((equiv_decidable_sum (fun X:Type => merely (X=A)))^-1)
25
+ oE _ oE
26
+ (equiv_decidable_sum (fun X:Type => merely (X=A)))).
27
+ refine ((equiv_functor_sum_l
28
+ (equiv_decidable_sum (fun X => merely (X.1=B)))^-1)
29
+ oE _ oE
30
+ (equiv_functor_sum_l
31
+ (equiv_decidable_sum (fun X => merely (X.1=B))))).
32
+ refine ((equiv_sum_assoc _ _ _)
33
+ oE _ oE
34
+ (equiv_sum_assoc _ _ _)^-1).
35
+ apply equiv_functor_sum_r.
36
+ assert (q : BAut B <~> {x : {x : Type & ~ merely (x = A)} &
37
+ merely (x.1 = B)}).
38
+ { refine (equiv_sigma_assoc _ _ oE _).
39
+ apply equiv_functor_sigma_id; intros X.
40
+ apply equiv_iff_hprop.
41
+ - intros p.
42
+ refine (fun q => _ ; p).
43
+ strip_truncations.
44
+ destruct q.
45
+ exact (ne (equiv_path X B p)).
46
+ - exact pr2. }
47
+ refine (_ oE equiv_sum_symm _ _).
48
+ apply equiv_functor_sum'.
49
+ - exact (e^-1 oE q^-1).
50
+ - exact (q oE e).
51
+ Defined.
52
+
53
+ Definition equiv_swap_types_swaps : merely (equiv_swap_types A = B).
54
+ Proof.
55
+ assert (ea := (e (point _)).2). cbn in ea.
56
+ strip_truncations; apply tr.
57
+ unfold equiv_swap_types.
58
+ apply moveR_equiv_V.
59
+ rewrite (equiv_decidable_sum_l
60
+ (fun X => merely (X=A)) A (tr 1)).
61
+ assert (ne' : ~ merely (B=A))
62
+ by (intros p; strip_truncations; exact (ne (equiv_path A B p^))).
63
+ rewrite (equiv_decidable_sum_r
64
+ (fun X => merely (X=A)) B ne').
65
+ cbn.
66
+ apply ap, path_sigma_hprop; cbn.
67
+ exact ea.
68
+ Defined.
69
+
70
+ Definition equiv_swap_types_not_id
71
+ : equiv_swap_types <> equiv_idmap.
72
+ Proof.
73
+ intros p.
74
+ assert (q := equiv_swap_types_swaps).
75
+ strip_truncations.
76
+ apply ne.
77
+ apply equiv_path.
78
+ rewrite p in q; exact q.
79
+ Qed.
80
+
81
+ End SwapTypes.
82
+
83
+ (** In particular, we can swap any two distinct rigid types. *)
84
+
85
+ Definition equiv_swap_rigid `{Univalence} `{ExcludedMiddle}
86
+ (A B : Type) `{IsRigid A} `{IsRigid B} (ne : ~(A <~> B))
87
+ : Type <~> Type.
88
+ Proof.
89
+ refine (equiv_swap_types A B ne _).
90
+ apply equiv_contr_contr.
91
+ Defined.
92
+
93
+ (** Such as [Empty] and [Unit]. *)
94
+
95
+ Definition equiv_swap_empty_unit `{Univalence} `{ExcludedMiddle}
96
+ : Type <~> Type
97
+ := equiv_swap_rigid Empty Unit (fun e => e^-1 tt).
98
+
99
+ (** In this case we get an untruncated witness of the swapping. *)
100
+
101
+ Definition equiv_swap_rigid_swaps `{Univalence} `{ExcludedMiddle}
102
+ (A B : Type) `{IsRigid A} `{IsRigid B} (ne : ~(A <~> B))
103
+ : equiv_swap_rigid A B ne A = B.
104
+ Proof.
105
+ unfold equiv_swap_rigid, equiv_swap_types.
106
+ apply moveR_equiv_V.
107
+ rewrite (equiv_decidable_sum_l
108
+ (fun X => merely (X=A)) A (tr 1)).
109
+ assert (ne' : ~ merely (B=A))
110
+ by (intros p; strip_truncations; exact (ne (equiv_path A B p^))).
111
+ rewrite (equiv_decidable_sum_r
112
+ (fun X => merely (X=A)) B ne').
113
+ cbn.
114
+ apply ap, path_sigma_hprop; cbn.
115
+ exact ((path_contr (center (BAut B)) (point (BAut B)))..1).
116
+ Defined.
117
+
118
+ (** We can also swap the products of two rigid types with another type [X], under a connectedness/truncatedness assumption. *)
119
+
120
+ Definition equiv_swap_prod_rigid `{Univalence} `{ExcludedMiddle}
121
+ (X A B : Type) (n : trunc_index) (ne : ~(X*A <~> X*B))
122
+ `{IsRigid A} `{IsConnected n.+1 A}
123
+ `{IsRigid B} `{IsConnected n.+1 B}
124
+ `{IsTrunc n.+1 X}
125
+ : Type <~> Type.
126
+ Proof.
127
+ refine (equiv_swap_types (X*A) (X*B) ne _).
128
+ transitivity (BAut X).
129
+ - symmetry; exact (baut_prod_rigid_equiv X A n).
130
+ - exact (baut_prod_rigid_equiv X B n).
131
+ Defined.
132
+
133
+ (** Conversely, from some nontrivial automorphisms of the universe we can deduce nonconstructive consequences. *)
134
+
135
+ Definition lem_from_aut_type_unit_empty `{Univalence}
136
+ (f : Type <~> Type) (eu : f Unit = Empty)
137
+ : ExcludedMiddle_type.
138
+ Proof.
139
+ apply DNE_to_LEM, DNE_from_allneg; intros P ?.
140
+ exists (f P); split.
141
+ - intros p.
142
+ assert (Contr P) by (apply contr_inhabited_hprop; assumption).
143
+ assert (q : Unit = P)
144
+ by (apply path_universe_uncurried, equiv_contr_contr).
145
+ destruct q.
146
+ rewrite eu.
147
+ auto.
148
+ - intros nfp.
149
+ assert (q : f P = Empty)
150
+ by (apply path_universe_uncurried, equiv_to_empty, nfp).
151
+ rewrite <- eu in q.
152
+ apply ((ap f)^-1) in q.
153
+ rewrite q; exact tt.
154
+ Defined.
155
+
156
+ Lemma equiv_hprop_idprod `{Univalence}
157
+ (A : Type) (P : Type) (a : merely A) `{IsHProp P}
158
+ : P <-> (P * A = A).
159
+ Proof.
160
+ split.
161
+ - intros p; apply path_universe with snd.
162
+ apply isequiv_adjointify with (fun a => (p,a)).
163
+ + intros x; reflexivity.
164
+ + intros [p' x].
165
+ apply path_prod; [ apply path_ishprop | reflexivity ].
166
+ - intros q.
167
+ strip_truncations.
168
+ apply equiv_path in q.
169
+ exact (fst (q^-1 a)).
170
+ Defined.
171
+
172
+ Definition lem_from_aut_type_inhabited_empty `{Univalence}
173
+ (f : Type <~> Type)
174
+ (A : Type) (a : merely A) (eu : f A = Empty)
175
+ : ExcludedMiddle_type.
176
+ Proof.
177
+ apply DNE_to_LEM, DNE_from_allneg; intros P ?.
178
+ exists (f (P * A)); split.
179
+ - intros p.
180
+ assert (q := fst (equiv_hprop_idprod A P a) p).
181
+ apply (ap f) in q.
182
+ rewrite eu in q.
183
+ rewrite q; auto.
184
+ - intros q.
185
+ apply equiv_to_empty in q.
186
+ apply path_universe_uncurried in q.
187
+ rewrite <- eu in q.
188
+ apply ((ap f)^-1) in q.
189
+ exact (snd (equiv_hprop_idprod A P a) q).
190
+ Defined.
191
+
192
+ (** If you can derive a constructive taboo from an automorphism of the universe such that [g X <> X], then you get [X]-many beers; see <https://groups.google.com/d/msg/homotopytypetheory/8CV0S2DuOI8/blCo7x-B7aoJ>. *)
193
+
194
+ Definition zero_beers `{Univalence}
195
+ (g : Type <~> Type) (ge : g Empty <> Empty)
196
+ : ~~ExcludedMiddle_type.
197
+ Proof.
198
+ pose (f := equiv_inverse g).
199
+ intros nlem.
200
+ apply ge.
201
+ apply path_universe_uncurried, equiv_to_empty; intros gz.
202
+ apply nlem.
203
+ apply (lem_from_aut_type_inhabited_empty f (g Empty) (tr gz)).
204
+ unfold f; apply eissect.
205
+ Defined.
206
+
207
+ Definition lem_beers `{Univalence}
208
+ (g : Type <~> Type) (ge : g ExcludedMiddle_type <> ExcludedMiddle_type)
209
+ : ~~ExcludedMiddle_type.
210
+ Proof.
211
+ intros nlem.
212
+ pose (nlem' := equiv_to_empty nlem).
213
+ apply path_universe_uncurried in nlem'.
214
+ rewrite nlem' in ge.
215
+ apply (zero_beers g) in ge.
216
+ exact (ge nlem).
217
+ Defined.
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Types/Paths.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4eee41d70e1adcab6668f5b03e740ceaf5aa8177e1a05e93ca1d51bac7c672fc
3
+ size 291077
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Types/Prod.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ea1d9baa225e7f06c2d4edd131b6ba9dc1f73f00e431c23dc622dabb487f024d
3
+ size 238829
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/Types/Sigma.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:60403f0eb098c40babbad07b97512d756594e58e1145fa714adef9b861adb217
3
+ size 264842
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/WildCat/Bifunctor.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:087c4ac8fcac3bd4ae96e02abba50b82b5f44cfcee2376daf165024133416471
3
+ size 142313
backend/core/Coq-Platform~8.19~2024.10/lib/coq/user-contrib/HoTT/WildCat/Displayed.vo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dd585c4f7cdc6e73587d2f4a294edc868e8269531a0621953b8d97a3fffab0f7
3
+ size 285568