{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "jupyter": { "source_hidden": true } }, "outputs": [], "source": [ "%cd ..\n", "import Librairie.AL_Fct as al\n", "%cd \"Chapitre 5 - Applications lineaires\"\n", "\n", "import numpy as np\n", "from IPython.display import display, Markdown, Latex\n", "import plotly.graph_objs as go\n", "import plotly\n", "import ipywidgets as widgets\n", "from ipywidgets import interact, interactive, fixed, interact_manual\n", "from ipywidgets import Layout, HBox, VBox, Label\n", "#import matplotlib\n", "#import plotly.express as px" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Concept(s)-clé(s)\n", "\n", "### THÉORÈME DU RANG :\n", "\n", "Soient $𝑉$,$𝑊$\n", "deux ℝ-espaces vectoriels et $𝑇:𝑉 \\rightarrow𝑊$ une application linéaire. Si 𝑉 est de dimension finie, alors $im(𝑇)$ est de dimension finie et $\\mbox{dim} V=\\mbox{dim} (\\mbox{ker} (T)) + \\mbox{dim}( \\mbox{im} (T)).$\n", "\n", "### Conséquences :\n", "1. $dim(Im(T)) = dim(V) - dim(ket(T)) \\rightarrow dim(Im(T)) \\leq dim(V)$\n", "2. Si $T$ est injectie, $ker(T) = {0}$, $ dim(V) = dim(Im(T)) \\leq dim(W)$\n", "3. Si $T$ est surjective, $W = im(T)$, $ dim(V) = dim(W) \\leq dim(V)$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### EXERCICE 1\n", "\n", "Soit l'application $T:\\mathbb{R}_2 \\rightarrow \\mathbb{P}_3(\\mathbb{R}_2)$\n", "\n", "$T(a,b) = a+ax+bx^2-(a+b)x^3$\n", "\n", "**1.1** $T$ peut-elle être surjective ?\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "jupyter": { "source_hidden": true } }, "outputs": [], "source": [ "def exercise_1_1():\n", " \n", " radio = widgets.RadioButtons(\n", " options=['Oui', 'Non'],\n", " description='Réponse:',\n", " disabled=False\n", " )\n", "\n", " button = widgets.Button(description='Vérifier')\n", " out = widgets.Output()\n", "\n", " def callback(e):\n", " out.clear_output()\n", " with out:\n", " if (radio.value == \"Oui\"):\n", " display(Markdown('Mauvaise réponse.'))\n", " else: \n", " display(Markdown('Correct !'))\n", " display(Latex(\"L'une des conséquences du théorème du rang est la suivante: si $T:V \\Rightarrow W$ est surjective, cela signifie que $W = im(T)$ et par le théorème du rang $dim(W) \\leq dim(V)$, mais dans notre cas $dim(W) > dim(V)$\"))\n", " \n", " button.on_click(callback)\n", " display(radio)\n", " display(button)\n", " display(out)\n", " \n", "exercise_1_1()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**1.2** $T$ Est elle injective ?\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "jupyter": { "source_hidden": true } }, "outputs": [], "source": [ "def exercise_1_2():\n", " \n", " radio = widgets.RadioButtons(\n", " options=['Oui', 'Non'],\n", " description='Réponse:',\n", " disabled=False\n", " )\n", "\n", " button = widgets.Button(description='Vérifier')\n", " solution_btn = widgets.Button(description='Solution', disabled = True)\n", " box = HBox([button, solution_btn])\n", " out = widgets.Output()\n", "\n", " def callback(e):\n", " out.clear_output()\n", " with out:\n", " if (radio.value == \"Non\"):\n", " display(Markdown('Mauvaise réponse.'))\n", " else: \n", " display(Markdown('Correct !'))\n", " solution_btn.disabled = False\n", "\n", " def solution(b):\n", " with out:\n", " display(Markdown(\"En remarque que si $T(a,b) = 0$ alors $a=b=0$, ce qui signifie que $ker(T) = 0 $. Ainsi, T est injective\"))\n", " \n", " button.on_click(callback)\n", " solution_btn.on_click(solution)\n", " display(radio)\n", " display(box)\n", " display(out)\n", " \n", "exercise_1_2()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### EXERCICE 2\n", "\n", "Soit l'application $T:M_{2 \\times 2}(\\mathbb{R})\\rightarrow \\mathbb{R}_3 $\n", "\n", "$T\\begin{pmatrix}\\begin{pmatrix}a & b \\\\ c& d \\end{pmatrix}\\end{pmatrix} = \\begin{pmatrix} a+b \\\\c+d \\\\ c-d \\end{pmatrix}$\n", "\n", "1.1 $T$ peut-elle être injective ?\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "jupyter": { "source_hidden": true } }, "outputs": [], "source": [ "def exercise_2_1():\n", " \n", " radio = widgets.RadioButtons(\n", " options=['Oui', 'Non'],\n", " description='Réponse:',\n", " disabled=False\n", " )\n", "\n", " button = widgets.Button(description='Vérifier')\n", " out = widgets.Output()\n", "\n", " def callback(e):\n", " out.clear_output()\n", " with out:\n", " if (radio.value == \"Oui\"):\n", " display(Markdown('Mauvaise réponse.'))\n", " else: \n", " display(Markdown('Correct !'))\n", " display(Markdown(\"L'une des conséquences du théorème du rang est la suivante: si $T:V \\Rightarrow W$ est injective, cela signifie que $ker(T) = 0$ et donc, par le théorème du rang, $dim(V) = dim(im(T)) \\leq dim(W)$, mais dans notre cas $dim(V) > dim(W)$\"))\n", " \n", " button.on_click(callback)\n", " display(radio)\n", " display(button)\n", " display(out)\n", " \n", "exercise_2_1()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "2.2 $T$ est-elle surjective ?\n", "Pour répondre a cette question, trouvez le noyau de T puis utilisez le théorème du rang\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def exercise_2_2():\n", " \n", " radio = widgets.RadioButtons(\n", " options=['Oui', 'Non'],\n", " description='Réponse:',\n", " disabled=False\n", " )\n", "\n", " button = widgets.Button(description='Vérifier')\n", " solution_btn = widgets.Button(description='Solution', disabled = True)\n", " box = HBox([button, solution_btn])\n", " out = widgets.Output()\n", "\n", " def callback(e):\n", " out.clear_output()\n", " with out:\n", " if (radio.value == \"Oui\"):\n", " display(Markdown('Mauvaise réponse.'))\n", " else: \n", " display(Markdown('Correct !'))\n", " solution_btn.disabled = False\n", "\n", " def solution(b):\n", " with out:\n", " display(Markdown(\"Le noyau de $T$ est définit par : $$ ker(T) = \\\\Bigg\\{ \\\\begin{pmatrix}a & b \\\\\\ c& d \\\\end{pmatrix} \\\\Bigg| \\\\begin{pmatrix} a+b \\\\\\ c+d \\\\\\ c-d \\\\end{pmatrix} = \\\\begin{pmatrix} 0 \\\\\\ 0 \\\\\\ 0 \\\\end{pmatrix} \\\\Bigg\\}$$\"))\n", " display(Markdown(\"Il correspond donc au système suivant: $\\\\begin{equation}\\left\\{\\\\begin{aligned} a+b = 0 \\\\\\ c+d = 0 \\\\\\ c-d = 0 \\end{aligned}\\\\right.\\end{equation}$ $\\\\rightarrow$ $\\\\begin{equation}\\left\\{\\\\begin{aligned} a = -b \\\\\\ c = 0 \\\\\\ d = 0 \\end{aligned}\\\\right.\\end{equation}$\")) \n", " display(Markdown(\"Ainsi, $$ ker(T) = \\\\Bigg\\{ \\\\begin{pmatrix}a & -a \\\\\\ 0 & 0 \\\\end{pmatrix} \\\\Bigg| \\\\quad a \\in \\mathbb{R} \\\\Bigg\\}$$\"))\n", " \n", " button.on_click(callback)\n", " solution_btn.on_click(solution)\n", " display(radio)\n", " display(box)\n", " display(out)\n", " \n", "exercise_2_2()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.4" } }, "nbformat": 4, "nbformat_minor": 4 }