Equivalences and sets #
In this file we provide lemmas linking equivalences to sets.
Some notable definitions are:
Equiv.ofInjective: an injective function is (noncomputably) equivalent to its range.Equiv.setCongr: two equal sets are equivalent as types.Equiv.Set.union: a disjoint union of sets is equivalent to theirSum.
This file is separate from Equiv/Basic such that we do not require the full lattice structure
on sets before defining what an equivalence is.
Alias for Equiv.image_eq_preimage
Alias for Equiv.image_eq_preimage
A set s in α × β is equivalent to the sigma-type Σ x, {y | (x, y) ∈ s}.
Equations
- Equiv.setProdEquivSigma s = { toFun := fun (x : ↑s) => ⟨(↑x).1, ⟨(↑x).2, ⋯⟩⟩, invFun := fun (x : (x : α) × ↑{y : β | (x, y) ∈ s}) => ⟨(x.fst, ↑x.snd), ⋯⟩, left_inv := ⋯, right_inv := ⋯ }
Instances For
The subtypes corresponding to equal sets are equivalent.
Equations
Instances For
univ α is equivalent to α.
Equations
- Equiv.Set.univ α = { toFun := Subtype.val, invFun := fun (a : α) => ⟨a, trivial⟩, left_inv := ⋯, right_inv := ⋯ }
Instances For
If sets s and t are separated by a decidable predicate, then s ∪ t is equivalent to
s ⊕ t.
Equations
- One or more equations did not get rendered due to their size.
Instances For
If sets s and t are disjoint, then s ∪ t is equivalent to s ⊕ t.
Equations
- Equiv.Set.union H = Equiv.Set.union' (fun (x : α) => x ∈ s) ⋯ ⋯
Instances For
A singleton set is equivalent to a PUnit type.
Equations
- Equiv.Set.singleton a = { toFun := fun (x : ↑{a}) => PUnit.unit, invFun := fun (x : PUnit.{u}) => ⟨a, ⋯⟩, left_inv := ⋯, right_inv := ⋯ }
Instances For
If a ∉ s, then insert a s is equivalent to s ⊕ PUnit.
Equations
- Equiv.Set.insert H = Trans.trans (Trans.trans (Equiv.Set.ofEq ⋯) (Equiv.Set.union ⋯)) ((Equiv.refl ↑s).sumCongr (Equiv.Set.singleton a))
Instances For
If s : Set α is a set with decidable membership, then s ⊕ sᶜ is equivalent to α.
Equations
- Equiv.Set.sumCompl s = Trans.trans (Trans.trans (Equiv.Set.union ⋯).symm (Equiv.Set.ofEq ⋯)) (Equiv.Set.univ α)
Instances For
sumDiffSubset s t is the natural equivalence between
s ⊕ (t \ s) and t, where s and t are two sets.
Equations
- Equiv.Set.sumDiffSubset h = Trans.trans (Equiv.Set.union ⋯).symm (Equiv.Set.ofEq ⋯)
Instances For
If s is a set with decidable membership, then the sum of s ∪ t and s ∩ t is equivalent
to s ⊕ t.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given an equivalence e₀ between sets s : Set α and t : Set β, the set of equivalences
e : α ≃ β such that e ↑x = ↑(e₀ x) for each x : s is equivalent to the set of equivalences
between sᶜ and tᶜ.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The set Set.pi Set.univ s is equivalent to Π a, s a.
Equations
- Equiv.Set.univPi s = { toFun := fun (f : ↑(Set.univ.pi s)) (a : α) => ⟨↑f a, ⋯⟩, invFun := fun (f : (a : α) → ↑(s a)) => ⟨fun (a : α) => ↑(f a), ⋯⟩, left_inv := ⋯, right_inv := ⋯ }
Instances For
If a function f is injective on a set s, then s is equivalent to f '' s.
Equations
- Equiv.Set.imageOfInjOn f s H = { toFun := fun (p : ↑s) => ⟨f ↑p, ⋯⟩, invFun := fun (p : ↑(f '' s)) => ⟨Classical.choose ⋯, ⋯⟩, left_inv := ⋯, right_inv := ⋯ }
Instances For
If f is an injective function, then s is equivalent to f '' s.
Equations
- Equiv.Set.image f s H = Equiv.Set.imageOfInjOn f s ⋯
Instances For
The set {x ∈ s | t x} is equivalent to the set of x : s such that t x.
Equations
- Equiv.Set.sep s t = (Equiv.subtypeSubtypeEquivSubtypeInter s t).symm
Instances For
If s is a set in range f,
then its image under rangeSplitting f is in bijection (via f) with s.
Equations
- One or more equations did not get rendered due to their size.
Instances For
If f : α → β has a left-inverse when α is nonempty, then α is computably equivalent to the
range of f.
While awkward, the Nonempty α hypothesis on f_inv and hf allows this to be used when α is
empty too. This hypothesis is absent on analogous definitions on stronger Equivs like
LinearEquiv.ofLeftInverse and RingEquiv.ofLeftInverse as their typeclass assumptions
are already sufficient to ensure non-emptiness.
Equations
- Equiv.ofLeftInverse f f_inv hf = { toFun := fun (a : α) => ⟨f a, ⋯⟩, invFun := fun (b : ↑(Set.range f)) => f_inv ⋯ ↑b, left_inv := ⋯, right_inv := ⋯ }
Instances For
If f : α → β has a left-inverse, then α is computably equivalent to the range of f.
Note that if α is empty, no such f_inv exists and so this definition can't be used, unlike
the stronger but less convenient ofLeftInverse.
Equations
- Equiv.ofLeftInverse' f f_inv hf = Equiv.ofLeftInverse f (fun (x : Nonempty α) => f_inv) ⋯
Instances For
If f : α → β is an injective function, then domain α is equivalent to the range of f.
Equations
- Equiv.ofInjective f hf = Equiv.ofLeftInverse f (fun (x : Nonempty α) => Function.invFun f) ⋯
Instances For
sigmaPreimageEquiv f for f : α → β is the natural equivalence between
the type of all preimages of points under f and the total space α.
Equations
Instances For
If a function is a bijection between two sets s and t, then it induces an
equivalence between the types ↥s and ↥t.
Equations
- Set.BijOn.equiv f h = Equiv.ofBijective (Set.MapsTo.restrict f s t ⋯) ⋯
Instances For
The composition of an updated function with an equiv on a subtype can be expressed as an updated function.