Skip to content

Fill in some of 3.5, fix numbering - #268

Merged
teorth merged 5 commits into
teorth:mainfrom
gaearon:coalesce-curry
Aug 4, 2025
Merged

Fill in some of 3.5, fix numbering#268
teorth merged 5 commits into
teorth:mainfrom
gaearon:coalesce-curry

Conversation

@gaearon

@gaearon gaearon commented Aug 4, 2025

Copy link
Copy Markdown
Contributor

There's a few changes in here:

  • I've added a mem_insert lemma so we can unwrap >3-item sets without mentioning the instance.
  • The definition/example numbering is fixed to match the fourth edition of the book.
  • I've coalesed curry, uncurry, curry_uncurry, and uncurry_curry into an equivalence. This matches how other equivalences are shown and is IMO a bit more intuitive. It took me a while to see why they're defined at all.
  • I've added the statement (and the proof) of Example 3.5.5.
  • In general, I've marked which parts of the text the equivalences correspond to. It wasn't clear. I've also reordered equivalences to follow when they're brought up in the book.

z ∈ (SetTheory.Set.slice x Y) ↔ ∃ y:Y, z = (⟨x, y⟩:OrderedPair) := replacement_axiom _ _

/-- Definition 3.5.2 (Cartesian product) -/
/-- Definition 3.5.4 (Cartesian product) -/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2025-08-04 at 16 23 46

apply ext;
aesop

/-- Example 3.5.5 / Exercise 3.6.5. There is a bijection between `X ×ˢ Y` and `Y ×ˢ X`. -/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2025-08-04 at 16 25 00

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Calling out the future exercise explicitly so it's clear why we're not filling this in.

invFun := sorry
left_inv := sorry
right_inv := sorry
/-- Example 3.5.5. A function of two variables can be thought of as a function of a pair. -/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2025-08-04 at 16 24 36

tuple a = tuple b ↔ a = b := by sorry

/-- Example 3.5.8. There is a bijection between `(X ×ˢ Y) ×ˢ Z` and `X ×ˢ (Y ×ˢ Z)`. -/
noncomputable abbrev SetTheory.Set.prod_associator (X Y Z:Set) : (X ×ˢ Y) ×ˢ Z ≃ X ×ˢ (Y ×ˢ Z) where

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've fully filled this in because it wasn't a "why" and it wasn't part of an exercise.

noncomputable abbrev SetTheory.Set.prod_equiv_prod (X Y:Set) :
((X ×ˢ Y):_root_.Set Object) ≃ (X:_root_.Set Object) ×ˢ (Y:_root_.Set Object) where
toFun := fun z ↦ ⟨(fst z, snd z), by simp⟩
invFun := fun z ↦ mk_cartesian ⟨z.val.1, z.prop.1⟩ ⟨z.val.2, z.prop.2⟩

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Filled these in because it's auxiliary to the book.

right_inv := sorry

/-- Example 3.5.5. A function of two variables can be thought of as a function of a pair. -/
noncomputable abbrev SetTheory.Set.curry_equiv {X Y Z:Set} : (X → Y → Z) ≃ (X ×ˢ Y → Z) where

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Filled this in because it isn't a "why" or an exercise.

@teorth
teorth merged commit a43e480 into teorth:main Aug 4, 2025
2 checks passed
@gaearon
gaearon deleted the coalesce-curry branch August 4, 2025 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants