formal
stringlengths
41
427k
informal
stringclasses
1 value
SetTheory.PGame.moveLeft_neg ** x : PGame i : RightMoves x ⊢ moveLeft (-x) (↑toLeftMovesNeg i) = -moveRight x i ** cases x ** case mk α✝ β✝ : Type u_1 a✝¹ : α✝ → PGame a✝ : β✝ → PGame i : RightMoves (mk α✝ β✝ a✝¹ a✝) ⊢ moveLeft (-mk α✝ β✝ a✝¹ a✝) (↑toLeftMovesNeg i) = -moveRight (mk α✝ β✝ a✝¹ a✝) i ** rfl ** Qed
SetTheory.PGame.moveLeft_neg' ** x : PGame i : LeftMoves (-x) ⊢ moveLeft (-x) i = -moveRight x (↑toLeftMovesNeg.symm i) ** cases x ** case mk α✝ β✝ : Type u_1 a✝¹ : α✝ → PGame a✝ : β✝ → PGame i : LeftMoves (-mk α✝ β✝ a✝¹ a✝) ⊢ moveLeft (-mk α✝ β✝ a✝¹ a✝) i = -moveRight (mk α✝ β✝ a✝¹ a✝) (↑toLeftMovesNeg.symm i) ** rfl ** Qed
SetTheory.PGame.moveRight_neg ** x : PGame i : LeftMoves x ⊢ moveRight (-x) (↑toRightMovesNeg i) = -moveLeft x i ** cases x ** case mk α✝ β✝ : Type u_1 a✝¹ : α✝ → PGame a✝ : β✝ → PGame i : LeftMoves (mk α✝ β✝ a✝¹ a✝) ⊢ moveRight (-mk α✝ β✝ a✝¹ a✝) (↑toRightMovesNeg i) = -moveLeft (mk α✝ β✝ a✝¹ a✝) i ** rfl ** Qed
SetTheory.PGame.moveRight_neg' ** x : PGame i : RightMoves (-x) ⊢ moveRight (-x) i = -moveLeft x (↑toRightMovesNeg.symm i) ** cases x ** case mk α✝ β✝ : Type u_1 a✝¹ : α✝ → PGame a✝ : β✝ → PGame i : RightMoves (-mk α✝ β✝ a✝¹ a✝) ⊢ moveRight (-mk α✝ β✝ a✝¹ a✝) i = -moveLeft (mk α✝ β✝ a✝¹ a✝) (↑toRightMovesNeg.symm i) ** rfl ** Qed
SetTheory.PGame.moveLeft_neg_symm ** x : PGame i : RightMoves (-x) ⊢ moveLeft x (↑toRightMovesNeg.symm i) = -moveRight (-x) i ** simp ** Qed
SetTheory.PGame.moveLeft_neg_symm' ** x : PGame i : LeftMoves x ⊢ moveLeft x i = -moveRight (-x) (↑toRightMovesNeg i) ** simp ** Qed
SetTheory.PGame.moveRight_neg_symm ** x : PGame i : LeftMoves (-x) ⊢ moveRight x (↑toLeftMovesNeg.symm i) = -moveLeft (-x) i ** simp ** Qed
SetTheory.PGame.moveRight_neg_symm' ** x : PGame i : RightMoves x ⊢ moveRight x i = -moveLeft (-x) (↑toLeftMovesNeg i) ** simp ** Qed
SetTheory.PGame.neg_le_lf_neg_iff ** xl xr : Type u xL : xl → PGame xR : xr → PGame yl yr : Type u yL : yl → PGame yR : yr → PGame ⊢ (-mk yl yr yL yR ≤ -mk xl xr xL xR ↔ mk xl xr xL xR ≤ mk yl yr yL yR) ∧ (-mk yl yr yL yR ⧏ -mk xl xr xL xR ↔ mk xl xr xL xR ⧏ mk yl yr yL yR) ** simp_rw [neg_def, mk_le_mk, mk_lf_mk, ← neg_def] ** xl xr : Type u xL : xl → PGame xR : xr → PGame yl yr : Type u yL : yl → PGame yR : yr → PGame ⊢ (((∀ (i : yr), -yR i ⧏ -mk xl xr (fun i => xL i) fun j => xR j) ∧ ∀ (j : xl), (-mk yl yr (fun i => yL i) fun j => yR j) ⧏ -xL j) ↔ (∀ (i : xl), xL i ⧏ mk yl yr yL yR) ∧ ∀ (j : yr), mk xl xr xL xR ⧏ yR j) ∧ (((∃ i, (-mk yl yr (fun i => yL i) fun j => yR j) ≤ -xR i) ∨ ∃ j, -yL j ≤ -mk xl xr (fun i => xL i) fun j => xR j) ↔ (∃ i, mk xl xr xL xR ≤ yL i) ∨ ∃ j, xR j ≤ mk yl yr yL yR) ** constructor ** case left xl xr : Type u xL : xl → PGame xR : xr → PGame yl yr : Type u yL : yl → PGame yR : yr → PGame ⊢ ((∀ (i : yr), -yR i ⧏ -mk xl xr (fun i => xL i) fun j => xR j) ∧ ∀ (j : xl), (-mk yl yr (fun i => yL i) fun j => yR j) ⧏ -xL j) ↔ (∀ (i : xl), xL i ⧏ mk yl yr yL yR) ∧ ∀ (j : yr), mk xl xr xL xR ⧏ yR j ** rw [and_comm] ** case left xl xr : Type u xL : xl → PGame xR : xr → PGame yl yr : Type u yL : yl → PGame yR : yr → PGame ⊢ ((∀ (j : xl), (-mk yl yr (fun i => yL i) fun j => yR j) ⧏ -xL j) ∧ ∀ (i : yr), -yR i ⧏ -mk xl xr (fun i => xL i) fun j => xR j) ↔ (∀ (i : xl), xL i ⧏ mk yl yr yL yR) ∧ ∀ (j : yr), mk xl xr xL xR ⧏ yR j ** apply and_congr <;> exact forall_congr' fun _ => neg_le_lf_neg_iff.2 ** case right xl xr : Type u xL : xl → PGame xR : xr → PGame yl yr : Type u yL : yl → PGame yR : yr → PGame ⊢ ((∃ i, (-mk yl yr (fun i => yL i) fun j => yR j) ≤ -xR i) ∨ ∃ j, -yL j ≤ -mk xl xr (fun i => xL i) fun j => xR j) ↔ (∃ i, mk xl xr xL xR ≤ yL i) ∨ ∃ j, xR j ≤ mk yl yr yL yR ** rw [or_comm] ** case right xl xr : Type u xL : xl → PGame xR : xr → PGame yl yr : Type u yL : yl → PGame yR : yr → PGame ⊢ ((∃ j, -yL j ≤ -mk xl xr (fun i => xL i) fun j => xR j) ∨ ∃ i, (-mk yl yr (fun i => yL i) fun j => yR j) ≤ -xR i) ↔ (∃ i, mk xl xr xL xR ≤ yL i) ∨ ∃ j, xR j ≤ mk yl yr yL yR ** apply or_congr <;> exact exists_congr fun _ => neg_le_lf_neg_iff.1 ** Qed
SetTheory.PGame.neg_lt_neg_iff ** x y : PGame ⊢ -y < -x ↔ x < y ** rw [lt_iff_le_and_lf, lt_iff_le_and_lf, neg_le_neg_iff, neg_lf_neg_iff] ** Qed
SetTheory.PGame.neg_equiv_neg_iff ** x y : PGame ⊢ -x ≈ -y ↔ x ≈ y ** show Equiv (-x) (-y) ↔ Equiv x y ** x y : PGame ⊢ Equiv (-x) (-y) ↔ Equiv x y ** rw [Equiv, Equiv, neg_le_neg_iff, neg_le_neg_iff, and_comm] ** Qed
SetTheory.PGame.neg_fuzzy_neg_iff ** x y : PGame ⊢ -x ‖ -y ↔ x ‖ y ** rw [Fuzzy, Fuzzy, neg_lf_neg_iff, neg_lf_neg_iff, and_comm] ** Qed
SetTheory.PGame.neg_le_iff ** x y : PGame ⊢ -y ≤ x ↔ -x ≤ y ** rw [← neg_neg x, neg_le_neg_iff, neg_neg] ** Qed
SetTheory.PGame.neg_lf_iff ** x y : PGame ⊢ -y ⧏ x ↔ -x ⧏ y ** rw [← neg_neg x, neg_lf_neg_iff, neg_neg] ** Qed
SetTheory.PGame.neg_lt_iff ** x y : PGame ⊢ -y < x ↔ -x < y ** rw [← neg_neg x, neg_lt_neg_iff, neg_neg] ** Qed
SetTheory.PGame.neg_equiv_iff ** x y : PGame ⊢ -x ≈ y ↔ x ≈ -y ** rw [← neg_neg y, neg_equiv_neg_iff, neg_neg] ** Qed
SetTheory.PGame.neg_fuzzy_iff ** x y : PGame ⊢ -x ‖ y ↔ x ‖ -y ** rw [← neg_neg y, neg_fuzzy_neg_iff, neg_neg] ** Qed
SetTheory.PGame.le_neg_iff ** x y : PGame ⊢ y ≤ -x ↔ x ≤ -y ** rw [← neg_neg x, neg_le_neg_iff, neg_neg] ** Qed
SetTheory.PGame.lf_neg_iff ** x y : PGame ⊢ y ⧏ -x ↔ x ⧏ -y ** rw [← neg_neg x, neg_lf_neg_iff, neg_neg] ** Qed
SetTheory.PGame.lt_neg_iff ** x y : PGame ⊢ y < -x ↔ x < -y ** rw [← neg_neg x, neg_lt_neg_iff, neg_neg] ** Qed
SetTheory.PGame.neg_le_zero_iff ** x : PGame ⊢ -x ≤ 0 ↔ 0 ≤ x ** rw [neg_le_iff, neg_zero] ** Qed
SetTheory.PGame.zero_le_neg_iff ** x : PGame ⊢ 0 ≤ -x ↔ x ≤ 0 ** rw [le_neg_iff, neg_zero] ** Qed
SetTheory.PGame.neg_lf_zero_iff ** x : PGame ⊢ -x ⧏ 0 ↔ 0 ⧏ x ** rw [neg_lf_iff, neg_zero] ** Qed
SetTheory.PGame.zero_lf_neg_iff ** x : PGame ⊢ 0 ⧏ -x ↔ x ⧏ 0 ** rw [lf_neg_iff, neg_zero] ** Qed
SetTheory.PGame.neg_lt_zero_iff ** x : PGame ⊢ -x < 0 ↔ 0 < x ** rw [neg_lt_iff, neg_zero] ** Qed
SetTheory.PGame.zero_lt_neg_iff ** x : PGame ⊢ 0 < -x ↔ x < 0 ** rw [lt_neg_iff, neg_zero] ** Qed
SetTheory.PGame.neg_equiv_zero_iff ** x : PGame ⊢ -x ≈ 0 ↔ x ≈ 0 ** rw [neg_equiv_iff, neg_zero] ** Qed
SetTheory.PGame.neg_fuzzy_zero_iff ** x : PGame ⊢ -x ‖ 0 ↔ x ‖ 0 ** rw [neg_fuzzy_iff, neg_zero] ** Qed
SetTheory.PGame.zero_equiv_neg_iff ** x : PGame ⊢ 0 ≈ -x ↔ 0 ≈ x ** rw [← neg_equiv_iff, neg_zero] ** Qed
SetTheory.PGame.zero_fuzzy_neg_iff ** x : PGame ⊢ 0 ‖ -x ↔ 0 ‖ x ** rw [← neg_fuzzy_iff, neg_zero] ** Qed
SetTheory.PGame.add_moveLeft_inl ** x y : PGame i : LeftMoves x ⊢ moveLeft (x + y) (↑toLeftMovesAdd (Sum.inl i)) = moveLeft x i + y ** cases x ** case mk y : PGame α✝ β✝ : Type u_1 a✝¹ : α✝ → PGame a✝ : β✝ → PGame i : LeftMoves (mk α✝ β✝ a✝¹ a✝) ⊢ moveLeft (mk α✝ β✝ a✝¹ a✝ + y) (↑toLeftMovesAdd (Sum.inl i)) = moveLeft (mk α✝ β✝ a✝¹ a✝) i + y ** cases y ** case mk.mk α✝¹ β✝¹ : Type u_1 a✝³ : α✝¹ → PGame a✝² : β✝¹ → PGame i : LeftMoves (mk α✝¹ β✝¹ a✝³ a✝²) α✝ β✝ : Type u_1 a✝¹ : α✝ → PGame a✝ : β✝ → PGame ⊢ moveLeft (mk α✝¹ β✝¹ a✝³ a✝² + mk α✝ β✝ a✝¹ a✝) (↑toLeftMovesAdd (Sum.inl i)) = moveLeft (mk α✝¹ β✝¹ a✝³ a✝²) i + mk α✝ β✝ a✝¹ a✝ ** rfl ** Qed
SetTheory.PGame.add_moveRight_inl ** x y : PGame i : RightMoves x ⊢ moveRight (x + y) (↑toRightMovesAdd (Sum.inl i)) = moveRight x i + y ** cases x ** case mk y : PGame α✝ β✝ : Type u_1 a✝¹ : α✝ → PGame a✝ : β✝ → PGame i : RightMoves (mk α✝ β✝ a✝¹ a✝) ⊢ moveRight (mk α✝ β✝ a✝¹ a✝ + y) (↑toRightMovesAdd (Sum.inl i)) = moveRight (mk α✝ β✝ a✝¹ a✝) i + y ** cases y ** case mk.mk α✝¹ β✝¹ : Type u_1 a✝³ : α✝¹ → PGame a✝² : β✝¹ → PGame i : RightMoves (mk α✝¹ β✝¹ a✝³ a✝²) α✝ β✝ : Type u_1 a✝¹ : α✝ → PGame a✝ : β✝ → PGame ⊢ moveRight (mk α✝¹ β✝¹ a✝³ a✝² + mk α✝ β✝ a✝¹ a✝) (↑toRightMovesAdd (Sum.inl i)) = moveRight (mk α✝¹ β✝¹ a✝³ a✝²) i + mk α✝ β✝ a✝¹ a✝ ** rfl ** Qed
SetTheory.PGame.add_moveLeft_inr ** x y : PGame i : LeftMoves y ⊢ moveLeft (x + y) (↑toLeftMovesAdd (Sum.inr i)) = x + moveLeft y i ** cases x ** case mk y : PGame i : LeftMoves y α✝ β✝ : Type u_1 a✝¹ : α✝ → PGame a✝ : β✝ → PGame ⊢ moveLeft (mk α✝ β✝ a✝¹ a✝ + y) (↑toLeftMovesAdd (Sum.inr i)) = mk α✝ β✝ a✝¹ a✝ + moveLeft y i ** cases y ** case mk.mk α✝¹ β✝¹ : Type u_1 a✝³ : α✝¹ → PGame a✝² : β✝¹ → PGame α✝ β✝ : Type u_1 a✝¹ : α✝ → PGame a✝ : β✝ → PGame i : LeftMoves (mk α✝ β✝ a✝¹ a✝) ⊢ moveLeft (mk α✝¹ β✝¹ a✝³ a✝² + mk α✝ β✝ a✝¹ a✝) (↑toLeftMovesAdd (Sum.inr i)) = mk α✝¹ β✝¹ a✝³ a✝² + moveLeft (mk α✝ β✝ a✝¹ a✝) i ** rfl ** Qed
SetTheory.PGame.add_moveRight_inr ** x y : PGame i : RightMoves y ⊢ moveRight (x + y) (↑toRightMovesAdd (Sum.inr i)) = x + moveRight y i ** cases x ** case mk y : PGame i : RightMoves y α✝ β✝ : Type u_1 a✝¹ : α✝ → PGame a✝ : β✝ → PGame ⊢ moveRight (mk α✝ β✝ a✝¹ a✝ + y) (↑toRightMovesAdd (Sum.inr i)) = mk α✝ β✝ a✝¹ a✝ + moveRight y i ** cases y ** case mk.mk α✝¹ β✝¹ : Type u_1 a✝³ : α✝¹ → PGame a✝² : β✝¹ → PGame α✝ β✝ : Type u_1 a✝¹ : α✝ → PGame a✝ : β✝ → PGame i : RightMoves (mk α✝ β✝ a✝¹ a✝) ⊢ moveRight (mk α✝¹ β✝¹ a✝³ a✝² + mk α✝ β✝ a✝¹ a✝) (↑toRightMovesAdd (Sum.inr i)) = mk α✝¹ β✝¹ a✝³ a✝² + moveRight (mk α✝ β✝ a✝¹ a✝) i ** rfl ** Qed
SetTheory.PGame.leftMoves_add_cases ** x y : PGame k : LeftMoves (x + y) P : LeftMoves (x + y) → Prop hl : ∀ (i : LeftMoves x), P (↑toLeftMovesAdd (Sum.inl i)) hr : ∀ (i : LeftMoves y), P (↑toLeftMovesAdd (Sum.inr i)) ⊢ P k ** rw [← toLeftMovesAdd.apply_symm_apply k] ** x y : PGame k : LeftMoves (x + y) P : LeftMoves (x + y) → Prop hl : ∀ (i : LeftMoves x), P (↑toLeftMovesAdd (Sum.inl i)) hr : ∀ (i : LeftMoves y), P (↑toLeftMovesAdd (Sum.inr i)) ⊢ P (↑toLeftMovesAdd (↑toLeftMovesAdd.symm k)) ** cases' toLeftMovesAdd.symm k with i i ** case inl x y : PGame k : LeftMoves (x + y) P : LeftMoves (x + y) → Prop hl : ∀ (i : LeftMoves x), P (↑toLeftMovesAdd (Sum.inl i)) hr : ∀ (i : LeftMoves y), P (↑toLeftMovesAdd (Sum.inr i)) i : LeftMoves x ⊢ P (↑toLeftMovesAdd (Sum.inl i)) ** exact hl i ** case inr x y : PGame k : LeftMoves (x + y) P : LeftMoves (x + y) → Prop hl : ∀ (i : LeftMoves x), P (↑toLeftMovesAdd (Sum.inl i)) hr : ∀ (i : LeftMoves y), P (↑toLeftMovesAdd (Sum.inr i)) i : LeftMoves y ⊢ P (↑toLeftMovesAdd (Sum.inr i)) ** exact hr i ** Qed
SetTheory.PGame.rightMoves_add_cases ** x y : PGame k : RightMoves (x + y) P : RightMoves (x + y) → Prop hl : ∀ (j : RightMoves x), P (↑toRightMovesAdd (Sum.inl j)) hr : ∀ (j : RightMoves y), P (↑toRightMovesAdd (Sum.inr j)) ⊢ P k ** rw [← toRightMovesAdd.apply_symm_apply k] ** x y : PGame k : RightMoves (x + y) P : RightMoves (x + y) → Prop hl : ∀ (j : RightMoves x), P (↑toRightMovesAdd (Sum.inl j)) hr : ∀ (j : RightMoves y), P (↑toRightMovesAdd (Sum.inr j)) ⊢ P (↑toRightMovesAdd (↑toRightMovesAdd.symm k)) ** cases' toRightMovesAdd.symm k with i i ** case inl x y : PGame k : RightMoves (x + y) P : RightMoves (x + y) → Prop hl : ∀ (j : RightMoves x), P (↑toRightMovesAdd (Sum.inl j)) hr : ∀ (j : RightMoves y), P (↑toRightMovesAdd (Sum.inr j)) i : RightMoves x ⊢ P (↑toRightMovesAdd (Sum.inl i)) ** exact hl i ** case inr x y : PGame k : RightMoves (x + y) P : RightMoves (x + y) → Prop hl : ∀ (j : RightMoves x), P (↑toRightMovesAdd (Sum.inl j)) hr : ∀ (j : RightMoves y), P (↑toRightMovesAdd (Sum.inr j)) i : RightMoves y ⊢ P (↑toRightMovesAdd (Sum.inr i)) ** exact hr i ** Qed
SetTheory.PGame.sub_zero ** x : PGame ⊢ x + -0 = x + 0 ** rw [neg_zero] ** Qed
SetTheory.PGame.add_left_neg_le_zero ** xl xr : Type u_1 xL : xl → PGame xR : xr → PGame i : LeftMoves (-mk xl xr xL xR + mk xl xr xL xR) ⊢ ∃ j, moveRight (moveLeft (-mk xl xr xL xR + mk xl xr xL xR) i) j ≤ 0 ** cases' i with i i ** case inl xl xr : Type u_1 xL : xl → PGame xR : xr → PGame i : xr ⊢ ∃ j, moveRight (moveLeft (-mk xl xr xL xR + mk xl xr xL xR) (Sum.inl i)) j ≤ 0 ** refine' ⟨@toRightMovesAdd _ ⟨_, _, _, _⟩ (Sum.inr i), _⟩ ** case inl xl xr : Type u_1 xL : xl → PGame xR : xr → PGame i : xr ⊢ moveRight (moveLeft (-mk xl xr xL xR + mk xl xr xL xR) (Sum.inl i)) (↑toRightMovesAdd (Sum.inr i)) ≤ 0 ** convert @add_left_neg_le_zero (xR i) ** case h.e'_3 xl xr : Type u_1 xL : xl → PGame xR : xr → PGame i : xr ⊢ moveRight (moveLeft (-mk xl xr xL xR + mk xl xr xL xR) (Sum.inl i)) (↑toRightMovesAdd (Sum.inr i)) = -xR i + xR i ** apply add_moveRight_inr ** case inr xl xr : Type u_1 xL : xl → PGame xR : xr → PGame i : xl ⊢ ∃ j, moveRight (moveLeft (-mk xl xr xL xR + mk xl xr xL xR) (Sum.inr i)) j ≤ 0 ** dsimp ** case inr xl xr : Type u_1 xL : xl → PGame xR : xr → PGame i : xl ⊢ ∃ j, moveRight ((mk xr xl (fun j => -xR j) fun i => -xL i) + xL i) j ≤ 0 ** refine' ⟨@toRightMovesAdd ⟨_, _, _, _⟩ _ (Sum.inl i), _⟩ ** case inr xl xr : Type u_1 xL : xl → PGame xR : xr → PGame i : xl ⊢ moveRight ((mk xr xl (fun j => -xR j) fun i => -xL i) + xL i) (↑toRightMovesAdd (Sum.inl i)) ≤ 0 ** convert @add_left_neg_le_zero (xL i) ** case h.e'_3 xl xr : Type u_1 xL : xl → PGame xR : xr → PGame i : xl ⊢ moveRight ((mk xr xl (fun j => -xR j) fun i => -xL i) + xL i) (↑toRightMovesAdd (Sum.inl i)) = -xL i + xL i ** apply add_moveRight_inl ** Qed
SetTheory.PGame.zero_le_add_left_neg ** x : PGame ⊢ 0 ≤ -x + x ** rw [← neg_le_neg_iff, neg_zero] ** x : PGame ⊢ -(-x + x) ≤ 0 ** exact neg_add_le.trans (add_left_neg_le_zero _) ** Qed
SetTheory.PGame.add_le_add_right' ** xl xr : Type u_1 xL : xl → PGame xR : xr → PGame yl yr : Type u_1 yL : yl → PGame yR : yr → PGame zl zr : Type u_1 zL : zl → PGame zR : zr → PGame h : mk xl xr xL xR ≤ mk yl yr yL yR ⊢ mk xl xr xL xR + mk zl zr zL zR ≤ mk yl yr yL yR + mk zl zr zL zR ** refine' le_def.2 ⟨fun i => _, fun i => _⟩ <;> cases' i with i i ** case refine'_1.inl xl xr : Type u_1 xL : xl → PGame xR : xr → PGame yl yr : Type u_1 yL : yl → PGame yR : yr → PGame zl zr : Type u_1 zL : zl → PGame zR : zr → PGame h : mk xl xr xL xR ≤ mk yl yr yL yR i : xl ⊢ (∃ i', moveLeft (mk xl xr xL xR + mk zl zr zL zR) (Sum.inl i) ≤ moveLeft (mk yl yr yL yR + mk zl zr zL zR) i') ∨ ∃ j, moveRight (moveLeft (mk xl xr xL xR + mk zl zr zL zR) (Sum.inl i)) j ≤ mk yl yr yL yR + mk zl zr zL zR ** rw [le_def] at h ** case refine'_1.inl xl xr : Type u_1 xL : xl → PGame xR : xr → PGame yl yr : Type u_1 yL : yl → PGame yR : yr → PGame zl zr : Type u_1 zL : zl → PGame zR : zr → PGame h : (∀ (i : LeftMoves (mk xl xr xL xR)), (∃ i', moveLeft (mk xl xr xL xR) i ≤ moveLeft (mk yl yr yL yR) i') ∨ ∃ j, moveRight (moveLeft (mk xl xr xL xR) i) j ≤ mk yl yr yL yR) ∧ ∀ (j : RightMoves (mk yl yr yL yR)), (∃ i, mk xl xr xL xR ≤ moveLeft (moveRight (mk yl yr yL yR) j) i) ∨ ∃ j', moveRight (mk xl xr xL xR) j' ≤ moveRight (mk yl yr yL yR) j i : xl ⊢ (∃ i', moveLeft (mk xl xr xL xR + mk zl zr zL zR) (Sum.inl i) ≤ moveLeft (mk yl yr yL yR + mk zl zr zL zR) i') ∨ ∃ j, moveRight (moveLeft (mk xl xr xL xR + mk zl zr zL zR) (Sum.inl i)) j ≤ mk yl yr yL yR + mk zl zr zL zR ** cases' h with h_left h_right ** case refine'_1.inl.intro xl xr : Type u_1 xL : xl → PGame xR : xr → PGame yl yr : Type u_1 yL : yl → PGame yR : yr → PGame zl zr : Type u_1 zL : zl → PGame zR : zr → PGame i : xl h_left : ∀ (i : LeftMoves (mk xl xr xL xR)), (∃ i', moveLeft (mk xl xr xL xR) i ≤ moveLeft (mk yl yr yL yR) i') ∨ ∃ j, moveRight (moveLeft (mk xl xr xL xR) i) j ≤ mk yl yr yL yR h_right : ∀ (j : RightMoves (mk yl yr yL yR)), (∃ i, mk xl xr xL xR ≤ moveLeft (moveRight (mk yl yr yL yR) j) i) ∨ ∃ j', moveRight (mk xl xr xL xR) j' ≤ moveRight (mk yl yr yL yR) j ⊢ (∃ i', moveLeft (mk xl xr xL xR + mk zl zr zL zR) (Sum.inl i) ≤ moveLeft (mk yl yr yL yR + mk zl zr zL zR) i') ∨ ∃ j, moveRight (moveLeft (mk xl xr xL xR + mk zl zr zL zR) (Sum.inl i)) j ≤ mk yl yr yL yR + mk zl zr zL zR ** rcases h_left i with (⟨i', ih⟩ | ⟨j, jh⟩) ** case refine'_1.inl.intro.inl.intro xl xr : Type u_1 xL : xl → PGame xR : xr → PGame yl yr : Type u_1 yL : yl → PGame yR : yr → PGame zl zr : Type u_1 zL : zl → PGame zR : zr → PGame i : xl h_left : ∀ (i : LeftMoves (mk xl xr xL xR)), (∃ i', moveLeft (mk xl xr xL xR) i ≤ moveLeft (mk yl yr yL yR) i') ∨ ∃ j, moveRight (moveLeft (mk xl xr xL xR) i) j ≤ mk yl yr yL yR h_right : ∀ (j : RightMoves (mk yl yr yL yR)), (∃ i, mk xl xr xL xR ≤ moveLeft (moveRight (mk yl yr yL yR) j) i) ∨ ∃ j', moveRight (mk xl xr xL xR) j' ≤ moveRight (mk yl yr yL yR) j i' : LeftMoves (mk yl yr yL yR) ih : moveLeft (mk xl xr xL xR) i ≤ moveLeft (mk yl yr yL yR) i' ⊢ (∃ i', moveLeft (mk xl xr xL xR + mk zl zr zL zR) (Sum.inl i) ≤ moveLeft (mk yl yr yL yR + mk zl zr zL zR) i') ∨ ∃ j, moveRight (moveLeft (mk xl xr xL xR + mk zl zr zL zR) (Sum.inl i)) j ≤ mk yl yr yL yR + mk zl zr zL zR ** exact Or.inl ⟨toLeftMovesAdd (Sum.inl i'), add_le_add_right' ih⟩ ** case refine'_1.inl.intro.inr.intro xl xr : Type u_1 xL : xl → PGame xR : xr → PGame yl yr : Type u_1 yL : yl → PGame yR : yr → PGame zl zr : Type u_1 zL : zl → PGame zR : zr → PGame i : xl h_left : ∀ (i : LeftMoves (mk xl xr xL xR)), (∃ i', moveLeft (mk xl xr xL xR) i ≤ moveLeft (mk yl yr yL yR) i') ∨ ∃ j, moveRight (moveLeft (mk xl xr xL xR) i) j ≤ mk yl yr yL yR h_right : ∀ (j : RightMoves (mk yl yr yL yR)), (∃ i, mk xl xr xL xR ≤ moveLeft (moveRight (mk yl yr yL yR) j) i) ∨ ∃ j', moveRight (mk xl xr xL xR) j' ≤ moveRight (mk yl yr yL yR) j j : RightMoves (moveLeft (mk xl xr xL xR) i) jh : moveRight (moveLeft (mk xl xr xL xR) i) j ≤ mk yl yr yL yR ⊢ (∃ i', moveLeft (mk xl xr xL xR + mk zl zr zL zR) (Sum.inl i) ≤ moveLeft (mk yl yr yL yR + mk zl zr zL zR) i') ∨ ∃ j, moveRight (moveLeft (mk xl xr xL xR + mk zl zr zL zR) (Sum.inl i)) j ≤ mk yl yr yL yR + mk zl zr zL zR ** refine' Or.inr ⟨toRightMovesAdd (Sum.inl j), _⟩ ** case refine'_1.inl.intro.inr.intro xl xr : Type u_1 xL : xl → PGame xR : xr → PGame yl yr : Type u_1 yL : yl → PGame yR : yr → PGame zl zr : Type u_1 zL : zl → PGame zR : zr → PGame i : xl h_left : ∀ (i : LeftMoves (mk xl xr xL xR)), (∃ i', moveLeft (mk xl xr xL xR) i ≤ moveLeft (mk yl yr yL yR) i') ∨ ∃ j, moveRight (moveLeft (mk xl xr xL xR) i) j ≤ mk yl yr yL yR h_right : ∀ (j : RightMoves (mk yl yr yL yR)), (∃ i, mk xl xr xL xR ≤ moveLeft (moveRight (mk yl yr yL yR) j) i) ∨ ∃ j', moveRight (mk xl xr xL xR) j' ≤ moveRight (mk yl yr yL yR) j j : RightMoves (moveLeft (mk xl xr xL xR) i) jh : moveRight (moveLeft (mk xl xr xL xR) i) j ≤ mk yl yr yL yR ⊢ moveRight (moveLeft (mk xl xr xL xR + mk zl zr zL zR) (Sum.inl i)) (↑toRightMovesAdd (Sum.inl j)) ≤ mk yl yr yL yR + mk zl zr zL zR ** convert add_le_add_right' jh ** case h.e'_3 xl xr : Type u_1 xL : xl → PGame xR : xr → PGame yl yr : Type u_1 yL : yl → PGame yR : yr → PGame zl zr : Type u_1 zL : zl → PGame zR : zr → PGame i : xl h_left : ∀ (i : LeftMoves (mk xl xr xL xR)), (∃ i', moveLeft (mk xl xr xL xR) i ≤ moveLeft (mk yl yr yL yR) i') ∨ ∃ j, moveRight (moveLeft (mk xl xr xL xR) i) j ≤ mk yl yr yL yR h_right : ∀ (j : RightMoves (mk yl yr yL yR)), (∃ i, mk xl xr xL xR ≤ moveLeft (moveRight (mk yl yr yL yR) j) i) ∨ ∃ j', moveRight (mk xl xr xL xR) j' ≤ moveRight (mk yl yr yL yR) j j : RightMoves (moveLeft (mk xl xr xL xR) i) jh : moveRight (moveLeft (mk xl xr xL xR) i) j ≤ mk yl yr yL yR ⊢ moveRight (moveLeft (mk xl xr xL xR + mk zl zr zL zR) (Sum.inl i)) (↑toRightMovesAdd (Sum.inl j)) = moveRight (moveLeft (mk xl xr xL xR) i) j + mk zl zr zL zR ** apply add_moveRight_inl ** case refine'_1.inr xl xr : Type u_1 xL : xl → PGame xR : xr → PGame yl yr : Type u_1 yL : yl → PGame yR : yr → PGame zl zr : Type u_1 zL : zl → PGame zR : zr → PGame h : mk xl xr xL xR ≤ mk yl yr yL yR i : zl ⊢ (∃ i', moveLeft (mk xl xr xL xR + mk zl zr zL zR) (Sum.inr i) ≤ moveLeft (mk yl yr yL yR + mk zl zr zL zR) i') ∨ ∃ j, moveRight (moveLeft (mk xl xr xL xR + mk zl zr zL zR) (Sum.inr i)) j ≤ mk yl yr yL yR + mk zl zr zL zR ** exact Or.inl ⟨@toLeftMovesAdd _ ⟨_, _, _, _⟩ (Sum.inr i), add_le_add_right' h⟩ ** case refine'_2.inl xl xr : Type u_1 xL : xl → PGame xR : xr → PGame yl yr : Type u_1 yL : yl → PGame yR : yr → PGame zl zr : Type u_1 zL : zl → PGame zR : zr → PGame h : mk xl xr xL xR ≤ mk yl yr yL yR i : yr ⊢ (∃ i_1, mk xl xr xL xR + mk zl zr zL zR ≤ moveLeft (moveRight (mk yl yr yL yR + mk zl zr zL zR) (Sum.inl i)) i_1) ∨ ∃ j', moveRight (mk xl xr xL xR + mk zl zr zL zR) j' ≤ moveRight (mk yl yr yL yR + mk zl zr zL zR) (Sum.inl i) ** rw [le_def] at h ** case refine'_2.inl xl xr : Type u_1 xL : xl → PGame xR : xr → PGame yl yr : Type u_1 yL : yl → PGame yR : yr → PGame zl zr : Type u_1 zL : zl → PGame zR : zr → PGame h : (∀ (i : LeftMoves (mk xl xr xL xR)), (∃ i', moveLeft (mk xl xr xL xR) i ≤ moveLeft (mk yl yr yL yR) i') ∨ ∃ j, moveRight (moveLeft (mk xl xr xL xR) i) j ≤ mk yl yr yL yR) ∧ ∀ (j : RightMoves (mk yl yr yL yR)), (∃ i, mk xl xr xL xR ≤ moveLeft (moveRight (mk yl yr yL yR) j) i) ∨ ∃ j', moveRight (mk xl xr xL xR) j' ≤ moveRight (mk yl yr yL yR) j i : yr ⊢ (∃ i_1, mk xl xr xL xR + mk zl zr zL zR ≤ moveLeft (moveRight (mk yl yr yL yR + mk zl zr zL zR) (Sum.inl i)) i_1) ∨ ∃ j', moveRight (mk xl xr xL xR + mk zl zr zL zR) j' ≤ moveRight (mk yl yr yL yR + mk zl zr zL zR) (Sum.inl i) ** rcases h.right i with (⟨i, ih⟩ | ⟨j', jh⟩) ** case refine'_2.inl.inl.intro xl xr : Type u_1 xL : xl → PGame xR : xr → PGame yl yr : Type u_1 yL : yl → PGame yR : yr → PGame zl zr : Type u_1 zL : zl → PGame zR : zr → PGame h : (∀ (i : LeftMoves (mk xl xr xL xR)), (∃ i', moveLeft (mk xl xr xL xR) i ≤ moveLeft (mk yl yr yL yR) i') ∨ ∃ j, moveRight (moveLeft (mk xl xr xL xR) i) j ≤ mk yl yr yL yR) ∧ ∀ (j : RightMoves (mk yl yr yL yR)), (∃ i, mk xl xr xL xR ≤ moveLeft (moveRight (mk yl yr yL yR) j) i) ∨ ∃ j', moveRight (mk xl xr xL xR) j' ≤ moveRight (mk yl yr yL yR) j i✝ : yr i : LeftMoves (moveRight (mk yl yr yL yR) i✝) ih : mk xl xr xL xR ≤ moveLeft (moveRight (mk yl yr yL yR) i✝) i ⊢ (∃ i, mk xl xr xL xR + mk zl zr zL zR ≤ moveLeft (moveRight (mk yl yr yL yR + mk zl zr zL zR) (Sum.inl i✝)) i) ∨ ∃ j', moveRight (mk xl xr xL xR + mk zl zr zL zR) j' ≤ moveRight (mk yl yr yL yR + mk zl zr zL zR) (Sum.inl i✝) ** refine' Or.inl ⟨toLeftMovesAdd (Sum.inl i), _⟩ ** case refine'_2.inl.inl.intro xl xr : Type u_1 xL : xl → PGame xR : xr → PGame yl yr : Type u_1 yL : yl → PGame yR : yr → PGame zl zr : Type u_1 zL : zl → PGame zR : zr → PGame h : (∀ (i : LeftMoves (mk xl xr xL xR)), (∃ i', moveLeft (mk xl xr xL xR) i ≤ moveLeft (mk yl yr yL yR) i') ∨ ∃ j, moveRight (moveLeft (mk xl xr xL xR) i) j ≤ mk yl yr yL yR) ∧ ∀ (j : RightMoves (mk yl yr yL yR)), (∃ i, mk xl xr xL xR ≤ moveLeft (moveRight (mk yl yr yL yR) j) i) ∨ ∃ j', moveRight (mk xl xr xL xR) j' ≤ moveRight (mk yl yr yL yR) j i✝ : yr i : LeftMoves (moveRight (mk yl yr yL yR) i✝) ih : mk xl xr xL xR ≤ moveLeft (moveRight (mk yl yr yL yR) i✝) i ⊢ mk xl xr xL xR + mk zl zr zL zR ≤ moveLeft (moveRight (mk yl yr yL yR + mk zl zr zL zR) (Sum.inl i✝)) (↑toLeftMovesAdd (Sum.inl i)) ** convert add_le_add_right' ih ** case h.e'_4 xl xr : Type u_1 xL : xl → PGame xR : xr → PGame yl yr : Type u_1 yL : yl → PGame yR : yr → PGame zl zr : Type u_1 zL : zl → PGame zR : zr → PGame h : (∀ (i : LeftMoves (mk xl xr xL xR)), (∃ i', moveLeft (mk xl xr xL xR) i ≤ moveLeft (mk yl yr yL yR) i') ∨ ∃ j, moveRight (moveLeft (mk xl xr xL xR) i) j ≤ mk yl yr yL yR) ∧ ∀ (j : RightMoves (mk yl yr yL yR)), (∃ i, mk xl xr xL xR ≤ moveLeft (moveRight (mk yl yr yL yR) j) i) ∨ ∃ j', moveRight (mk xl xr xL xR) j' ≤ moveRight (mk yl yr yL yR) j i✝ : yr i : LeftMoves (moveRight (mk yl yr yL yR) i✝) ih : mk xl xr xL xR ≤ moveLeft (moveRight (mk yl yr yL yR) i✝) i ⊢ moveLeft (moveRight (mk yl yr yL yR + mk zl zr zL zR) (Sum.inl i✝)) (↑toLeftMovesAdd (Sum.inl i)) = moveLeft (moveRight (mk yl yr yL yR) i✝) i + mk zl zr zL zR ** apply add_moveLeft_inl ** case refine'_2.inl.inr.intro xl xr : Type u_1 xL : xl → PGame xR : xr → PGame yl yr : Type u_1 yL : yl → PGame yR : yr → PGame zl zr : Type u_1 zL : zl → PGame zR : zr → PGame h : (∀ (i : LeftMoves (mk xl xr xL xR)), (∃ i', moveLeft (mk xl xr xL xR) i ≤ moveLeft (mk yl yr yL yR) i') ∨ ∃ j, moveRight (moveLeft (mk xl xr xL xR) i) j ≤ mk yl yr yL yR) ∧ ∀ (j : RightMoves (mk yl yr yL yR)), (∃ i, mk xl xr xL xR ≤ moveLeft (moveRight (mk yl yr yL yR) j) i) ∨ ∃ j', moveRight (mk xl xr xL xR) j' ≤ moveRight (mk yl yr yL yR) j i : yr j' : RightMoves (mk xl xr xL xR) jh : moveRight (mk xl xr xL xR) j' ≤ moveRight (mk yl yr yL yR) i ⊢ (∃ i_1, mk xl xr xL xR + mk zl zr zL zR ≤ moveLeft (moveRight (mk yl yr yL yR + mk zl zr zL zR) (Sum.inl i)) i_1) ∨ ∃ j', moveRight (mk xl xr xL xR + mk zl zr zL zR) j' ≤ moveRight (mk yl yr yL yR + mk zl zr zL zR) (Sum.inl i) ** exact Or.inr ⟨toRightMovesAdd (Sum.inl j'), add_le_add_right' jh⟩ ** case refine'_2.inr xl xr : Type u_1 xL : xl → PGame xR : xr → PGame yl yr : Type u_1 yL : yl → PGame yR : yr → PGame zl zr : Type u_1 zL : zl → PGame zR : zr → PGame h : mk xl xr xL xR ≤ mk yl yr yL yR i : zr ⊢ (∃ i_1, mk xl xr xL xR + mk zl zr zL zR ≤ moveLeft (moveRight (mk yl yr yL yR + mk zl zr zL zR) (Sum.inr i)) i_1) ∨ ∃ j', moveRight (mk xl xr xL xR + mk zl zr zL zR) j' ≤ moveRight (mk yl yr yL yR + mk zl zr zL zR) (Sum.inr i) ** exact Or.inr ⟨@toRightMovesAdd _ ⟨_, _, _, _⟩ (Sum.inr i), add_le_add_right' h⟩ ** Qed
SetTheory.PGame.add_lf_add_right ** y z : PGame h : y ⧏ z x : PGame this : z + x ≤ y + x → z ≤ y ⊢ y + x ⧏ z + x ** rw [← PGame.not_le] at h ⊢ ** y z : PGame h : ¬z ≤ y x : PGame this : z + x ≤ y + x → z ≤ y ⊢ ¬z + x ≤ y + x ** exact mt this h ** Qed
SetTheory.PGame.add_lf_add_left ** y z : PGame h : y ⧏ z x : PGame ⊢ x + y ⧏ x + z ** rw [lf_congr add_comm_equiv add_comm_equiv] ** y z : PGame h : y ⧏ z x : PGame ⊢ y + x ⧏ z + x ** apply add_lf_add_right h ** Qed
SetTheory.PGame.star_fuzzy_zero ** ⊢ star ⧏ 0 ** rw [lf_zero] ** ⊢ ∃ j, ∀ (i : LeftMoves (moveRight star j)), moveLeft (moveRight star j) i ⧏ 0 ** use default ** case h ⊢ ∀ (i : LeftMoves (moveRight star default)), moveLeft (moveRight star default) i ⧏ 0 ** rintro ⟨⟩ ** ⊢ 0 ⧏ star ** rw [zero_lf] ** ⊢ ∃ i, ∀ (j : RightMoves (moveLeft star i)), 0 ⧏ moveRight (moveLeft star i) j ** use default ** case h ⊢ ∀ (j : RightMoves (moveLeft star default)), 0 ⧏ moveRight (moveLeft star default) j ** rintro ⟨⟩ ** Qed
SetTheory.PGame.neg_star ** ⊢ -star = star ** simp [star] ** Qed
nonempty_embedding_to_cardinal ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop σ : Type u x✝ : Nonempty (Cardinal.{u} ↪ σ) f : Cardinal.{u} → σ hf : Injective f g : σ → Cardinal.{u} := invFun f x : σ hx : g x = 2 ^ sum g this : g x ≤ sum g ⊢ g x > sum g ** rw [hx] ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop σ : Type u x✝ : Nonempty (Cardinal.{u} ↪ σ) f : Cardinal.{u} → σ hf : Injective f g : σ → Cardinal.{u} := invFun f x : σ hx : g x = 2 ^ sum g this : g x ≤ sum g ⊢ 2 ^ sum g > sum g ** exact cantor _ ** Qed
WellOrder.eta ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : WellOrder ⊢ { α := o.α, r := o.r, wo := (_ : IsWellOrder o.α o.r) } = o ** cases o ** case mk α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop α✝ : Type u_3 r✝ : α✝ → α✝ → Prop wo✝ : IsWellOrder α✝ r✝ ⊢ { α := { α := α✝, r := r✝, wo := wo✝ }.α, r := { α := α✝, r := r✝, wo := wo✝ }.r, wo := (_ : IsWellOrder { α := α✝, r := r✝, wo := wo✝ }.α { α := α✝, r := r✝, wo := wo✝ }.r) } = { α := α✝, r := r✝, wo := wo✝ } ** rfl ** Qed
Ordinal.type_def' ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop w : WellOrder ⊢ Quotient.mk isEquivalent w = type w.r ** cases w ** case mk α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop α✝ : Type u_3 r✝ : α✝ → α✝ → Prop wo✝ : IsWellOrder α✝ r✝ ⊢ Quotient.mk isEquivalent { α := α✝, r := r✝, wo := wo✝ } = type { α := α✝, r := r✝, wo := wo✝ }.r ** rfl ** Qed
Ordinal.type_def ** α : Type u β : Type u_1 γ : Type u_2 r✝ : α → α → Prop s : β → β → Prop t : γ → γ → Prop r : α → α → Prop wo : IsWellOrder α r ⊢ Quotient.mk isEquivalent { α := α, r := r, wo := wo } = type r ** rfl ** Qed
Ordinal.type_out ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{u_3} ⊢ type (Quotient.out o).r = o ** rw [Ordinal.type, WellOrder.eta, Quotient.out_eq] ** Qed
Ordinal.type_ne_zero_iff_nonempty ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop inst✝ : IsWellOrder α r ⊢ type r ≠ 0 ↔ Nonempty α ** simp ** Qed
Ordinal.type_preimage_aux ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s : β✝ → β✝ → Prop t : γ → γ → Prop α β : Type u r : α → α → Prop inst✝ : IsWellOrder α r f : β ≃ α ⊢ (type fun x y => r (↑f x) (↑f y)) = type r ** convert (RelIso.preimage f r).ordinal_type_eq ** Qed
Ordinal.typein_lt_self ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{u_3} i : (Quotient.out o).α ⊢ typein (fun x x_1 => x < x_1) i < o ** simp_rw [← type_lt o] ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{u_3} i : (Quotient.out o).α ⊢ typein (fun x x_1 => x < x_1) i < type fun x x_1 => x < x_1 ** apply typein_lt_type ** Qed
Ordinal.typein_top ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop α β : Type u_3 r : α → α → Prop s : β → β → Prop inst✝¹ : IsWellOrder α r inst✝ : IsWellOrder β s f : r ≺i s x✝ : ↑{b | s b f.top} a : β h : a ∈ {b | s b f.top} ⊢ ∃ a_1, ↑(RelEmbedding.codRestrict {b | s b f.top} { toRelEmbedding := f.toRelEmbedding, init' := (_ : ∀ (x : α) (x_1 : β), s x_1 (↑f.toRelEmbedding x) → ∃ a', ↑f.toRelEmbedding a' = x_1) }.toRelEmbedding (_ : ∀ (a : α), s (↑f.toRelEmbedding a) f.top)) a_1 = { val := a, property := h } ** rcases f.down.1 h with ⟨b, rfl⟩ ** case intro α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop α β : Type u_3 r : α → α → Prop s : β → β → Prop inst✝¹ : IsWellOrder α r inst✝ : IsWellOrder β s f : r ≺i s x✝ : ↑{b | s b f.top} b : α h : ↑f.toRelEmbedding b ∈ {b | s b f.top} ⊢ ∃ a, ↑(RelEmbedding.codRestrict {b | s b f.top} { toRelEmbedding := f.toRelEmbedding, init' := (_ : ∀ (x : α) (x_1 : β), s x_1 (↑f.toRelEmbedding x) → ∃ a', ↑f.toRelEmbedding a' = x_1) }.toRelEmbedding (_ : ∀ (a : α), s (↑f.toRelEmbedding a) f.top)) a = { val := ↑f.toRelEmbedding b, property := h } ** exact ⟨b, rfl⟩ ** Qed
Ordinal.typein_apply ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop α β : Type u_3 r : α → α → Prop s : β → β → Prop inst✝¹ : IsWellOrder α r inst✝ : IsWellOrder β s f : r ≼i s a : α x✝ : ↑{b | r b a} x : α h : x ∈ {b | r b a} ⊢ ↑(RelEmbedding.trans (Subrel.relEmbedding r {b | r b a}) f.toRelEmbedding) { val := x, property := h } ∈ {b | s b (↑f a)} ** rw [RelEmbedding.trans_apply] ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop α β : Type u_3 r : α → α → Prop s : β → β → Prop inst✝¹ : IsWellOrder α r inst✝ : IsWellOrder β s f : r ≼i s a : α x✝ : ↑{b | r b a} x : α h : x ∈ {b | r b a} ⊢ ↑f.toRelEmbedding (↑(Subrel.relEmbedding r {b | r b a}) { val := x, property := h }) ∈ {b | s b (↑f a)} ** exact f.toRelEmbedding.map_rel_iff.2 h ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop α β : Type u_3 r : α → α → Prop s : β → β → Prop inst✝¹ : IsWellOrder α r inst✝ : IsWellOrder β s f : r ≼i s a : α x✝ : ↑{b | s b (↑f a)} y : β h : y ∈ {b | s b (↑f a)} ⊢ ∃ a_1, ↑(RelEmbedding.codRestrict {b | s b (↑f a)} (RelEmbedding.trans (Subrel.relEmbedding r {b | r b a}) f.toRelEmbedding) (_ : ∀ (x : ↑{b | r b a}), ↑(RelEmbedding.trans (Subrel.relEmbedding r {b | r b a}) f.toRelEmbedding) x ∈ {b | s b (↑f a)})) a_1 = { val := y, property := h } ** rcases f.init h with ⟨a, rfl⟩ ** case intro α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop α β : Type u_3 r : α → α → Prop s : β → β → Prop inst✝¹ : IsWellOrder α r inst✝ : IsWellOrder β s f : r ≼i s a✝ : α x✝ : ↑{b | s b (↑f a✝)} a : α h : ↑f a ∈ {b | s b (↑f a✝)} ⊢ ∃ a_1, ↑(RelEmbedding.codRestrict {b | s b (↑f a✝)} (RelEmbedding.trans (Subrel.relEmbedding r {b | r b a✝}) f.toRelEmbedding) (_ : ∀ (x : ↑{b | r b a✝}), ↑(RelEmbedding.trans (Subrel.relEmbedding r {b | r b a✝}) f.toRelEmbedding) x ∈ {b | s b (↑f a✝)})) a_1 = { val := ↑f a, property := h } ** exact ⟨⟨a, f.toRelEmbedding.map_rel_iff.1 h⟩, Subtype.eq <| RelEmbedding.trans_apply _ _ _⟩ ** Qed
Ordinal.typein_lt_typein ** α : Type u β : Type u_1 γ : Type u_2 r✝ : α → α → Prop s : β → β → Prop t : γ → γ → Prop r : α → α → Prop inst✝ : IsWellOrder α r a b : α x✝ : typein r a < typein r b f : Subrel r {b | r b a} ≺i Subrel r {b_1 | r b_1 b} ⊢ r a b ** have : f.top.1 = a := by let f' := PrincipalSeg.ofElement r a let g' := f.trans (PrincipalSeg.ofElement r b) have : g'.top = f'.top := by rw [Subsingleton.elim f' g'] exact this ** α : Type u β : Type u_1 γ : Type u_2 r✝ : α → α → Prop s : β → β → Prop t : γ → γ → Prop r : α → α → Prop inst✝ : IsWellOrder α r a b : α x✝ : typein r a < typein r b f : Subrel r {b | r b a} ≺i Subrel r {b_1 | r b_1 b} this : ↑f.top = a ⊢ r a b ** rw [← this] ** α : Type u β : Type u_1 γ : Type u_2 r✝ : α → α → Prop s : β → β → Prop t : γ → γ → Prop r : α → α → Prop inst✝ : IsWellOrder α r a b : α x✝ : typein r a < typein r b f : Subrel r {b | r b a} ≺i Subrel r {b_1 | r b_1 b} this : ↑f.top = a ⊢ r (↑f.top) b ** exact f.top.2 ** α : Type u β : Type u_1 γ : Type u_2 r✝ : α → α → Prop s : β → β → Prop t : γ → γ → Prop r : α → α → Prop inst✝ : IsWellOrder α r a b : α x✝ : typein r a < typein r b f : Subrel r {b | r b a} ≺i Subrel r {b_1 | r b_1 b} ⊢ ↑f.top = a ** let f' := PrincipalSeg.ofElement r a ** α : Type u β : Type u_1 γ : Type u_2 r✝ : α → α → Prop s : β → β → Prop t : γ → γ → Prop r : α → α → Prop inst✝ : IsWellOrder α r a b : α x✝ : typein r a < typein r b f : Subrel r {b | r b a} ≺i Subrel r {b_1 | r b_1 b} f' : Subrel r {b | r b a} ≺i r := PrincipalSeg.ofElement r a ⊢ ↑f.top = a ** let g' := f.trans (PrincipalSeg.ofElement r b) ** α : Type u β : Type u_1 γ : Type u_2 r✝ : α → α → Prop s : β → β → Prop t : γ → γ → Prop r : α → α → Prop inst✝ : IsWellOrder α r a b : α x✝ : typein r a < typein r b f : Subrel r {b | r b a} ≺i Subrel r {b_1 | r b_1 b} f' : Subrel r {b | r b a} ≺i r := PrincipalSeg.ofElement r a g' : Subrel r {b | r b a} ≺i r := PrincipalSeg.trans f (PrincipalSeg.ofElement r b) ⊢ ↑f.top = a ** have : g'.top = f'.top := by rw [Subsingleton.elim f' g'] ** α : Type u β : Type u_1 γ : Type u_2 r✝ : α → α → Prop s : β → β → Prop t : γ → γ → Prop r : α → α → Prop inst✝ : IsWellOrder α r a b : α x✝ : typein r a < typein r b f : Subrel r {b | r b a} ≺i Subrel r {b_1 | r b_1 b} f' : Subrel r {b | r b a} ≺i r := PrincipalSeg.ofElement r a g' : Subrel r {b | r b a} ≺i r := PrincipalSeg.trans f (PrincipalSeg.ofElement r b) this : g'.top = f'.top ⊢ ↑f.top = a ** exact this ** α : Type u β : Type u_1 γ : Type u_2 r✝ : α → α → Prop s : β → β → Prop t : γ → γ → Prop r : α → α → Prop inst✝ : IsWellOrder α r a b : α x✝ : typein r a < typein r b f : Subrel r {b | r b a} ≺i Subrel r {b_1 | r b_1 b} f' : Subrel r {b | r b a} ≺i r := PrincipalSeg.ofElement r a g' : Subrel r {b | r b a} ≺i r := PrincipalSeg.trans f (PrincipalSeg.ofElement r b) ⊢ g'.top = f'.top ** rw [Subsingleton.elim f' g'] ** Qed
Ordinal.enum_lt_enum ** α : Type u β : Type u_1 γ : Type u_2 r✝ : α → α → Prop s : β → β → Prop t : γ → γ → Prop r : α → α → Prop inst✝ : IsWellOrder α r o₁ o₂ : Ordinal.{u} h₁ : o₁ < type r h₂ : o₂ < type r ⊢ r (enum r o₁ h₁) (enum r o₂ h₂) ↔ o₁ < o₂ ** rw [← typein_lt_typein r, typein_enum, typein_enum] ** Qed
Ordinal.relIso_enum' ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop α β : Type u r : α → α → Prop s : β → β → Prop inst✝¹ : IsWellOrder α r inst✝ : IsWellOrder β s f : r ≃r s o : Ordinal.{u} ⊢ ∀ (hr : o < type r) (hs : o < type s), ↑f (enum r o hr) = enum s o hs ** refine' inductionOn o _ ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop α β : Type u r : α → α → Prop s : β → β → Prop inst✝¹ : IsWellOrder α r inst✝ : IsWellOrder β s f : r ≃r s o : Ordinal.{u} ⊢ ∀ (α_1 : Type u) (r_1 : α_1 → α_1 → Prop) [inst : IsWellOrder α_1 r_1] (hr : type r_1 < type r) (hs : type r_1 < type s), ↑f (enum r (type r_1) hr) = enum s (type r_1) hs ** rintro γ t wo ⟨g⟩ ⟨h⟩ ** case intro.intro α✝ : Type u β✝ : Type u_1 γ✝ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ✝ → γ✝ → Prop α β : Type u r : α → α → Prop s : β → β → Prop inst✝¹ : IsWellOrder α r inst✝ : IsWellOrder β s f : r ≃r s o : Ordinal.{u} γ : Type u t : γ → γ → Prop wo : IsWellOrder γ t g : t ≺i r h : t ≺i s ⊢ ↑f (enum r (type t) (_ : Nonempty (t ≺i r))) = enum s (type t) (_ : Nonempty (t ≺i s)) ** rw [enum_type g, enum_type (PrincipalSeg.ltEquiv g f)] ** case intro.intro α✝ : Type u β✝ : Type u_1 γ✝ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ✝ → γ✝ → Prop α β : Type u r : α → α → Prop s : β → β → Prop inst✝¹ : IsWellOrder α r inst✝ : IsWellOrder β s f : r ≃r s o : Ordinal.{u} γ : Type u t : γ → γ → Prop wo : IsWellOrder γ t g : t ≺i r h : t ≺i s ⊢ ↑f g.top = (PrincipalSeg.ltEquiv g f).top ** rfl ** Qed
Ordinal.relIso_enum ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop α β : Type u r : α → α → Prop s : β → β → Prop inst✝¹ : IsWellOrder α r inst✝ : IsWellOrder β s f : r ≃r s o : Ordinal.{u} hr : o < type r ⊢ o < type s ** convert hr using 1 ** case h.e'_4 α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop α β : Type u r : α → α → Prop s : β → β → Prop inst✝¹ : IsWellOrder α r inst✝ : IsWellOrder β s f : r ≃r s o : Ordinal.{u} hr : o < type r ⊢ type s = type r ** apply Quotient.sound ** case h.e'_4.a α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop α β : Type u r : α → α → Prop s : β → β → Prop inst✝¹ : IsWellOrder α r inst✝ : IsWellOrder β s f : r ≃r s o : Ordinal.{u} hr : o < type r ⊢ { α := β, r := s, wo := inst✝ } ≈ { α := α, r := r, wo := inst✝¹ } ** exact ⟨f.symm⟩ ** Qed
Ordinal.lt_wf ** α✝ : Type u β : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s : β → β → Prop t : γ → γ → Prop a✝ : Ordinal.{u_3} α : Type u_3 r : α → α → Prop wo : IsWellOrder α r a x : α x✝ : ∀ (y : α), r y x → Acc r y IH : ∀ (y : α), r y x → Acc (fun x x_1 => x < x_1) (typein r y) o : Ordinal.{u_3} h : o < typein r x ⊢ Acc (fun x x_1 => x < x_1) o ** rcases typein_surj r (lt_trans h (typein_lt_type r _)) with ⟨b, rfl⟩ ** case intro α✝ : Type u β : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s : β → β → Prop t : γ → γ → Prop a✝ : Ordinal.{u_3} α : Type u_3 r : α → α → Prop wo : IsWellOrder α r a x : α x✝ : ∀ (y : α), r y x → Acc r y IH : ∀ (y : α), r y x → Acc (fun x x_1 => x < x_1) (typein r y) b : α h : typein r b < typein r x ⊢ Acc (fun x x_1 => x < x_1) (typein r b) ** exact IH _ ((typein_lt_typein r).1 h) ** Qed
Ordinal.card_eq_zero ** α✝ : Type u β : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{u_3} α : Type u_3 r : α → α → Prop x✝ : IsWellOrder α r h : card (type r) = 0 ⊢ type r = 0 ** haveI := Cardinal.mk_eq_zero_iff.1 h ** α✝ : Type u β : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{u_3} α : Type u_3 r : α → α → Prop x✝ : IsWellOrder α r h : card (type r) = 0 this : IsEmpty { α := α, r := r, wo := x✝ }.α ⊢ type r = 0 ** apply type_eq_zero_of_empty ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{u_3} e : o = 0 ⊢ card o = 0 ** simp only [e, card_zero] ** Qed
Ordinal.type_uLift ** α : Type u β : Type u_1 γ : Type u_2 r✝ : α → α → Prop s : β → β → Prop t : γ → γ → Prop r : α → α → Prop inst✝ : IsWellOrder α r ⊢ type (ULift.down ⁻¹'o r) = lift.{v, u} (type r) ** simp ** α : Type u β : Type u_1 γ : Type u_2 r✝ : α → α → Prop s : β → β → Prop t : γ → γ → Prop r : α → α → Prop inst✝ : IsWellOrder α r ⊢ (type fun x y => r x.down y.down) = lift.{v, u} (type r) ** rfl ** Qed
Ordinal.lift_type_lt ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop α : Type u β : Type v r : α → α → Prop s : β → β → Prop inst✝¹ : IsWellOrder α r inst✝ : IsWellOrder β s ⊢ lift.{max v w, u} (type r) < lift.{max u w, v} (type s) ↔ Nonempty (r ≺i s) ** haveI := @RelEmbedding.isWellOrder _ _ (@Equiv.ulift.{max v w} α ⁻¹'o r) r (RelIso.preimage Equiv.ulift.{max v w} r) _ ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop α : Type u β : Type v r : α → α → Prop s : β → β → Prop inst✝¹ : IsWellOrder α r inst✝ : IsWellOrder β s this : IsWellOrder (ULift.{max v w, u} α) (↑Equiv.ulift ⁻¹'o r) ⊢ lift.{max v w, u} (type r) < lift.{max u w, v} (type s) ↔ Nonempty (r ≺i s) ** haveI := @RelEmbedding.isWellOrder _ _ (@Equiv.ulift.{max u w} β ⁻¹'o s) s (RelIso.preimage Equiv.ulift.{max u w} s) _ ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop α : Type u β : Type v r : α → α → Prop s : β → β → Prop inst✝¹ : IsWellOrder α r inst✝ : IsWellOrder β s this✝ : IsWellOrder (ULift.{max v w, u} α) (↑Equiv.ulift ⁻¹'o r) this : IsWellOrder (ULift.{max u w, v} β) (↑Equiv.ulift ⁻¹'o s) ⊢ lift.{max v w, u} (type r) < lift.{max u w, v} (type s) ↔ Nonempty (r ≺i s) ** exact ⟨fun ⟨f⟩ => ⟨(f.equivLT (RelIso.preimage Equiv.ulift r).symm).ltLe (InitialSeg.ofIso (RelIso.preimage Equiv.ulift s))⟩, fun ⟨f⟩ => ⟨(f.equivLT (RelIso.preimage Equiv.ulift r)).ltLe (InitialSeg.ofIso (RelIso.preimage Equiv.ulift s).symm)⟩⟩ ** Qed
Ordinal.lift_le ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop a b : Ordinal.{v} α : Type v r : α → α → Prop x✝¹ : IsWellOrder α r β : Type v s : β → β → Prop x✝ : IsWellOrder β s ⊢ lift.{u, v} (type r) ≤ lift.{u, v} (type s) ↔ type r ≤ type s ** rw [← lift_umax] ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop a b : Ordinal.{v} α : Type v r : α → α → Prop x✝¹ : IsWellOrder α r β : Type v s : β → β → Prop x✝ : IsWellOrder β s ⊢ lift.{max v u, v} (type r) ≤ lift.{max v u, v} (type s) ↔ type r ≤ type s ** exact lift_type_le.{_,_,u} ** Qed
Ordinal.lift_inj ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop a b : Ordinal.{v} ⊢ lift.{u, v} a = lift.{u, v} b ↔ a = b ** simp only [le_antisymm_iff, lift_le] ** Qed
Ordinal.lift_lt ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop a b : Ordinal.{v} ⊢ lift.{u, v} a < lift.{u, v} b ↔ a < b ** simp only [lt_iff_le_not_le, lift_le] ** Qed
Ordinal.lift_down' ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop a : Cardinal.{u} b : Ordinal.{max u v} h : card b ≤ Cardinal.lift.{v, u} a c : Cardinal.{u} e : Cardinal.lift.{v, u} c = card b α : Type u β : Type (max u v) s : β → β → Prop x✝ : IsWellOrder β s e' : Cardinal.lift.{v, u} #α = card (type s) ⊢ ∃ a', lift.{v, u} a' = type s ** rw [card_type, ← Cardinal.lift_id'.{max u v, u} #β, ← Cardinal.lift_umax.{u, v}, lift_mk_eq.{u, max u v, max u v}] at e' ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop a : Cardinal.{u} b : Ordinal.{max u v} h : card b ≤ Cardinal.lift.{v, u} a c : Cardinal.{u} e : Cardinal.lift.{v, u} c = card b α : Type u β : Type (max u v) s : β → β → Prop x✝ : IsWellOrder β s e' : Nonempty (α ≃ β) ⊢ ∃ a', lift.{v, u} a' = type s ** cases' e' with f ** case intro α✝ : Type u β✝ : Type u_1 γ : Type u_2 r : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop a : Cardinal.{u} b : Ordinal.{max u v} h : card b ≤ Cardinal.lift.{v, u} a c : Cardinal.{u} e : Cardinal.lift.{v, u} c = card b α : Type u β : Type (max u v) s : β → β → Prop x✝ : IsWellOrder β s f : α ≃ β ⊢ ∃ a', lift.{v, u} a' = type s ** have g := RelIso.preimage f s ** case intro α✝ : Type u β✝ : Type u_1 γ : Type u_2 r : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop a : Cardinal.{u} b : Ordinal.{max u v} h : card b ≤ Cardinal.lift.{v, u} a c : Cardinal.{u} e : Cardinal.lift.{v, u} c = card b α : Type u β : Type (max u v) s : β → β → Prop x✝ : IsWellOrder β s f : α ≃ β g : ↑f ⁻¹'o s ≃r s ⊢ ∃ a', lift.{v, u} a' = type s ** haveI := (g : f ⁻¹'o s ↪r s).isWellOrder ** case intro α✝ : Type u β✝ : Type u_1 γ : Type u_2 r : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop a : Cardinal.{u} b : Ordinal.{max u v} h : card b ≤ Cardinal.lift.{v, u} a c : Cardinal.{u} e : Cardinal.lift.{v, u} c = card b α : Type u β : Type (max u v) s : β → β → Prop x✝ : IsWellOrder β s f : α ≃ β g : ↑f ⁻¹'o s ≃r s this : IsWellOrder α (↑f ⁻¹'o s) ⊢ ∃ a', lift.{v, u} a' = type s ** have := lift_type_eq.{u, max u v, max u v}.2 ⟨g⟩ ** case intro α✝ : Type u β✝ : Type u_1 γ : Type u_2 r : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop a : Cardinal.{u} b : Ordinal.{max u v} h : card b ≤ Cardinal.lift.{v, u} a c : Cardinal.{u} e : Cardinal.lift.{v, u} c = card b α : Type u β : Type (max u v) s : β → β → Prop x✝ : IsWellOrder β s f : α ≃ β g : ↑f ⁻¹'o s ≃r s this✝ : IsWellOrder α (↑f ⁻¹'o s) this : lift.{max u v, u} (type (↑f ⁻¹'o s)) = lift.{max u v, max u v} (type s) ⊢ ∃ a', lift.{v, u} a' = type s ** rw [lift_id, lift_umax.{u, v}] at this ** case intro α✝ : Type u β✝ : Type u_1 γ : Type u_2 r : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop a : Cardinal.{u} b : Ordinal.{max u v} h : card b ≤ Cardinal.lift.{v, u} a c : Cardinal.{u} e : Cardinal.lift.{v, u} c = card b α : Type u β : Type (max u v) s : β → β → Prop x✝ : IsWellOrder β s f : α ≃ β g : ↑f ⁻¹'o s ≃r s this✝ : IsWellOrder α (↑f ⁻¹'o s) this : lift.{v, u} (type (↑f ⁻¹'o s)) = type s ⊢ ∃ a', lift.{v, u} a' = type s ** exact ⟨_, this⟩ ** Qed
Ordinal.lift_down ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop a : Ordinal.{u} b : Ordinal.{max u v} h : b ≤ lift.{v, u} a ⊢ card b ≤ Cardinal.lift.{v, u} (card a) ** rw [lift_card] ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop a : Ordinal.{u} b : Ordinal.{max u v} h : b ≤ lift.{v, u} a ⊢ card b ≤ card (lift.{v, u} a) ** exact card_le_card h ** Qed
Ordinal.card_nat ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop n : ℕ ⊢ card ↑n = ↑n ** induction n <;> [simp; simp only [card_add, card_one, Nat.cast_succ, *]] ** Qed
Ordinal.le_add_right ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop a b : Ordinal.{u_3} ⊢ a ≤ a + b ** simpa only [add_zero] using add_le_add_left (Ordinal.zero_le b) a ** Qed
Ordinal.le_add_left ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop a b : Ordinal.{u_3} ⊢ a ≤ b + a ** simpa only [zero_add] using add_le_add_right (Ordinal.zero_le b) a ** Qed
Ordinal.succ_le_iff' ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ → γ → Prop a b : Ordinal.{u_3} α : Type u_3 r : α → α → Prop hr : IsWellOrder α r β : Type u_3 s : β → β → Prop hs : IsWellOrder β s x✝ : type r < type s f : r ↪r s t : β hf : ∀ (b : β), s b t ↔ ∃ a, ↑f a = b ⊢ type r + 1 ≤ type s ** haveI := hs ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ → γ → Prop a b : Ordinal.{u_3} α : Type u_3 r : α → α → Prop hr : IsWellOrder α r β : Type u_3 s : β → β → Prop hs : IsWellOrder β s x✝ : type r < type s f : r ↪r s t : β hf : ∀ (b : β), s b t ↔ ∃ a, ↑f a = b this : IsWellOrder β s ⊢ type r + 1 ≤ type s ** refine' ⟨⟨RelEmbedding.ofMonotone (Sum.rec f fun _ => t) (fun a b ↦ _), fun a b ↦ _⟩⟩ ** case refine'_1 α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ → γ → Prop a✝ b✝ : Ordinal.{u_3} α : Type u_3 r : α → α → Prop hr : IsWellOrder α r β : Type u_3 s : β → β → Prop hs : IsWellOrder β s x✝ : type r < type s f : r ↪r s t : β hf : ∀ (b : β), s b t ↔ ∃ a, ↑f a = b this : IsWellOrder β s a b : α ⊕ PUnit.{u_3 + 1} ⊢ Sum.Lex r EmptyRelation a b → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) a) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) b) ** rcases a with (a | _) <;> rcases b with (b | _) ** case refine'_1.inl.inl α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ → γ → Prop a✝ b✝ : Ordinal.{u_3} α : Type u_3 r : α → α → Prop hr : IsWellOrder α r β : Type u_3 s : β → β → Prop hs : IsWellOrder β s x✝ : type r < type s f : r ↪r s t : β hf : ∀ (b : β), s b t ↔ ∃ a, ↑f a = b this : IsWellOrder β s a b : α ⊢ Sum.Lex r EmptyRelation (Sum.inl a) (Sum.inl b) → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (Sum.inl a)) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (Sum.inl b)) ** simpa only [Sum.lex_inl_inl] using f.map_rel_iff.2 ** case refine'_1.inl.inr α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ → γ → Prop a✝ b : Ordinal.{u_3} α : Type u_3 r : α → α → Prop hr : IsWellOrder α r β : Type u_3 s : β → β → Prop hs : IsWellOrder β s x✝ : type r < type s f : r ↪r s t : β hf : ∀ (b : β), s b t ↔ ∃ a, ↑f a = b this : IsWellOrder β s a : α val✝ : PUnit.{u_3 + 1} ⊢ Sum.Lex r EmptyRelation (Sum.inl a) (Sum.inr val✝) → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (Sum.inl a)) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (Sum.inr val✝)) ** intro ** case refine'_1.inl.inr α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ → γ → Prop a✝¹ b : Ordinal.{u_3} α : Type u_3 r : α → α → Prop hr : IsWellOrder α r β : Type u_3 s : β → β → Prop hs : IsWellOrder β s x✝ : type r < type s f : r ↪r s t : β hf : ∀ (b : β), s b t ↔ ∃ a, ↑f a = b this : IsWellOrder β s a : α val✝ : PUnit.{u_3 + 1} a✝ : Sum.Lex r EmptyRelation (Sum.inl a) (Sum.inr val✝) ⊢ s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (Sum.inl a)) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (Sum.inr val✝)) ** rw [hf] ** case refine'_1.inl.inr α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ → γ → Prop a✝¹ b : Ordinal.{u_3} α : Type u_3 r : α → α → Prop hr : IsWellOrder α r β : Type u_3 s : β → β → Prop hs : IsWellOrder β s x✝ : type r < type s f : r ↪r s t : β hf : ∀ (b : β), s b t ↔ ∃ a, ↑f a = b this : IsWellOrder β s a : α val✝ : PUnit.{u_3 + 1} a✝ : Sum.Lex r EmptyRelation (Sum.inl a) (Sum.inr val✝) ⊢ ∃ a_1, ↑f a_1 = (fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (Sum.inl a) ** exact ⟨_, rfl⟩ ** case refine'_1.inr.inl α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ → γ → Prop a b✝ : Ordinal.{u_3} α : Type u_3 r : α → α → Prop hr : IsWellOrder α r β : Type u_3 s : β → β → Prop hs : IsWellOrder β s x✝ : type r < type s f : r ↪r s t : β hf : ∀ (b : β), s b t ↔ ∃ a, ↑f a = b this : IsWellOrder β s val✝ : PUnit.{u_3 + 1} b : α ⊢ Sum.Lex r EmptyRelation (Sum.inr val✝) (Sum.inl b) → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (Sum.inr val✝)) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (Sum.inl b)) ** exact False.elim ∘ Sum.lex_inr_inl ** case refine'_1.inr.inr α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ → γ → Prop a b : Ordinal.{u_3} α : Type u_3 r : α → α → Prop hr : IsWellOrder α r β : Type u_3 s : β → β → Prop hs : IsWellOrder β s x✝ : type r < type s f : r ↪r s t : β hf : ∀ (b : β), s b t ↔ ∃ a, ↑f a = b this : IsWellOrder β s val✝¹ val✝ : PUnit.{u_3 + 1} ⊢ Sum.Lex r EmptyRelation (Sum.inr val✝¹) (Sum.inr val✝) → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (Sum.inr val✝¹)) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (Sum.inr val✝)) ** exact False.elim ∘ Sum.lex_inr_inr.1 ** case refine'_2 α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ → γ → Prop a✝ b✝ : Ordinal.{u_3} α : Type u_3 r : α → α → Prop hr : IsWellOrder α r β : Type u_3 s : β → β → Prop hs : IsWellOrder β s x✝ : type r < type s f : r ↪r s t : β hf : ∀ (b : β), s b t ↔ ∃ a, ↑f a = b this : IsWellOrder β s a : α ⊕ PUnit.{u_3 + 1} b : β ⊢ s b (↑(RelEmbedding.ofMonotone (fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (_ : ∀ (a b : α ⊕ PUnit.{u_3 + 1}), Sum.Lex r EmptyRelation a b → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) a) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) b))) a) → ∃ a', ↑(RelEmbedding.ofMonotone (fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (_ : ∀ (a b : α ⊕ PUnit.{u_3 + 1}), Sum.Lex r EmptyRelation a b → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) a) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) b))) a' = b ** rcases a with (a | _) ** case refine'_2.inl α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ → γ → Prop a✝ b✝ : Ordinal.{u_3} α : Type u_3 r : α → α → Prop hr : IsWellOrder α r β : Type u_3 s : β → β → Prop hs : IsWellOrder β s x✝ : type r < type s f : r ↪r s t : β hf : ∀ (b : β), s b t ↔ ∃ a, ↑f a = b this : IsWellOrder β s b : β a : α ⊢ s b (↑(RelEmbedding.ofMonotone (fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (_ : ∀ (a b : α ⊕ PUnit.{u_3 + 1}), Sum.Lex r EmptyRelation a b → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) a) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) b))) (Sum.inl a)) → ∃ a', ↑(RelEmbedding.ofMonotone (fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (_ : ∀ (a b : α ⊕ PUnit.{u_3 + 1}), Sum.Lex r EmptyRelation a b → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) a) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) b))) a' = b ** intro h ** case refine'_2.inl α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ → γ → Prop a✝ b✝ : Ordinal.{u_3} α : Type u_3 r : α → α → Prop hr : IsWellOrder α r β : Type u_3 s : β → β → Prop hs : IsWellOrder β s x✝ : type r < type s f : r ↪r s t : β hf : ∀ (b : β), s b t ↔ ∃ a, ↑f a = b this : IsWellOrder β s b : β a : α h : s b (↑(RelEmbedding.ofMonotone (fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (_ : ∀ (a b : α ⊕ PUnit.{u_3 + 1}), Sum.Lex r EmptyRelation a b → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) a) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) b))) (Sum.inl a)) ⊢ ∃ a', ↑(RelEmbedding.ofMonotone (fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (_ : ∀ (a b : α ⊕ PUnit.{u_3 + 1}), Sum.Lex r EmptyRelation a b → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) a) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) b))) a' = b ** have := @PrincipalSeg.init _ _ _ _ _ ⟨f, t, hf⟩ _ _ h ** case refine'_2.inl α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ → γ → Prop a✝ b✝ : Ordinal.{u_3} α : Type u_3 r : α → α → Prop hr : IsWellOrder α r β : Type u_3 s : β → β → Prop hs : IsWellOrder β s x✝ : type r < type s f : r ↪r s t : β hf : ∀ (b : β), s b t ↔ ∃ a, ↑f a = b this✝ : IsWellOrder β s b : β a : α h : s b (↑(RelEmbedding.ofMonotone (fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (_ : ∀ (a b : α ⊕ PUnit.{u_3 + 1}), Sum.Lex r EmptyRelation a b → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) a) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) b))) (Sum.inl a)) this : ∃ a', ↑{ toRelEmbedding := f, top := t, down' := hf }.toRelEmbedding a' = b ⊢ ∃ a', ↑(RelEmbedding.ofMonotone (fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (_ : ∀ (a b : α ⊕ PUnit.{u_3 + 1}), Sum.Lex r EmptyRelation a b → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) a) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) b))) a' = b ** cases' this with w h ** case refine'_2.inl.intro α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ → γ → Prop a✝ b✝ : Ordinal.{u_3} α : Type u_3 r : α → α → Prop hr : IsWellOrder α r β : Type u_3 s : β → β → Prop hs : IsWellOrder β s x✝ : type r < type s f : r ↪r s t : β hf : ∀ (b : β), s b t ↔ ∃ a, ↑f a = b this : IsWellOrder β s b : β a : α h✝ : s b (↑(RelEmbedding.ofMonotone (fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (_ : ∀ (a b : α ⊕ PUnit.{u_3 + 1}), Sum.Lex r EmptyRelation a b → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) a) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) b))) (Sum.inl a)) w : α h : ↑{ toRelEmbedding := f, top := t, down' := hf }.toRelEmbedding w = b ⊢ ∃ a', ↑(RelEmbedding.ofMonotone (fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (_ : ∀ (a b : α ⊕ PUnit.{u_3 + 1}), Sum.Lex r EmptyRelation a b → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) a) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) b))) a' = b ** exact ⟨Sum.inl w, h⟩ ** case refine'_2.inr α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ → γ → Prop a b✝ : Ordinal.{u_3} α : Type u_3 r : α → α → Prop hr : IsWellOrder α r β : Type u_3 s : β → β → Prop hs : IsWellOrder β s x✝ : type r < type s f : r ↪r s t : β hf : ∀ (b : β), s b t ↔ ∃ a, ↑f a = b this : IsWellOrder β s b : β val✝ : PUnit.{u_3 + 1} ⊢ s b (↑(RelEmbedding.ofMonotone (fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (_ : ∀ (a b : α ⊕ PUnit.{u_3 + 1}), Sum.Lex r EmptyRelation a b → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) a) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) b))) (Sum.inr val✝)) → ∃ a', ↑(RelEmbedding.ofMonotone (fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (_ : ∀ (a b : α ⊕ PUnit.{u_3 + 1}), Sum.Lex r EmptyRelation a b → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) a) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) b))) a' = b ** intro h ** case refine'_2.inr α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ → γ → Prop a b✝ : Ordinal.{u_3} α : Type u_3 r : α → α → Prop hr : IsWellOrder α r β : Type u_3 s : β → β → Prop hs : IsWellOrder β s x✝ : type r < type s f : r ↪r s t : β hf : ∀ (b : β), s b t ↔ ∃ a, ↑f a = b this : IsWellOrder β s b : β val✝ : PUnit.{u_3 + 1} h : s b (↑(RelEmbedding.ofMonotone (fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (_ : ∀ (a b : α ⊕ PUnit.{u_3 + 1}), Sum.Lex r EmptyRelation a b → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) a) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) b))) (Sum.inr val✝)) ⊢ ∃ a', ↑(RelEmbedding.ofMonotone (fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (_ : ∀ (a b : α ⊕ PUnit.{u_3 + 1}), Sum.Lex r EmptyRelation a b → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) a) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) b))) a' = b ** cases' (hf b).1 h with w h ** case refine'_2.inr.intro α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t✝ : γ → γ → Prop a b✝ : Ordinal.{u_3} α : Type u_3 r : α → α → Prop hr : IsWellOrder α r β : Type u_3 s : β → β → Prop hs : IsWellOrder β s x✝ : type r < type s f : r ↪r s t : β hf : ∀ (b : β), s b t ↔ ∃ a, ↑f a = b this : IsWellOrder β s b : β val✝ : PUnit.{u_3 + 1} h✝ : s b (↑(RelEmbedding.ofMonotone (fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (_ : ∀ (a b : α ⊕ PUnit.{u_3 + 1}), Sum.Lex r EmptyRelation a b → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) a) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) b))) (Sum.inr val✝)) w : α h : ↑f w = b ⊢ ∃ a', ↑(RelEmbedding.ofMonotone (fun t_1 => Sum.rec (↑f) (fun x => t) t_1) (_ : ∀ (a b : α ⊕ PUnit.{u_3 + 1}), Sum.Lex r EmptyRelation a b → s ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) a) ((fun t_1 => Sum.rec (↑f) (fun x => t) t_1) b))) a' = b ** exact ⟨Sum.inl w, h⟩ ** Qed
Ordinal.succ_one ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop ⊢ succ 1 = 2 ** unfold instOfNat OfNat.ofNat ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop ⊢ succ One.toOfNat1.1 = { ofNat := ↑2 }.1 ** simpa using by rfl ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop ⊢ One.toOfNat1.1 = 1 ** rfl ** Qed
Ordinal.one_le_iff_pos ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{u_3} ⊢ 1 ≤ o ↔ 0 < o ** rw [← succ_zero, succ_le_iff] ** Qed
Ordinal.one_le_iff_ne_zero ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{u_3} ⊢ 1 ≤ o ↔ o ≠ 0 ** rw [one_le_iff_pos, Ordinal.pos_iff_ne_zero] ** Qed
Ordinal.lt_one_iff_zero ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop a : Ordinal.{u_3} ⊢ a < 1 ↔ a = 0 ** simpa using @lt_succ_bot_iff _ _ _ a _ _ ** Qed
Ordinal.le_one_iff ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop a : Ordinal.{u_3} ⊢ a ≤ 1 ↔ a = 0 ∨ a = 1 ** simpa using @le_succ_bot_iff _ _ _ a _ ** Qed
Ordinal.card_succ ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{u_3} ⊢ card (succ o) = card o + 1 ** simp only [← add_one_eq_succ, card_add, card_one] ** Qed
Ordinal.one_out_eq ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop x : (Quotient.out 1).α ⊢ 0 < type fun x x_1 => x < x_1 ** simp ** Qed
Ordinal.typein_one_out ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop x : (Quotient.out 1).α ⊢ typein (fun x x_1 => x < x_1) x = 0 ** rw [one_out_eq x, typein_enum] ** Qed
Ordinal.typein_le_typein ** α : Type u β : Type u_1 γ : Type u_2 r✝ : α → α → Prop s : β → β → Prop t : γ → γ → Prop r : α → α → Prop inst✝ : IsWellOrder α r x x' : α ⊢ typein r x ≤ typein r x' ↔ ¬r x' x ** rw [← not_lt, typein_lt_typein] ** Qed
Ordinal.typein_le_typein' ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{u_3} x x' : (Quotient.out o).α ⊢ typein (fun x x_1 => x < x_1) x ≤ typein (fun x x_1 => x < x_1) x' ↔ x ≤ x' ** rw [typein_le_typein] ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{u_3} x x' : (Quotient.out o).α ⊢ ¬x' < x ↔ x ≤ x' ** exact not_lt ** Qed
Ordinal.enum_le_enum ** α : Type u β : Type u_1 γ : Type u_2 r✝ : α → α → Prop s : β → β → Prop t : γ → γ → Prop r : α → α → Prop inst✝ : IsWellOrder α r o o' : Ordinal.{u} ho : o < type r ho' : o' < type r ⊢ ¬r (enum r o' ho') (enum r o ho) ↔ o ≤ o' ** rw [← @not_lt _ _ o' o, enum_lt_enum ho'] ** Qed
Ordinal.enum_zero_le ** α : Type u β : Type u_1 γ : Type u_2 r✝ : α → α → Prop s : β → β → Prop t : γ → γ → Prop r : α → α → Prop inst✝ : IsWellOrder α r h0 : 0 < type r a : α ⊢ ¬r a (enum r 0 h0) ** rw [← enum_typein r a, enum_le_enum r] ** α : Type u β : Type u_1 γ : Type u_2 r✝ : α → α → Prop s : β → β → Prop t : γ → γ → Prop r : α → α → Prop inst✝ : IsWellOrder α r h0 : 0 < type r a : α ⊢ 0 ≤ typein r a ** apply Ordinal.zero_le ** Qed
Ordinal.enum_zero_le' ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{?u.186687} h0 : 0 < o a : (Quotient.out o).α ⊢ 0 < type fun x x_1 => x < x_1 ** rwa [type_lt] ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{u_3} h0 : 0 < o a : (Quotient.out o).α ⊢ enum (fun x x_1 => x < x_1) 0 (_ : 0 < type fun x x_1 => x < x_1) ≤ a ** rw [← not_lt] ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{u_3} h0 : 0 < o a : (Quotient.out o).α ⊢ ¬a < enum (fun x x_1 => x < x_1) 0 (_ : 0 < type fun x x_1 => x < x_1) ** apply enum_zero_le ** Qed
Ordinal.le_enum_succ ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{?u.187885} a : (Quotient.out (succ o)).α ⊢ o < type fun x x_1 => x < x_1 ** rw [type_lt] ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{?u.187885} a : (Quotient.out (succ o)).α ⊢ o < succ o ** exact lt_succ o ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{u_3} a : (Quotient.out (succ o)).α ⊢ typein (fun x x_1 => x < x_1) a < succ o ** apply typein_lt_self ** Qed
Ordinal.enum_zero_eq_bot ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{?u.198474} ho : 0 < o ⊢ 0 < type fun x x_1 => x < x_1 ** rwa [type_lt] ** Qed
Ordinal.lift.principalSeg_top' ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop ⊢ principalSeg.top = type fun x x_1 => x < x_1 ** simp only [lift.principalSeg_top, univ_id] ** Qed
Cardinal.mk_ordinal_out ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{u_3} ⊢ card (type (?m.211145 o)) = card o ** rw [Ordinal.type_lt] ** Qed
Cardinal.ord_le ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop c : Cardinal.{u_3} o : Ordinal.{u_3} α β : Type u_3 s : β → β → Prop x✝ : IsWellOrder β s ⊢ ord #α ≤ type s ↔ #α ≤ card (type s) ** let ⟨r, _, e⟩ := ord_eq α ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop c : Cardinal.{u_3} o : Ordinal.{u_3} α β : Type u_3 s : β → β → Prop x✝ : IsWellOrder β s r : α → α → Prop w✝ : IsWellOrder α r e : ord #α = type r ⊢ ord #α ≤ type s ↔ #α ≤ card (type s) ** simp only [card_type] ** α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop c : Cardinal.{u_3} o : Ordinal.{u_3} α β : Type u_3 s : β → β → Prop x✝ : IsWellOrder β s r : α → α → Prop w✝ : IsWellOrder α r e : ord #α = type r ⊢ ord #α ≤ type s ↔ #α ≤ #β ** constructor <;> intro h ** case mp α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop c : Cardinal.{u_3} o : Ordinal.{u_3} α β : Type u_3 s : β → β → Prop x✝ : IsWellOrder β s r : α → α → Prop w✝ : IsWellOrder α r e : ord #α = type r h : ord #α ≤ type s ⊢ #α ≤ #β ** rw [e] at h ** case mp α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop c : Cardinal.{u_3} o : Ordinal.{u_3} α β : Type u_3 s : β → β → Prop x✝ : IsWellOrder β s r : α → α → Prop w✝ : IsWellOrder α r e : ord #α = type r h : type r ≤ type s ⊢ #α ≤ #β ** exact let ⟨f⟩ := h ⟨f.toEmbedding⟩ ** case mpr α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop c : Cardinal.{u_3} o : Ordinal.{u_3} α β : Type u_3 s : β → β → Prop x✝ : IsWellOrder β s r : α → α → Prop w✝ : IsWellOrder α r e : ord #α = type r h : #α ≤ #β ⊢ ord #α ≤ type s ** cases' h with f ** case mpr.intro α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop c : Cardinal.{u_3} o : Ordinal.{u_3} α β : Type u_3 s : β → β → Prop x✝ : IsWellOrder β s r : α → α → Prop w✝ : IsWellOrder α r e : ord #α = type r f : α ↪ β ⊢ ord #α ≤ type s ** have g := RelEmbedding.preimage f s ** case mpr.intro α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop c : Cardinal.{u_3} o : Ordinal.{u_3} α β : Type u_3 s : β → β → Prop x✝ : IsWellOrder β s r : α → α → Prop w✝ : IsWellOrder α r e : ord #α = type r f : α ↪ β g : ↑f ⁻¹'o s ↪r s ⊢ ord #α ≤ type s ** haveI := RelEmbedding.isWellOrder g ** case mpr.intro α✝ : Type u β✝ : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s✝ : β✝ → β✝ → Prop t : γ → γ → Prop c : Cardinal.{u_3} o : Ordinal.{u_3} α β : Type u_3 s : β → β → Prop x✝ : IsWellOrder β s r : α → α → Prop w✝ : IsWellOrder α r e : ord #α = type r f : α ↪ β g : ↑f ⁻¹'o s ↪r s this : IsWellOrder α (↑f ⁻¹'o s) ⊢ ord #α ≤ type s ** exact le_trans (ord_le_type _) g.ordinal_type_le ** Qed
Cardinal.card_ord ** α✝ : Type u β : Type u_1 γ : Type u_2 r : α✝ → α✝ → Prop s : β → β → Prop t : γ → γ → Prop c : Cardinal.{u_3} α : Type u_3 ⊢ card (ord (Quotient.mk isEquivalent α)) = Quotient.mk isEquivalent α ** let ⟨r, _, e⟩ := ord_eq α ** α✝ : Type u β : Type u_1 γ : Type u_2 r✝ : α✝ → α✝ → Prop s : β → β → Prop t : γ → γ → Prop c : Cardinal.{u_3} α : Type u_3 r : α → α → Prop w✝ : IsWellOrder α r e : ord #α = type r ⊢ card (ord (Quotient.mk isEquivalent α)) = Quotient.mk isEquivalent α ** simp only [mk'_def, e, card_type] ** Qed
Cardinal.card_le_iff ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop o : Ordinal.{u_3} c : Cardinal.{u_3} ⊢ card o ≤ c ↔ o < ord (succ c) ** rw [lt_ord, lt_succ_iff] ** Qed
Cardinal.ord_nat ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop n : ℕ ⊢ ↑n ≤ ord ↑n ** induction' n with n IH ** case zero α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop ⊢ ↑Nat.zero ≤ ord ↑Nat.zero ** apply Ordinal.zero_le ** case succ α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop n : ℕ IH : ↑n ≤ ord ↑n ⊢ ↑(Nat.succ n) ≤ ord ↑(Nat.succ n) ** exact succ_le_of_lt (IH.trans_lt <| ord_lt_ord.2 <| natCast_lt.2 (Nat.lt_succ_self n)) ** Qed
Cardinal.ord_one ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop ⊢ ord 1 = 1 ** simpa using ord_nat 1 ** Qed
Cardinal.lift_ord ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop c : Cardinal.{v} ⊢ Ordinal.lift.{u, v} (ord c) = ord (lift.{u, v} c) ** refine' le_antisymm (le_of_forall_lt fun a ha => _) _ ** case refine'_1 α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop c : Cardinal.{v} a : Ordinal.{max v u} ha : a < Ordinal.lift.{u, v} (ord c) ⊢ a < ord (lift.{u, v} c) ** rcases Ordinal.lt_lift_iff.1 ha with ⟨a, rfl, _⟩ ** case refine'_1.intro.intro α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop c : Cardinal.{v} a : Ordinal.{v} right✝ : a < ord c ha : Ordinal.lift.{u, v} a < Ordinal.lift.{u, v} (ord c) ⊢ Ordinal.lift.{u, v} a < ord (lift.{u, v} c) ** rwa [lt_ord, ← lift_card, lift_lt, ← lt_ord, ← Ordinal.lift_lt] ** case refine'_2 α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop c : Cardinal.{v} ⊢ ord (lift.{u, v} c) ≤ Ordinal.lift.{u, v} (ord c) ** rw [ord_le, ← lift_card, card_ord] ** Qed
Cardinal.mk_ord_out ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop c : Cardinal.{u_3} ⊢ #(Quotient.out (ord c)).α = c ** simp ** Qed
Cardinal.card_typein_lt ** α : Type u β : Type u_1 γ : Type u_2 r✝ : α → α → Prop s : β → β → Prop t : γ → γ → Prop r : α → α → Prop inst✝ : IsWellOrder α r x : α h : ord #α = type r ⊢ card (typein r x) < #α ** rw [← lt_ord, h] ** α : Type u β : Type u_1 γ : Type u_2 r✝ : α → α → Prop s : β → β → Prop t : γ → γ → Prop r : α → α → Prop inst✝ : IsWellOrder α r x : α h : ord #α = type r ⊢ typein r x < type r ** apply typein_lt_type ** Qed
Cardinal.card_typein_out_lt ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop c : Cardinal.{u_3} x : (Quotient.out (ord c)).α ⊢ card (typein (fun x x_1 => x < x_1) x) < c ** rw [← lt_ord] ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop c : Cardinal.{u_3} x : (Quotient.out (ord c)).α ⊢ typein (fun x x_1 => x < x_1) x < ord c ** apply typein_lt_self ** Qed
Cardinal.ord_injective ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop ⊢ Injective ord ** intro c c' h ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop c c' : Cardinal.{u_3} h : ord c = ord c' ⊢ c = c' ** rw [← card_ord c, ← card_ord c', h] ** Qed
Cardinal.lift_lt_univ ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop c : Cardinal.{u} ⊢ lift.{u + 1, u} c < univ ** simpa only [lift.principalSeg_coe, lift_ord, lift_succ, ord_le, succ_le_iff] using le_of_lt (lift.principalSeg.{u, u + 1}.lt_top (succ c).ord) ** Qed
Cardinal.lift_lt_univ' ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop c : Cardinal.{u} ⊢ lift.{max (u + 1) v, u} c < univ ** have := lift_lt.{_, max (u+1) v}.2 (lift_lt_univ c) ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop c : Cardinal.{u} this : lift.{max (u + 1) v, u + 1} (lift.{u + 1, u} c) < lift.{max (u + 1) v, u + 1} univ ⊢ lift.{max (u + 1) v, u} c < univ ** rw [lift_lift, lift_univ, univ_umax.{u,v}] at this ** α : Type u β : Type u_1 γ : Type u_2 r : α → α → Prop s : β → β → Prop t : γ → γ → Prop c : Cardinal.{u} this : lift.{max (u + 1) v, u} c < univ ⊢ lift.{max (u + 1) v, u} c < univ ** exact this ** Qed