Built with Alectryon. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use ⌘ instead of Ctrl.
Require Import HoTT.Basics.Require Import HoTT.Basics.Require Import HoTT.Spaces.No.Core.LocalOpen Scope path_scope.LocalOpen Scope surreal_scope.(** * Negation of surreal numbers *)(** Negation requires the option sorts to be symmetric. *)ClassHasNegation (S : OptionSort)
:= symmetric_options :: forallLR, InSort S L R -> InSort S R L.Instancehasnegation_maxsort : HasNegation MaxSort
:= fun___ => tt.
HasNegation DecSort
HasNegation DecSort
intros L R [? ?]; split; assumption.Qed.SectionHasNegation.Universei.Context {S : OptionSort@{i}} `{HasNegation S}.LetNo := GenNo S.
S: OptionSort H: HasNegation S No:= GenNo S: Type
No -> No
S: OptionSort H: HasNegation S No:= GenNo S: Type
No -> No
S: OptionSort H: HasNegation S No:= GenNo S: Type L, R: Type s: InSort S L R xL: L -> GenNo S xR: R -> GenNo S xcut: forall (l : L) (r : R), xL l < xR r fxL: L -> No fxR: R -> No fxcut: forall (l : L) (r : R), (funxy : No => y < x) (fxL l) (fxR r)
No
S: OptionSort H: HasNegation S No:= GenNo S: Type a, b: No X: (funxy : No => y <= x) a b X0: (funxy : No => y <= x) b a
a = b
S: OptionSort H: HasNegation S No:= GenNo S: Type L, R: Type s: InSort S L R xL: L -> GenNo S xR: R -> GenNo S xcut: forall (l : L) (r : R), xL l < xR r fxL: L -> No fxR: R -> No fxcut: forall (l : L) (r : R), (funxy : No => y < x) (fxL l) (fxR r) L', R': Type s': InSort S L' R' yL: L' -> GenNo S yR: R' -> GenNo S ycut: forall (l : L') (r : R'), yL l < yR r fyL: L' -> No fyR: R' -> No fycut: forall (l : L') (r : R'), (funxy : No => y < x) (fyL l) (fyR r) p: foralll : L, xL l < {{ yL | yR//ycut }} dp: foralll : L,
(funxy : No => y < x) (fxL l)
((fun (L0R0 : Type) (s0 : InSort S L0 R0) (xL0 : L0 -> GenNo S)
(xR0 : R0 -> GenNo S)
(xcut0 : forall (l0 : L0) (r : R0), xL0 l0 < xR0 r)
(fxL0 : L0 -> No) (fxR0 : R0 -> No)
(fxcut0 : forall (l0 : L0) (r : R0),
(funxy : No => y < x) (fxL0 l0) (fxR0 r)) =>
?Goal@{L:=L0; R:=R0; s:=s0; xL:=xL0; xR:=xR0; xcut:=xcut0; fxL:=fxL0;
fxR:=fxR0; fxcut:=fxcut0})
L' R' s' yL yR ycut fyL fyR fycut) q: forallr : R', {{ xL | xR//xcut }} < yR r dq: forallr : R',
(funxy : No => y < x)
((fun (L0R0 : Type) (s0 : InSort S L0 R0) (xL0 : L0 -> GenNo S)
(xR0 : R0 -> GenNo S)
(xcut0 : forall (l : L0) (r0 : R0), xL0 l < xR0 r0)
(fxL0 : L0 -> No) (fxR0 : R0 -> No)
(fxcut0 : forall (l : L0) (r0 : R0),
(funxy : No => y < x) (fxL0 l) (fxR0 r0)) =>
?Goal@{L:=L0; R:=R0; s:=s0; xL:=xL0; xR:=xR0; xcut:=xcut0; fxL:=fxL0;
fxR:=fxR0; fxcut:=fxcut0})
L R s xL xR xcut fxL fxR fxcut)
(fyR r)
S: OptionSort H: HasNegation S No:= GenNo S: Type L, R: Type s: InSort S L R xL: L -> GenNo S xR: R -> GenNo S xcut: forall (l : L) (r : R), xL l < xR r fxL: L -> No fxR: R -> No fxcut: forall (l : L) (r : R), (funxy : No => y < x) (fxL l) (fxR r)
No
exact {{ fxR | fxL // funrl => fxcut l r }}.
S: OptionSort H: HasNegation S No:= GenNo S: Type a, b: No X: (funxy : No => y <= x) a b X0: (funxy : No => y <= x) b a
a = b
apply path_No; assumption.
S: OptionSort H: HasNegation S No:= GenNo S: Type L, R: Type s: InSort S L R xL: L -> GenNo S xR: R -> GenNo S xcut: forall (l : L) (r : R), xL l < xR r fxL: L -> No fxR: R -> No fxcut: forall (l : L) (r : R), (funxy : No => y < x) (fxL l) (fxR r) L', R': Type s': InSort S L' R' yL: L' -> GenNo S yR: R' -> GenNo S ycut: forall (l : L') (r : R'), yL l < yR r fyL: L' -> No fyR: R' -> No fycut: forall (l : L') (r : R'), (funxy : No => y < x) (fyL l) (fyR r) p: foralll : L, xL l < {{ yL | yR//ycut }} dp: foralll : L,
(funxy : No => y < x) (fxL l)
((fun (L0R0 : Type) (s0 : InSort S L0 R0) (xL0 : L0 -> GenNo S)
(xR0 : R0 -> GenNo S) (_ : forall (l0 : L0) (r : R0), xL0 l0 < xR0 r)
(fxL0 : L0 -> No) (fxR0 : R0 -> No)
(fxcut0 : forall (l0 : L0) (r : R0),
(funxy : No => y < x) (fxL0 l0) (fxR0 r)) =>
{{ fxR0 | fxL0//fun (r : R0) (l0 : L0) => fxcut0 l0 r }}) L' R' s' yL yR
ycut fyL fyR fycut) q: forallr : R', {{ xL | xR//xcut }} < yR r dq: forallr : R',
(funxy : No => y < x)
((fun (L0R0 : Type) (s0 : InSort S L0 R0) (xL0 : L0 -> GenNo S)
(xR0 : R0 -> GenNo S) (_ : forall (l : L0) (r0 : R0), xL0 l < xR0 r0)
(fxL0 : L0 -> No) (fxR0 : R0 -> No)
(fxcut0 : forall (l : L0) (r0 : R0),
(funxy : No => y < x) (fxL0 l) (fxR0 r0)) =>
{{ fxR0 | fxL0//fun (r0 : R0) (l : L0) => fxcut0 l r0 }}) L R s xL xR
xcut fxL fxR fxcut)
(fyR r)
(funxy : No => y <= x)
((fun (L0R0 : Type) (s0 : InSort S L0 R0) (xL0 : L0 -> GenNo S)
(xR0 : R0 -> GenNo S) (_ : forall (l : L0) (r : R0), xL0 l < xR0 r)
(fxL0 : L0 -> No) (fxR0 : R0 -> No)
(fxcut0 : forall (l : L0) (r : R0),
(funxy : No => y < x) (fxL0 l) (fxR0 r)) =>
{{ fxR0 | fxL0//fun (r : R0) (l : L0) => fxcut0 l r }}) L R s xL xR xcut
fxL fxR fxcut)
((fun (L0R0 : Type) (s0 : InSort S L0 R0) (xL0 : L0 -> GenNo S)
(xR0 : R0 -> GenNo S) (_ : forall (l : L0) (r : R0), xL0 l < xR0 r)
(fxL0 : L0 -> No) (fxR0 : R0 -> No)
(fxcut0 : forall (l : L0) (r : R0),
(funxy : No => y < x) (fxL0 l) (fxR0 r)) =>
{{ fxR0 | fxL0//fun (r : R0) (l : L0) => fxcut0 l r }}) L' R' s' yL yR
ycut fyL fyR fycut)
S: OptionSort H: HasNegation S No:= GenNo S: Type L, R: Type s: InSort S L R xL: L -> GenNo S xR: R -> GenNo S xcut: forall (l : L) (r : R), xL l < xR r fxL: L -> No fxR: R -> No fxcut: forall (l : L) (r : R), fxR r < fxL l L', R': Type s': InSort S L' R' yL: L' -> GenNo S yR: R' -> GenNo S ycut: forall (l : L') (r : R'), yL l < yR r fyL: L' -> No fyR: R' -> No fycut: forall (l : L') (r : R'), fyR r < fyL l p: foralll : L, xL l < {{ yL | yR//ycut }} dp: foralll : L, {{ fyR | fyL//fun (r : R') (l0 : L') => fycut l0 r }} < fxL l q: forallr : R', {{ xL | xR//xcut }} < yR r dq: forallr : R', fyR r < {{ fxR | fxL//fun (r0 : R) (l : L) => fxcut l r0 }}
{{ fyR | fyL//fun (r : R') (l : L') => fycut l r }} <=
{{ fxR | fxL//fun (r : R) (l : L) => fxcut l r }}
apply le_lr; intros; [ apply dq | apply dp ].
S: OptionSort H: HasNegation S No:= GenNo S: Type L, R: Type s: InSort S L R xL: L -> GenNo S xR: R -> GenNo S xcut: forall (l0 : L) (r : R), xL l0 < xR r fxL: L -> No fxR: R -> No fxcut: forall (l0 : L) (r : R), (funxy : No => y < x) (fxL l0) (fxR r) L', R': Type s': InSort S L' R' yL: L' -> GenNo S yR: R' -> GenNo S ycut: forall (l0 : L') (r : R'), yL l0 < yR r fyL: L' -> No fyR: R' -> No fycut: forall (l0 : L') (r : R'), (funxy : No => y < x) (fyL l0) (fyR r) l: L' p: {{ xL | xR//xcut }} <= yL l dp: (funxy : No => y <= x)
((fun (L0R0 : Type) (s0 : InSort S L0 R0) (xL0 : L0 -> GenNo S)
(xR0 : R0 -> GenNo S) (_ : forall (l0 : L0) (r : R0), xL0 l0 < xR0 r)
(fxL0 : L0 -> No) (fxR0 : R0 -> No)
(fxcut0 : forall (l0 : L0) (r : R0),
(funxy : No => y < x) (fxL0 l0) (fxR0 r)) =>
{{ fxR0 | fxL0//fun (r : R0) (l0 : L0) => fxcut0 l0 r }}) L R s xL xR
xcut fxL fxR fxcut)
(fyL l)
S: OptionSort H: HasNegation S No:= GenNo S: Type L, R: Type s: InSort S L R xL: L -> GenNo S xR: R -> GenNo S xcut: forall (l0 : L) (r : R), xL l0 < xR r fxL: L -> No fxR: R -> No fxcut: forall (l0 : L) (r : R), fxR r < fxL l0 L', R': Type s': InSort S L' R' yL: L' -> GenNo S yR: R' -> GenNo S ycut: forall (l0 : L') (r : R'), yL l0 < yR r fyL: L' -> No fyR: R' -> No fycut: forall (l0 : L') (r : R'), fyR r < fyL l0 l: L' p: {{ xL | xR//xcut }} <= yL l dp: fyL l <= {{ fxR | fxL//fun (r : R) (l0 : L) => fxcut l0 r }}
S: OptionSort H: HasNegation S No:= GenNo S: Type L, R: Type s: InSort S L R xL: L -> GenNo S xR: R -> GenNo S xcut: forall (l : L) (r0 : R), xL l < xR r0 fxL: L -> No fxR: R -> No fxcut: forall (l : L) (r0 : R), fxR r0 < fxL l L', R': Type s': InSort S L' R' yL: L' -> GenNo S yR: R' -> GenNo S ycut: forall (l : L') (r0 : R'), yL l < yR r0 fyL: L' -> No fyR: R' -> No fycut: forall (l : L') (r0 : R'), fyR r0 < fyL l r: R p: xR r <= {{ yL | yR//ycut }} dp: {{ fyR | fyL//fun (r0 : R') (l : L') => fycut l r0 }} <= fxR r
reflexivity.Defined.(** The following proof verifies that [No_rec] applied to a cut reduces definitionally to a cut with the expected options (although it does produce quite a large term). *)Context `{InSort S Empty Empty} `{InSort S Unit Empty}.
S: OptionSort H: HasNegation S No:= GenNo S: Type H0: InSort S Empty Empty H1: InSort S Unit Empty
negate one = minusone
S: OptionSort H: HasNegation S No:= GenNo S: Type H0: InSort S Empty Empty H1: InSort S Unit Empty
negate one = minusone
S: OptionSort H: HasNegation S No:= GenNo S: Type H0: InSort S Empty Empty H1: InSort S Unit Empty