Sign expansions #
In this repository we define the type of Surreal numbers following Conway's theory of games. A
popular alternative is to instead define the surreals as potentially infinite "expansions of signs",
setting for instance + = 1, - = -1, +- = ½, etc.
This file defines the type SignExpansion and constructs its basic instances. We do not yet link it
to the development of surreal numbers.
For Mathlib #
Sign expansions #
A sign expansion is a an ordinal indexed sequence of 1s and -1s, followed by 0s.
- sign : NatOrdinal → SignType
The sequence defining the sign expansion.
- isUpperSet_preimage_singleton_zero' : IsUpperSet (self.sign ⁻¹' {0})
Every sign after the first
0is also0.Do not use directly, use
isUpperSet_preimage_singleton_zeroinstead.
Instances For
Equations
- SignExpansion.instFunLikeNatOrdinalSignType = { coe := SignExpansion.sign, coe_injective' := SignExpansion.instFunLikeNatOrdinalSignType._proof_1 }
Every sign after the first 0 is also 0.
Adjust definitional equalities of a sign expansion.
Instances For
The length of a sign expansion is the smallest ordinal at which it equals zero,
or ⊤ is no such ordinal exists.
Instances For
Basic sign expansions #
Equations
- SignExpansion.instZero = { zero := SignExpansion.const✝ 0 }
Equations
- SignExpansion.instBot = { bot := SignExpansion.const✝ (-1) }
Equations
- SignExpansion.instTop = { top := SignExpansion.const✝ 1 }
Equations
- SignExpansion.instNeg = { neg := fun (e : SignExpansion) => { sign := -⇑e, isUpperSet_preimage_singleton_zero' := ⋯ } }
Equations
- SignExpansion.instInvolutiveNeg = { toNeg := SignExpansion.instNeg, neg_neg := SignExpansion.instInvolutiveNeg._proof_1 }
Cut off the part of a sign expansion after an ordinal o, by filling it in with zeros.
Equations
Instances For
Cut off the part of a sign expansion after an ordinal o, by filling it in with zeros.
Conventions for notations in identifiers:
- The recommended spelling of
↾in identifiers isrestrict.
Equations
- SignExpansion.«term_↾_» = Lean.ParserDescr.trailingNode `SignExpansion.«term_↾_» 1022 70 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ↾ ") (Lean.ParserDescr.cat `term 70))
Instances For
Order structure #
Equations
Equations
- One or more equations did not get rendered due to their size.
Floor function #
The floor function on a function NatOrdinal → SignType "rounds" it downwards to the nearest
valid SignExpansion.
Equations
- One or more equations did not get rendered due to their size.
Instances For
floor as a Galois coinsertion.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Ceiling function #
The ceiling function on a function NatOrdinal → SignType "rounds" it upwards to the nearest
valid SignExpansion.
Equations
Instances For
ceil as a Galois insertion.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Complete linear order instance #
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.