예제 #1
0
    def construct(self):

        self.force_skipping()
        conversation = Conversation(self)
        conversation.add_bubble("A co sjednotit všechny ordinály?")
        self.revert_to_original_skipping_status()

        forti_pic = ImageMobject("BuraliForti1.jpg", use_cache = False)
        forti_pic.scale(0.43)
        forti_pic.to_corner(UP+LEFT)

        ordinal_class = OrdinalClass(color = BLUE).shift(UP)
        ordinal_class.next_to(forti_pic, coor_mask = X_MASK)
        num = 7
        subordinals = VGroup([ordinal_class.copy() for _ in range(num)])
        for subord, x in zip(subordinals, np.linspace(0.3, 1, num)):
            i = int(x*len(subord.line))
            subord.line.remove(*subord.line[i:])

        lines_dest = VGroup([subord.line for subord in subordinals]).copy()
        bars_dest = VGroup([subord.bars for subord in subordinals]).copy()
        subordinals.arrange_submobjects(UP, False, coor_mask = Y_MASK)
        subordinals.next_to(conversation.dialog, UP, coor_mask = Y_MASK)
        lines = VGroup([subord.line for subord in subordinals])
        bars = VGroup([subord.bars for subord in subordinals])

        self.wait_to(3)
        self.play(FadeIn(subordinals))
        self.wait_to(4.5)
        self.play(
            Transform(lines, lines_dest),
            Transform(bars, bars_dest),
        )
        self.remove(subordinals)
        self.add(ordinal_class)
        self.wait_to(6)
        conversation.add_bubble("Cesare Burali-Forti paradox")

        next_bar = ordinal_class.bars[0][0].copy().next_to(ordinal_class)
        next_bar.highlight(YELLOW)
        self.wait_to(9)
        self.play(ShowCreation(next_bar))

        brace = BraceText(VGroup(ordinal_class, next_bar), "Nový ordinál", UP)
        self.wait_to(15)
        self.play(brace.creation_anim())

        picture = VGroup(ordinal_class, brace, next_bar)
        picture.save_state()
        picture.next_to(forti_pic, coor_mask = X_MASK)

        self.wait_to(29)
        self.play(FadeIn(forti_pic))

        self.wait_to(49)
        self.play(*map(FadeOut, [
            picture,
            conversation.dialog,
            forti_pic,
        ]))
예제 #2
0
    def construct(self):

        omega = OrdinalOmega()
        omega_brace = BraceDesc(omega, "\\omega", UP)
        self.add(omega_brace)
        omega, _ = self.play_infinite_supremum(waits=(4, 5.1))
        fin_index = 12
        bar = omega[fin_index].copy()
        bar.highlight(YELLOW)
        arrow = Arrow(
            bar.get_edge_center(DOWN) + DOWN,
            bar.get_edge_center(DOWN),
        )
        label = TextMobject("konečný ordinál").next_to(arrow, DOWN)

        self.wait_to(16)
        self.play(
            ShowCreation(bar),
            ShowCreation(arrow),
            FadeIn(label),
        )

        finite_brace = Brace(VGroup(omega[:fin_index]), DOWN)
        brace_label = label.copy()
        finite_brace.put_at_tip(brace_label)

        self.wait_to(20.3)
        self.play(
            GrowFromCenter(finite_brace),
            ReplacementTransform(label, brace_label),
        )

        terminal_segment_brace = BraceText(
            Line(omega[fin_index + 1].get_center() + DOWN,
                 omega.get_edge_center(RIGHT)), "nekonečno")
        self.wait_to(25.5)
        self.play(terminal_segment_brace.creation_anim())

        self.wait_to(41)
        self.play(
            FadeOut(
                VGroup(
                    finite_brace,
                    brace_label,
                    terminal_segment_brace,
                    bar,
                    arrow,
                )))
예제 #3
0
    def construct(self):
        series = VideoSeries(num_videos = 16).to_edge(UP)
        self.add(series)

        brace = BraceText(series[:7], "Theory of Infinity")
        self.play(brace.creation_anim())

        self.dither()
        self.play(brace.change_brace_desc, series[7:14], "Foundations of Mathematics")
        self.dither()

        brace_dest = brace.copy()
        brace_dest.change_brace_desc(series[14:16], "Tools")
        brace_dest.desc.to_edge(RIGHT)
        self.play(ReplacementTransform(brace, brace_dest))
        brace = brace_dest

        self.dither()
예제 #4
0
    def construct(self):

        #self.force_skipping()

        subset = self.al_count_subset
        self.play(FadeIn(subset))
        self.wait_to(5)
        self.play(self.count_brace.creation_anim())
        self.dither()  # 6
        self.play(
            Transform(subset, self.shifted_count_subset),
            self.count_brace.shift_brace,
            self.shifted_count_subset,
        )  # 7

        supremum = Line(ORIGIN, DOWN).next_to(subset, buff=0)
        supremum.set_color(YELLOW)
        self.wait_to(14)
        self.play(ShowCreation(supremum))

        self.wait_to(15.5)

        identity = TexMobject("\\aleph_0\\cdot\\aleph_0 = \\aleph_0")
        identity.next_to(supremum, buff=1)
        self.play(FadeIn(identity))

        supremum_in_ori = supremum.copy()
        supremum_in_ori.move_to(self.omega1, coor_mask=Y_MASK)
        self.wait_to(27.2)
        self.play(ReplacementTransform(supremum.copy(), supremum_in_ori))

        self.wait_to(30)
        self.play(FadeOut(identity))
        brace_base = Line(
            supremum_in_ori.get_edge_center(DOWN),
            self.omega1[0].get_edge_center(RIGHT),
        )
        brace_unused = BraceText(brace_base, "nespočetno")
        self.play(brace_unused.creation_anim())

        self.wait_to(44.5)
        self.play(
            FadeOut(
                VGroup(brace_unused, subset, supremum, supremum_in_ori,
                       self.count_brace)))

        seq = OrdinalOmega(x0=-1, x1=2)
        seq.set_color(GREEN)
        seq.stretch(0.5, 1)
        seq.shift(self.shift * UP)
        self.play(ShowCreation(seq))

        supremum.next_to(seq, buff=0)
        self.wait_to(53.5)
        self.play(ShowCreation(supremum))

        self.wait_to(60 + 7)
        self.play(FadeOut(VGroup(seq, supremum)))

        seq = OrdinalOmega(x0=-1, x1=4)
        seq.set_color(GREEN)
        seq.stretch(0.5, 1)
        seq.shift(self.shift * UP)
        self.play(ShowCreation(seq))

        self.revert_to_original_skipping_status()
        self.wait_to(60 + 17)
        self.omega1.add(seq)
        stretched_omega1 = self.omega1.copy()
        stretched_omega1.stretch_about_point(0.6, 0,
                                             self.omega1.get_edge_center(LEFT))
        added_line = Line(stretched_omega1.get_edge_center(RIGHT),
                          self.omega1.get_edge_center(RIGHT),
                          color=WHITE)
        self.add(added_line)
        supremum.move_to(added_line.get_edge_center(LEFT))

        brace_unc = BraceText(VGroup(supremum, added_line), "nespočetno")
        brace_src = brace_unc.brace.copy()
        brace_src.stretch_about_point(0, 0, added_line.get_edge_center(RIGHT))

        self.play(
            Transform(self.omega1, stretched_omega1),
            ReplacementTransform(brace_src, brace_unc.brace),
            FadeIn(brace_unc.desc),
        )
        self.play(ShowCreation(supremum))
        self.wait_to(60 + 35)
예제 #5
0
    def construct(self):

        title = TextMobject("Hypotéza kontinua").to_edge(UP)
        question = TextMobject(
            "Je $|\mathbb R|$ nejmenší nespočetná mohutnost?")
        question.shift(DOWN)

        self.add(title)
        cardinalities = TexMobject("0, 1, 2, \ldots", "\\aleph_0", "\\aleph_1",
                                   "=", "|\\mathbb R|", "?")
        cardinalities.set_color(GREEN)
        cardinalities[1].next_to(cardinalities[0], coor_mask=X_MASK, buff=1)
        VGroup(cardinalities[2:]).next_to(cardinalities[1],
                                          coor_mask=X_MASK,
                                          buff=0.5)
        cardinalities.next_to(title, DOWN)
        count_brace = BraceText(VGroup(cardinalities[:2]), "spočetné")
        self.play(
            count_brace.creation_anim(),
            *map(FadeIn,
                 [cardinalities[0], cardinalities[1], cardinalities[4]]))
        self.play(Write(question))

        arrow_end = (cardinalities[1].get_center() +
                     cardinalities[4].get_center()) / 2
        arrow = Arrow(arrow_end + DOWN, arrow_end)

        why_not_answer = TextMobject("Proč by tu mělo\\\\ cokoli být?",
                                     alignment="\\raggedright")
        why_not_answer.next_to(arrow, DOWN, aligned_edge=LEFT)
        why_not_answer.shift(0.5 * LEFT)

        self.wait_to(22)
        self.play(ShowCreation(arrow), FadeIn(why_not_answer))

        self.wait_to(30.5)
        self.play(FadeOut(VGroup(arrow, why_not_answer)))  # 31.5
        why_answer = VGroup(cardinalities[3], cardinalities[5])
        why_answer.set_color(WHITE)
        self.play(Write(cardinalities[2]))  # omega1
        self.play(Write(why_answer))

        omega1 = Omega1()
        make_half_ordinal(omega1[1])
        reals = NumberLine(x_min=-4, x_max=4)
        reals.set_color(WHITE)

        reals.to_edge(DOWN)
        omega1.next_to(reals, UP, buff=2)
        self.wait_to(50)
        self.play(FadeOut(question))
        self.play(FadeIn(reals), FadeIn(omega1))

        positions_num = 50
        positions = np.expand_dims(np.linspace(-4, 4, positions_num),
                                   1) * RIGHT
        positions_real = positions + reals.get_edge_center(UP) + UP * 0.1
        positions_omega1 = positions + omega1.get_edge_center(
            DOWN) + DOWN * 0.1
        positions_omega1 = list(positions_omega1)
        random.shuffle(positions_omega1)

        matching = VGroup([
            Line(start, end)
            for start, end in zip(positions_omega1, positions_real)
        ])
        matching.set_color(BLUE)
        self.play(ShowCreation(
            matching,
            submobject_mode="all_at_once",
        ))
        self.wait_to(60 + 1)
        self.play(FadeOut(matching))
        self.wait_to(60 + 10.5)
예제 #6
0
    def construct(self):

        #self.force_skipping()
        shift = self.shift

        # countable subset

        self.play(Transform(self.count_subset, self.shifted_count_subset))
        self.wait_to(5.1)
        self.play(Transform(self.count_subset, self.al_count_subset))
        self.wait_to(12)
        self.play(self.count_brace.creation_anim())
        self.wait_to(17)

        self.play(FadeOut(VGroup(self.count_brace, self.count_subset)))

        # uncountable subset

        unc_initial = LimitSubOrdinal([subord[0] for subord in self.omega1[1]])
        unc_initial = unc_initial.copy()
        unc_line = DashedLine(self.omega1[0].get_edge_center(LEFT),
                              self.omega1[0].get_edge_center(RIGHT))
        unc_line.gradient_highlight(BLACK, WHITE)
        start_x = unc_initial.get_edge_center(RIGHT)[0]
        unc_line.submobjects = filter(
            lambda l: l.get_edge_center(LEFT)[0] > start_x,
            unc_line.submobjects)
        unc_subset = VGroup(unc_initial, unc_line)
        self.play(VGroup(unc_initial, unc_line).shift, 2 * shift * DOWN)
        self.revert_to_original_skipping_status()
        self.dither()

        al_unc_subset = Omega1().shift(shift * DOWN)
        al_unc_line, al_unc_initial = al_unc_subset
        ini_index = 9
        al_unc_line_parts = []

        # split gradient line to larger parts
        line_len = (unc_line[2].get_center() - unc_line[1].get_center())[0]
        remaining = len(unc_line) - (ini_index + 1) - 1
        next_split = al_unc_line.get_edge_center(LEFT)[0]
        for grad_part in al_unc_line:
            if remaining > 0 and grad_part.get_center()[0] >= next_split:
                next_split += line_len
                al_unc_line_parts.append([])
            al_unc_line_parts[-1].append(grad_part)
        al_unc_line_parts = VGroup(al_unc_line_parts)

        self.play(
            Transform(
                VGroup(unc_line[ini_index + 1:]),
                al_unc_line_parts,
            ), Transform(unc_initial, al_unc_initial[0]),
            Transform(
                VGroup(unc_line[:ini_index]),
                VGroup(al_unc_initial[1:ini_index + 1]),
            ),
            Transform(
                unc_line[ini_index],
                VGroup(unc_initial[ini_index + 1:]),
            ))
        self.remove(*self.mobjects_from_last_animation)
        unc_subset = al_unc_subset
        self.add(unc_subset)

        unc_brace = BraceText(unc_subset, "stejná")
        self.play(unc_brace.creation_anim())

        cardinality = TexMobject("|", "\\omega_1", "|=\\aleph_1")
        cardinality.shift(self.omega1_brace.desc.get_center() -
                          cardinality[1].get_center())
        cardinality.remove(cardinality[1])
        self.wait_to(36)
        self.play(Write(cardinality))
        self.wait_to(46)
예제 #7
0
class LeastInfinite(Scene):
    def setup(self):
        self.shift = 1.1
        shift = self.shift

        self.omega = OrdinalOmega()
        self.omega_brace = BraceDesc(self.omega, "\\omega", UP)
        self.omega.set_color(BLUE)

        self.add(self.omega, self.omega_brace)

        # finite subset

        self.subset_fin = VGroup(self.omega[2:30:3]).copy()
        self.al_subset_fin = VGroup(self.omega[:len(self.subset_fin)]).copy()
        self.shifted_subset_fin = self.subset_fin.copy()
        VGroup(self.al_subset_fin, self.shifted_subset_fin).shift(shift * DOWN)

        self.brace_fin = BraceText(self.al_subset_fin, "konečná")

        # infinite subset

        self.subset_inf = LimitSubOrdinal(
            [bar for i, bar in enumerate(self.omega) if is_prime(i)]).copy()
        self.al_subset_inf = self.omega.copy()
        self.shifted_subset_inf = self.subset_inf.copy()
        self.subset_inf.shift(shift * UP)
        VGroup(self.al_subset_inf, self.shifted_subset_inf).shift(shift * DOWN)
        self.brace_inf = BraceText(self.al_subset_inf, "stejná")

    def construct(self):

        shift = self.shift

        # finite subset

        self.play(
            VGroup(self.omega, self.omega_brace).shift, shift * UP,
            Transform(self.subset_fin, self.shifted_subset_fin))
        self.wait_to(2.5)
        self.play(Transform(self.subset_fin, self.al_subset_fin))

        self.wait_to(7.5)
        self.play(self.brace_fin.creation_anim())
        self.wait_to(12)

        self.play(FadeOut(VGroup(self.subset_fin, self.brace_fin)))  # 13

        # infinite subset

        self.play(Transform(self.subset_inf, self.shifted_subset_inf))  # 14
        self.play(Transform(self.subset_inf, self.al_subset_inf))  # 15
        self.play(self.brace_inf.creation_anim())  # 16
        self.wait_to(40.5)

        self.play(FadeOut(VGroup(self.subset_inf, self.brace_inf)))

        omega1 = Omega1()
        omega1.shift(shift * UP)
        self.play(
            FadeIn(omega1),
            FadeOut(self.omega),
            self.omega_brace.change_brace_desc,
            omega1,
            "\\omega_1",
        )
예제 #8
0
    def construct(self):

        #self.force_skipping()
        
        question = TextMobject("What is Infinity?")
        question.scale(1.3)
        question.to_edge(UP)
        question1 = question.copy()

        self.play(Write(question))
        self.dither()

        infty_symbol = TexMobject('\\infty')
        infty_symbol.scale(5)
        self.play(Write(infty_symbol))
        self.dither()

        self.play(FadeOut(infty_symbol))
        question2 = TextMobject("What is infinite?")
        question2.scale(1.3)
        question2.to_edge(UP)

        self.play(ReplacementTransform(question, question2))
        self.dither()

        answer = TextMobject("That what is not","finite").scale(1.3)
        answer.next_to(question2, DOWN, buff = 0.5)
        answer_ori = answer.copy()
        answer_ori.shift(DOWN)
        answer_ori.highlight(BLACK)

        self.play(ReplacementTransform(answer_ori, answer))
        self.dither()

        finite_def = BraceText(answer[-1], "possible to express\\\\ by a natural number")
        self.play(finite_def.creation_anim())
        self.dither(2)

        dots5 = VGroup(*[Dot(color = BLUE) for _ in range(5)])
        dots5.arrange_submobjects(buff = 0.5)
        set5 = VGroup(VGroup(dots5), SurroundingRectangle(dots5, color = WHITE, buff = 0.3))

        dots100 = VGroup(*[
            VGroup(*[
                Dot(color = BLUE)
                for _ in range(10)
            ]).arrange_submobjects()
            for _ in range(10)
        ]).arrange_submobjects(DOWN)
        set100 = VGroup(dots100, SurroundingRectangle(dots100, color = WHITE))

        set100.to_corner(DOWN+LEFT)
        set5.move_to(set100)
        brace5 = BraceText(set5, "5", UP)
        self.play(FadeIn(set5), brace5.creation_anim())
        self.dither()
        self.play(brace5.change_desc, "finite")
        self.dither()
        self.play(FadeOut(brace5))

        brace100 = BraceText(set100, "100", RIGHT)
        self.play(
            ReplacementTransform(set5, set100),
            brace100.creation_anim(),
        )
        self.dither()
        self.play(brace100.change_desc, "finite")
        self.dither()
        self.play(FadeOut(VGroup(brace100, set100)))

        numbers = VGroup(*[
            TexMobject(str(i))
            for i in range(100)
        ])
        pseudo_num = SurroundingRectangle(numbers[-1], buff = 0, stroke_width = 0, fill_opacity = 1)
        numbers.gradient_highlight(BLUE, BLACK)
        numbers.arrange_submobjects(buff = 0.5)

        numbers.shift(-numbers.get_edge_center(LEFT))

        def perspective_shift(point):
            camera_distance = 10.0
            ratio = camera_distance / (camera_distance + point[0])
            return point*ratio

        numbers.apply_function(perspective_shift, maintain_smoothness = False)
        numbers.stretch_to_fit_width(2*SPACE_WIDTH-2)
        numbers.center()
        numbers.shift(0.5*LEFT)
        rect_inf = Rectangle(width = -2*numbers.get_edge_center(LEFT)[0] + 0.5,
                             height = numbers.get_height() + 0.5)
        set_inf = VGroup(rect_inf, numbers)
        set_inf.to_edge(DOWN)

        brace_inf = BraceText(set_inf, "infinite", UP, desc_scale = 1.3)
        self.play(FadeIn(set_inf), GrowFromCenter(brace_inf.brace))
        self.dither()
        self.play(Write(brace_inf.desc))
        self.dither(2)

        self.revert_to_original_skipping_status()
        self.play(FadeOut(VGroup(numbers, brace_inf, rect_inf, answer, finite_def)), ReplacementTransform(question2, question1))

        #set0 = Square(side_length = 1).move_to(set_inf)
        #brace0 = BraceText(set0, "finite", UP)
        #self.play(ReplacementTransform(rect_inf, set0))
        #self.play(brace0.creation_anim())
        #self.dither()
        #self.play(brace0.change_desc, '0')
        #self.dither(2)

        #self.play(FadeOut(VGroup(set0, brace0, answer, finite_def)), ReplacementTransform(question2, question1))
        self.dither()
        self.play(Write(TextMobject("Not just a number...")))
        self.dither(3)
예제 #9
0
    def construct(self):

        steps_str = [
            "All sets of certain property",
            "Mass operation",
            "New object of that property",
        ]
        steps = VGroup([TextMobject(step_str) for step_str in steps_str])
        steps.arrange_submobjects(DOWN, buff=1.5)
        #steps.to_edge(UP)
        arrow1 = Arrow(steps[0], steps[1])
        arrow2 = Arrow(steps[1], steps[2])

        self.play(FadeIn(steps[0], submobject_mode="lagged_start"))

        ordinals = OrdinalClass().to_edge(DOWN)
        #self.wait_to(8)
        self.play(FadeIn(ordinals))
        brace = BraceText(ordinals, ["Types of well-ordered", "sets"], UP)
        brace.desc[-1].highlight(YELLOW)
        self.play(brace.creation_anim())

        #self.wait_to(22)
        self.dither()

        self.play(FadeOut(VGroup(ordinals, brace)))
        self.play(
            ShowCreation(arrow1),
            FadeIn(steps[1], submobject_mode="lagged_start"),
        )

        all_sets1 = AllSetsPicture().scale(0.45)
        all_sets2 = all_sets1.copy()
        all_sets1.to_corner(DOWN + LEFT)
        all_sets2.to_corner(DOWN + RIGHT)

        rect1 = SurroundingRectangle(all_sets1, buff=0)
        rect2 = SurroundingRectangle(all_sets2)

        #self.wait_to(27)
        self.play(FadeIn(all_sets1), FadeIn(all_sets2))
        rectangles = all_sets1[0]
        self.play(
            FadeOut(VGroup(rectangles[4:])),
            ReplacementTransform(VGroup(rectangles[:4]), VGroup(rect1)),
        )
        self.remove(rectangles)

        self.play(ShowCreation(rect2))
        #self.wait_to(31)
        self.dither()
        self.play(FadeOut(VGroup(all_sets1[1], all_sets2, rect1, rect2)))
        self.play(
            ShowCreation(arrow2),
            FadeIn(steps[2], submobject_mode="lagged_start"),
        )

        p0 = steps[2].get_corner(UP + RIGHT) + 0.1 * UP
        p1 = steps[0].get_corner(DOWN + RIGHT) + 0.1 * DOWN
        p1 = p1 * Y_MASK + p0 * X_MASK
        center = (p0 + p1) / 2 + 7 * LEFT
        radius = np.linalg.norm(p0 - center)
        a0 = angle_of_vector(p0 - center)
        a1 = angle_of_vector(p1 - center)
        angle = (a1 - a0)

        arrow3 = Arc(angle, radius=radius, start_angle=a0).shift(center)
        arrow3.add_tip()
        arrow3.highlight(RED)
        contr_label = TextMobject("Conflict!").next_to(arrow3)

        #self.wait_to(37)
        self.play(ShowCreation(arrow3), FadeIn(contr_label))
        #self.wait_to(52)
        self.dither(2)
        return

        self.play(FadeOut(VGroup(
            arrow1,
            arrow2,
            arrow3,
            contr_label,
            steps,
        )))