Let$\DeclareMathOperator\rank{rank}$Let $G$ be a compact connected Lie group and $H$, $K$ be two closed connected subgroups. By the answerMikhail Borovoi's answer to the question asked here
In a compact lie group, can two closed connected subgroups generate a non-closed subgroup?
, $L=\langle K, H\rangle$ (the subgroup generated by $K$, $H$) is a closed connected subgroup of $G$ (hence a Lie subgroup). Now assume additionally that $$r=rank~(H\cap K)=rank~H=rank~K.$$$$r=\rank(H\cap K)=\rank H=\rank K.$$ My question is if we can conclude that $$rank~L=r.$$$$\rank L=r.$$